diff options
783 files changed, 14559 insertions, 14564 deletions
diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h index 7bd69defdf..8b0ce2f703 100644 --- a/core/include/fdrm/fx_crypt.h +++ b/core/include/fdrm/fx_crypt.h @@ -20,26 +20,26 @@ void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DW void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv); void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size); void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size); -void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[16]); +void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[16]); void CRYPT_MD5Start(FX_LPVOID context); void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_MD5Finish(FX_LPVOID context, FX_BYTE digest[16]); -void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]); +void CRYPT_MD5Finish(FX_LPVOID context, uint8_t digest[16]); +void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[20]); void CRYPT_SHA1Start(FX_LPVOID context); void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]); -void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]); +void CRYPT_SHA1Finish(FX_LPVOID context, uint8_t digest[20]); +void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[32]); void CRYPT_SHA256Start(FX_LPVOID context); void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA256Finish(FX_LPVOID context, FX_BYTE digest[32]); +void CRYPT_SHA256Finish(FX_LPVOID context, uint8_t digest[32]); void CRYPT_SHA384Start(FX_LPVOID context); void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]); -void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[48]); +void CRYPT_SHA384Finish(FX_LPVOID context, uint8_t digest[48]); +void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[48]); void CRYPT_SHA512Start(FX_LPVOID context); void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]); -void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]); +void CRYPT_SHA512Finish(FX_LPVOID context, uint8_t digest[64]); +void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[64]); void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len)); #ifdef __cplusplus diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index c0065def47..8444f09b70 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -520,7 +520,7 @@ public: void SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); - void InitStream(FX_BYTE* pData, FX_DWORD size, CPDF_Dictionary* pDict); + void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict); @@ -657,7 +657,7 @@ protected: FX_DWORD m_SrcOffset; - FX_BYTE m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE]; + uint8_t m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE]; friend class CPDF_Stream; }; class CPDF_Null : public CPDF_Object diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h index 1b53bdc859..e09c0456fe 100644 --- a/core/include/fpdfapi/fpdf_pageobj.h +++ b/core/include/fpdfapi/fpdf_pageobj.h @@ -114,7 +114,7 @@ public: CPDF_Path* m_pPathList; - FX_BYTE* m_pTypeList; + uint8_t* m_pTypeList; int m_TextCount; diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index d18d362ec0..f0e3e2ca08 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -269,7 +269,7 @@ public: CFX_ByteString GetKeyword(); - void GetBinary(FX_BYTE* buffer, FX_DWORD size); + void GetBinary(uint8_t* buffer, FX_DWORD size); void ToNextLine(); @@ -291,18 +291,18 @@ public: return m_pCryptoHandler != NULL; } - FX_BOOL GetCharAt(FX_FILESIZE pos, FX_BYTE& ch); + FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); - FX_BOOL ReadBlock(FX_BYTE* pBuf, FX_DWORD size); + FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); protected: static const int kParserMaxRecursionDepth = 64; static int s_CurrentRecursionDepth; - virtual FX_BOOL GetNextChar(FX_BYTE& ch); + virtual FX_BOOL GetNextChar(uint8_t& ch); - FX_BOOL GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch); + FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); void GetNextWord(); @@ -326,7 +326,7 @@ protected: FX_FILESIZE m_FileLen; - FX_BYTE* m_pFileBuf; + uint8_t* m_pFileBuf; FX_DWORD m_BufSize; @@ -334,7 +334,7 @@ protected: CPDF_CryptoHandler* m_pCryptoHandler; - FX_BYTE m_WordBuffer[257]; + uint8_t m_WordBuffer[257]; FX_DWORD m_WordSize; @@ -458,7 +458,7 @@ public: return m_ObjVersion[objnum]; } - void GetIndirectBinary(FX_DWORD objnum, FX_BYTE*& pBuffer, FX_DWORD& size); + void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); FX_BOOL GetFileStreamOption() { @@ -635,7 +635,7 @@ public: FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT); CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size); - CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len); + CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, int32_t key_len); int GetVersion() { return m_Version; @@ -661,16 +661,16 @@ private: FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); FX_BOOL CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size, - FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len); + FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, int32_t key_len); - FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, FX_INT32 key_len); + FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, int32_t key_len); FX_BOOL AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key); void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key); void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, FX_LPCBYTE key); void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, FX_LPCBYTE user_pass, FX_DWORD user_size, FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type); - FX_BOOL CheckSecurity(FX_INT32 key_len); + FX_BOOL CheckSecurity(int32_t key_len); FX_BOOL m_bOwner; @@ -678,7 +678,7 @@ private: int m_Cipher; - FX_BYTE m_EncryptKey[32]; + uint8_t m_EncryptKey[32]; int m_KeyLen; }; @@ -731,7 +731,7 @@ protected: virtual FX_BOOL CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); virtual FX_BOOL CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); - FX_BYTE m_EncryptKey[32]; + uint8_t m_EncryptKey[32]; int m_KeyLen; @@ -798,9 +798,9 @@ protected: CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec); void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fullpath); -void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD FlateDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); class CPDF_NumberTree { public: @@ -847,8 +847,8 @@ public: virtual void SetDocument(CPDF_Document* pDoc) = 0; virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; virtual FX_BOOL IsLinearized() = 0; - virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) = 0; - virtual FX_INT32 IsLinearizedPDF() = 0; + virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) = 0; + virtual int32_t IsLinearizedPDF() = 0; virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0; protected: diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h index 47d1b19920..2f03ae5bb7 100644 --- a/core/include/fpdfapi/fpdf_render.h +++ b/core/include/fpdfapi/fpdf_render.h @@ -241,7 +241,7 @@ public: void ClearImageData(); FX_DWORD EstimateSize(); - void CacheOptimization(FX_INT32 dwLimitCacheSize); + void CacheOptimization(int32_t dwLimitCacheSize); FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; FX_DWORD GetTimeCount() const { @@ -254,7 +254,7 @@ public: void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, - CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); void ClearImageCache(CPDF_Stream* pStream); @@ -266,7 +266,7 @@ public: public: FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, - FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); FX_BOOL Continue(IFX_Pause* pPause); CPDF_ImageCache* m_pCurImageCache; diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index f1ea6b5a23..06dcdfec44 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -160,7 +160,7 @@ public: if (offset < 0 || nStrLen < 1) { return 0; } - FX_BYTE ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1]; + uint8_t ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1]; return static_cast<FX_DWORD>(ch); } @@ -326,14 +326,14 @@ public: FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const; - FX_WCHAR UnicodeFromCharCode(FX_BYTE charcode) const + FX_WCHAR UnicodeFromCharCode(uint8_t charcode) const { return m_Unicodes[charcode]; } int CharCodeFromUnicode(FX_WCHAR unicode) const; - void SetUnicode(FX_BYTE charcode, FX_WCHAR unicode) + void SetUnicode(uint8_t charcode, FX_WCHAR unicode) { m_Unicodes[charcode] = unicode; } @@ -368,7 +368,7 @@ protected: virtual void LoadGlyphMap() = 0; virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const { - return m_Encoding.UnicodeFromCharCode((FX_BYTE)charcode); + return m_Encoding.UnicodeFromCharCode((uint8_t)charcode); } virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const { @@ -831,7 +831,7 @@ public: { } FX_ARGB* pMatteColor; - FX_INT32 nQuality; + int32_t nQuality; }; class CPDF_Image { @@ -884,12 +884,12 @@ public: - FX_INT32 GetPixelHeight() const + int32_t GetPixelHeight() const { return m_Height; } - FX_INT32 GetPixelWidth() const + int32_t GetPixelWidth() const { return m_Width; } @@ -909,9 +909,9 @@ public: - void SetImage(const CFX_DIBitmap* pDIBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL); + void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL); - void SetJpegImage(FX_BYTE* pImageData, FX_DWORD size); + void SetJpegImage(uint8_t* pImageData, FX_DWORD size); void SetJpegImage(IFX_FileRead *pFile); @@ -931,9 +931,9 @@ private: FX_BOOL m_bInline; CPDF_Dictionary* m_pInlineDict; - FX_INT32 m_Height; + int32_t m_Height; - FX_INT32 m_Width; + int32_t m_Width; FX_BOOL m_bIsMask; diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h index fc55fa08a9..e4a0aec2e5 100644 --- a/core/include/fpdfapi/fpdf_serial.h +++ b/core/include/fpdfapi/fpdf_serial.h @@ -127,9 +127,9 @@ public: FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); - FX_INT32 Continue(IFX_Pause *pPause = NULL); + int32_t Continue(IFX_Pause *pPause = NULL); - FX_BOOL SetFileVersion(FX_INT32 fileVersion = 17); + FX_BOOL SetFileVersion(int32_t fileVersion = 17); protected: CPDF_Document* m_pDocument; @@ -155,16 +155,16 @@ protected: CPDF_XRefStream* m_pXRefStream; - FX_INT32 m_ObjectStreamSize; + int32_t m_ObjectStreamSize; FX_DWORD m_dwLastObjNum; FX_BOOL Create(FX_DWORD flags); void ResetStandardSecurity(); void Clear(); - FX_INT32 WriteDoc_Stage1(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage2(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage3(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage4(IFX_Pause *pPause); + int32_t WriteDoc_Stage1(IFX_Pause *pPause); + int32_t WriteDoc_Stage2(IFX_Pause *pPause); + int32_t WriteDoc_Stage3(IFX_Pause *pPause); + int32_t WriteDoc_Stage4(IFX_Pause *pPause); CFX_FileBufferArchive m_File; @@ -172,19 +172,19 @@ protected: void InitOldObjNumOffsets(); void InitNewObjNumOffsets(); void AppendNewObjNum(FX_DWORD objbum); - FX_INT32 WriteOldIndirectObject(FX_DWORD objnum); - FX_INT32 WriteOldObjs(IFX_Pause *pPause); - FX_INT32 WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); - FX_INT32 WriteIndirectObj(const CPDF_Object* pObj); - FX_INT32 WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); - FX_INT32 WriteIndirectObjectToStream(const CPDF_Object* pObj); - FX_INT32 WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); - FX_INT32 WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); - FX_INT32 AppendObjectNumberToXRef(FX_DWORD objnum); + int32_t WriteOldIndirectObject(FX_DWORD objnum); + int32_t WriteOldObjs(IFX_Pause *pPause); + int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); + int32_t WriteIndirectObj(const CPDF_Object* pObj); + int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); + int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); + int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); + int32_t WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); + int32_t AppendObjectNumberToXRef(FX_DWORD objnum); void InitID(FX_BOOL bDefault = TRUE); - FX_INT32 WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); + int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); - FX_INT32 m_iStage; + int32_t m_iStage; FX_DWORD m_dwFlags; FX_POSITION m_Pos; FX_FILESIZE m_XrefStart; @@ -196,7 +196,7 @@ protected: CPDF_Array* m_pIDArray; - FX_INT32 m_FileVersion; + int32_t m_FileVersion; friend class CPDF_ObjectStream; friend class CPDF_XRefStream; }; diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h index 39daf028ac..1d30ebbb0a 100644 --- a/core/include/fpdfdoc/fpdf_ap.h +++ b/core/include/fpdfdoc/fpdf_ap.h @@ -15,19 +15,19 @@ class IPVT_FontMap { public: virtual ~IPVT_FontMap() { } - virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex) = 0; - virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0; + virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; }; struct CPVT_Dash { - CPVT_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase) + CPVT_Dash(int32_t dash, int32_t gap, int32_t phase) : nDash(dash), nGap(gap), nPhase(phase) {} - FX_INT32 nDash; + int32_t nDash; - FX_INT32 nGap; + int32_t nGap; - FX_INT32 nPhase; + int32_t nPhase; }; #define CT_TRANSPARENT 0 #define CT_GRAY 1 @@ -35,11 +35,11 @@ struct CPVT_Dash { #define CT_CMYK 3 struct CPVT_Color { - CPVT_Color(FX_INT32 type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) + CPVT_Color(int32_t type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4) {} - FX_INT32 nColorType; + int32_t nColorType; FX_FLOAT fColor1; FX_FLOAT fColor2; FX_FLOAT fColor3; @@ -53,17 +53,17 @@ public: virtual ~CPVT_Provider(); - FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle); + int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle); - FX_INT32 GetTypeAscent(FX_INT32 nFontIndex); + int32_t GetTypeAscent(int32_t nFontIndex); - FX_INT32 GetTypeDescent(FX_INT32 nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); - FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); + int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); FX_BOOL IsLatinWord(FX_WORD word); - FX_INT32 GetDefaultFontIndex(); + int32_t GetDefaultFontIndex(); private: IPVT_FontMap * m_pFontMap; @@ -88,7 +88,7 @@ public: static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth, const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom, - FX_INT32 nStyle, const CPVT_Dash & dash); + int32_t nStyle, const CPVT_Dash & dash); static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke); }; diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index 307a31cd20..14cc145d6d 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -331,7 +331,7 @@ public: CPDF_Dictionary* GetAnnot() const; - FX_INT32 GetOperationType() const; + int32_t GetOperationType() const; CPDF_Stream* GetSoundStream() const { @@ -733,19 +733,19 @@ public: static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocument); - static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet = 1); + static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, uint8_t iCharSet = 1); - static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet = 1); + static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, uint8_t iCharSet = 1); static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName); - static CFX_ByteString GetNativeFont(FX_BYTE iCharSet, FX_LPVOID pLogFont = NULL); + static CFX_ByteString GetNativeFont(uint8_t iCharSet, FX_LPVOID pLogFont = NULL); static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL); - static FX_BYTE GetNativeCharSet(); + static uint8_t GetNativeCharSet(); - static CPDF_Font* AddNativeFont(FX_BYTE iCharSet, const CPDF_Document* pDocument); + static CPDF_Font* AddNativeFont(uint8_t iCharSet, const CPDF_Document* pDocument); static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument); @@ -837,7 +837,7 @@ public: CPDF_Font* GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag); - CPDF_Font* GetNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag); + CPDF_Font* GetNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag); CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag); @@ -856,7 +856,7 @@ public: void AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag); - CPDF_Font* AddNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag); + CPDF_Font* AddNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag); CPDF_Font* AddNativeFormFont(CFX_ByteString& csNameTag); @@ -1517,10 +1517,10 @@ public: CFX_WideString GetLabel(int nPage) const; - FX_INT32 GetPageByLabel(FX_BSTR bsLabel) const; + int32_t GetPageByLabel(FX_BSTR bsLabel) const; - FX_INT32 GetPageByLabel(FX_WSTR wsLabel) const; + int32_t GetPageByLabel(FX_WSTR wsLabel) const; protected: CPDF_Document* m_pDocument; @@ -1537,7 +1537,7 @@ public: void LoadDoc(CPDF_Document *pDoc); - FX_INT32 GetString(FX_BSTR bsItem, CFX_WideString &wsStr); + int32_t GetString(FX_BSTR bsItem, CFX_WideString &wsStr); CXML_Element* GetRoot() const; @@ -1560,7 +1560,7 @@ public: FX_BOOL PrintScaling() const; - FX_INT32 NumCopies() const; + int32_t NumCopies() const; CPDF_Array* PrintPageRange() const; diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h index 87ef02576b..fbfeacb755 100644 --- a/core/include/fpdfdoc/fpdf_vt.h +++ b/core/include/fpdfdoc/fpdf_vt.h @@ -26,7 +26,7 @@ struct CPVT_WordPlace { { } - CPVT_WordPlace(FX_INT32 nSecIndex, FX_INT32 nLineIndex, FX_INT32 nWordIndex) + CPVT_WordPlace(int32_t nSecIndex, int32_t nLineIndex, int32_t nWordIndex) { this->nSecIndex = nSecIndex; this->nLineIndex = nLineIndex; @@ -48,7 +48,7 @@ struct CPVT_WordPlace { return wp.nSecIndex != this->nSecIndex || wp.nLineIndex != this->nLineIndex || wp.nWordIndex != this->nWordIndex; } - inline FX_INT32 WordCmp(const CPVT_WordPlace & wp) const + inline int32_t WordCmp(const CPVT_WordPlace & wp) const { if (this->nSecIndex > wp.nSecIndex) { return 1; @@ -71,7 +71,7 @@ struct CPVT_WordPlace { return 0; } - inline FX_INT32 LineCmp(const CPVT_WordPlace & wp) const + inline int32_t LineCmp(const CPVT_WordPlace & wp) const { if (this->nSecIndex > wp.nSecIndex) { return 1; @@ -88,7 +88,7 @@ struct CPVT_WordPlace { return 0; } - inline FX_INT32 SecCmp(const CPVT_WordPlace & wp) const + inline int32_t SecCmp(const CPVT_WordPlace & wp) const { if (this->nSecIndex > wp.nSecIndex) { return 1; @@ -99,11 +99,11 @@ struct CPVT_WordPlace { return 0; } - FX_INT32 nSecIndex; + int32_t nSecIndex; - FX_INT32 nLineIndex; + int32_t nLineIndex; - FX_INT32 nWordIndex; + int32_t nWordIndex; }; struct CPVT_WordRange { @@ -170,7 +170,7 @@ struct CPVT_SecProps { { } - CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, FX_INT32 alignment) : + CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) : fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment) { } @@ -184,7 +184,7 @@ struct CPVT_SecProps { FX_FLOAT fLineIndent; - FX_INT32 nAlignment; + int32_t nAlignment; }; struct CPVT_WordProps { @@ -193,8 +193,8 @@ struct CPVT_WordProps { { } - CPVT_WordProps(FX_INT32 fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, FX_INT32 scriptType = 0, FX_INT32 wordStyle = 0, - FX_FLOAT charSpace = 0, FX_INT32 horzScale = 100) : + CPVT_WordProps(int32_t fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, int32_t scriptType = 0, int32_t wordStyle = 0, + FX_FLOAT charSpace = 0, int32_t horzScale = 100) : nFontIndex(fontIndex), fFontSize(fontSize), dwWordColor(wordColor), nScriptType(scriptType), nWordStyle(wordStyle), fCharSpace(charSpace), nHorzScale(horzScale) { @@ -207,19 +207,19 @@ struct CPVT_WordProps { { } - FX_INT32 nFontIndex; + int32_t nFontIndex; FX_FLOAT fFontSize; FX_COLORREF dwWordColor; - FX_INT32 nScriptType; + int32_t nScriptType; - FX_INT32 nWordStyle; + int32_t nWordStyle; FX_FLOAT fCharSpace; - FX_INT32 nHorzScale; + int32_t nHorzScale; }; struct CPVT_Word { @@ -230,7 +230,7 @@ struct CPVT_Word { FX_WORD Word; - FX_INT32 nCharset; + int32_t nCharset; CPVT_WordPlace WordPlace; @@ -242,7 +242,7 @@ struct CPVT_Word { FX_FLOAT fWidth; - FX_INT32 nFontIndex; + int32_t nFontIndex; FX_FLOAT fFontSize; @@ -281,17 +281,17 @@ class IPDF_VariableText_Provider public: virtual ~IPDF_VariableText_Provider() { } - virtual FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0; + virtual int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle) = 0; - virtual FX_INT32 GetTypeAscent(FX_INT32 nFontIndex) = 0; + virtual int32_t GetTypeAscent(int32_t nFontIndex) = 0; - virtual FX_INT32 GetTypeDescent(FX_INT32 nFontIndex) = 0; + virtual int32_t GetTypeDescent(int32_t nFontIndex) = 0; - virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0; + virtual int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; virtual FX_BOOL IsLatinWord(FX_WORD word) = 0; - virtual FX_INT32 GetDefaultFontIndex() = 0; + virtual int32_t GetDefaultFontIndex() = 0; }; class IPDF_VariableText_Iterator { @@ -320,7 +320,7 @@ public: virtual FX_BOOL SetSection(const CPVT_Section & section) = 0; - virtual void SetAt(FX_INT32 nWordIndex) = 0; + virtual void SetAt(int32_t nWordIndex) = 0; virtual void SetAt(const CPVT_WordPlace & place) = 0; @@ -339,17 +339,17 @@ public: virtual void SetPlateRect(const CPDF_Rect & rect) = 0; - virtual void SetAlignment(FX_INT32 nFormat = 0) = 0; + virtual void SetAlignment(int32_t nFormat = 0) = 0; virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0; - virtual void SetLimitChar(FX_INT32 nLimitChar = 0) = 0; + virtual void SetLimitChar(int32_t nLimitChar = 0) = 0; - virtual void SetCharArray(FX_INT32 nCharArray = 0) = 0; + virtual void SetCharArray(int32_t nCharArray = 0) = 0; virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0; - virtual void SetHorzScale(FX_INT32 nHorzScale = 100) = 0; + virtual void SetHorzScale(int32_t nHorzScale = 100) = 0; virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0; @@ -375,16 +375,16 @@ public: virtual void ResetAll() = 0; - virtual void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL, + virtual void SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL) = 0; - virtual CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1, + virtual CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1, const CPVT_WordProps * pWordProps = NULL) = 0; virtual CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL) = 0; - virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1, + virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL) = 0; virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange) = 0; @@ -397,21 +397,21 @@ public: virtual CPDF_Rect GetContentRect() const = 0; - virtual FX_INT32 GetTotalWords() const = 0; + virtual int32_t GetTotalWords() const = 0; virtual FX_FLOAT GetFontSize() const = 0; - virtual FX_INT32 GetAlignment() const = 0; + virtual int32_t GetAlignment() const = 0; virtual FX_WORD GetPasswordChar() const = 0; - virtual FX_INT32 GetCharArray() const = 0; + virtual int32_t GetCharArray() const = 0; - virtual FX_INT32 GetLimitChar() const = 0; + virtual int32_t GetLimitChar() const = 0; virtual FX_BOOL IsMultiLine() const = 0; - virtual FX_INT32 GetHorzScale() const = 0; + virtual int32_t GetHorzScale() const = 0; virtual FX_FLOAT GetCharSpace() const = 0; @@ -441,9 +441,9 @@ public: virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0; - virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; + virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; - virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0; + virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; protected: ~IPDF_VariableText() { } diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h index d18a7692c6..65c20b04b4 100644 --- a/core/include/fpdftext/fpdf_text.h +++ b/core/include/fpdftext/fpdf_text.h @@ -36,7 +36,7 @@ CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary typedef struct { FX_WCHAR m_Unicode; FX_WCHAR m_Charcode; - FX_INT32 m_Flag; + int32_t m_Flag; FX_FLOAT m_FontSize; FX_FLOAT m_OriginX; FX_FLOAT m_OriginY; diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index 6a62c2d12c..31dea3b8d2 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -114,9 +114,9 @@ class ICodec_BasicModule public: virtual ~ICodec_BasicModule() {} - virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; - virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc) = 0; @@ -154,10 +154,10 @@ public: virtual ~ICodec_FlateModule() {} virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0; - virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, + virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; - virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size, + virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; @@ -258,23 +258,23 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
- virtual FX_INT32 ReadHeader(void* pContext, int* width, int* height,
+ virtual int32_t ReadHeader(void* pContext, int* width, int* height,
int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute = NULL) = 0;
- virtual FX_INT32 LoadFrameInfo(void* pContext, int* frame_num) = 0;
+ virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0;
void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
- FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, FX_INT32 frame_num, FX_INT32 pal_size);
+ FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, int32_t frame_num, int32_t pal_size);
- virtual FX_INT32 LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual int32_t LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace);
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace);
- void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
};
class ICodec_BmpModule {
@@ -290,14 +290,14 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
- virtual FX_INT32 ReadHeader(void* pContext, FX_INT32* width, FX_INT32* height, FX_BOOL* tb_flag, FX_INT32* components,
+ virtual int32_t ReadHeader(void* pContext, int32_t* width, int32_t* height, FX_BOOL* tb_flag, int32_t* components,
int* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute = NULL) = 0;
- virtual FX_INT32 LoadImage(void* pContext) = 0;
+ virtual int32_t LoadImage(void* pContext) = 0;
FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
- void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
};
class ICodec_TiffModule {
@@ -308,9 +308,9 @@ public: virtual FX_LPVOID CreateDecoder(IFX_FileRead* file_ptr) = 0;
- virtual void GetFrames(FX_LPVOID ctx, FX_INT32& frames) = 0;
+ virtual void GetFrames(FX_LPVOID ctx, int32_t& frames) = 0;
- virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap) = 0;
@@ -348,21 +348,21 @@ public: virtual FXCODEC_IMAGE_TYPE GetType() = 0;
- virtual FX_INT32 GetWidth() = 0;
+ virtual int32_t GetWidth() = 0;
- virtual FX_INT32 GetHeight() = 0;
+ virtual int32_t GetHeight() = 0;
- virtual FX_INT32 GetNumComponents() = 0;
+ virtual int32_t GetNumComponents() = 0;
- virtual FX_INT32 GetBPC() = 0;
+ virtual int32_t GetBPC() = 0;
virtual void SetClipBox(FX_RECT* clip) = 0;
- virtual FXCODEC_STATUS GetFrames(FX_INT32& frames, IFX_Pause* pPause = NULL) = 0;
+ virtual FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = NULL) = 0;
virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap,
- FX_INT32 start_x, FX_INT32 start_y, FX_INT32 size_x, FX_INT32 size_y,
- FX_INT32 frames = 0, FX_BOOL bInterpol = TRUE) = 0;
+ int32_t start_x, int32_t start_y, int32_t size_x, int32_t size_y,
+ int32_t frames = 0, FX_BOOL bInterpol = TRUE) = 0;
virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
};
@@ -415,11 +415,11 @@ public: ) = 0; - virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0; - virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, - FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents, + FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT ) = 0; @@ -431,18 +431,19 @@ public: virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0; virtual void SetComponents(FX_DWORD nComponents) = 0; }; + void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B); -void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B); -FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16]); +void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t m, uint8_t y, uint8_t k, uint8_t& R, uint8_t& G, uint8_t& B); +FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, uint8_t ID[16]); class CFX_DIBAttribute {
public:
CFX_DIBAttribute();
~CFX_DIBAttribute();
- FX_INT32 m_nXDPI;
+ int32_t m_nXDPI;
- FX_INT32 m_nYDPI;
+ int32_t m_nYDPI;
FX_FLOAT m_fAspectRatio;
@@ -450,16 +451,16 @@ public: CFX_ByteString m_strAuthor;
- FX_BYTE m_strTime[20];
+ uint8_t m_strTime[20];
- FX_INT32 m_nGifLeft;
- FX_INT32 m_nGifTop;
+ int32_t m_nGifLeft;
+ int32_t m_nGifTop;
FX_DWORD* m_pGifLocalPalette;
FX_DWORD m_nGifLocalPalNum;
- FX_INT32 m_nBmpCompressType;
+ int32_t m_nBmpCompressType;
class IFX_DIBAttributeExif* m_pExif;
};
class IFX_DIBAttributeExif diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h index 8c2a8eba42..56f56fb9ab 100644 --- a/core/include/fxcrt/fx_arb.h +++ b/core/include/fxcrt/fx_arb.h @@ -55,9 +55,9 @@ public: virtual FX_WCHAR GetFormChar(FX_WCHAR wch, FX_WCHAR prev = 0, FX_WCHAR next = 0) const = 0; virtual FX_WCHAR GetFormChar(const CFX_Char *cur, const CFX_Char *prev, const CFX_Char *next) const = 0; }; -void FX_BidiLine(CFX_WideString &wsText, FX_INT32 iBaseLevel = 0); -void FX_BidiLine(CFX_TxtCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); -void FX_BidiLine(CFX_RTFCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); +void FX_BidiLine(CFX_WideString &wsText, int32_t iBaseLevel = 0); +void FX_BidiLine(CFX_TxtCharArray &chars, int32_t iCount, int32_t iBaseLevel = 0); +void FX_BidiLine(CFX_RTFCharArray &chars, int32_t iCount, int32_t iBaseLevel = 0); class IFX_BidiChar { public: @@ -66,7 +66,7 @@ public: virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; virtual FX_BOOL EndChar() = 0; - virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) = 0; + virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0; virtual void Reset() = 0; protected: diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 111e0d3876..fbcb657012 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -41,14 +41,14 @@ public: void AppendBlock(const void* pBuf, FX_STRSIZE size); - void AppendFill(FX_BYTE byte, FX_STRSIZE count); + void AppendFill(uint8_t byte, FX_STRSIZE count); void AppendString(FX_BSTR str) { AppendBlock(str.GetPtr(), str.GetLength()); } - inline void AppendByte(FX_BYTE byte) + inline void AppendByte(uint8_t byte) { if (m_AllocSize <= m_DataSize) { ExpandBuf(1); @@ -99,7 +99,7 @@ public: void AppendChar(int ch) { - AppendByte((FX_BYTE)ch); + AppendByte((uint8_t)ch); } CFX_ByteTextBuf& operator << (int i); @@ -160,7 +160,7 @@ class CFX_ArchiveSaver public: CFX_ArchiveSaver() : m_pStream(NULL) {} - CFX_ArchiveSaver& operator << (FX_BYTE i); + CFX_ArchiveSaver& operator << (uint8_t i); CFX_ArchiveSaver& operator << (int i); @@ -178,7 +178,7 @@ public: void Write(const void* pData, FX_STRSIZE dwSize); - FX_INTPTR GetLength() + intptr_t GetLength() { return m_SavingBuf.GetSize(); } @@ -204,7 +204,7 @@ public: CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize); - CFX_ArchiveLoader& operator >> (FX_BYTE& i); + CFX_ArchiveLoader& operator >> (uint8_t& i); CFX_ArchiveLoader& operator >> (int& i); @@ -241,14 +241,14 @@ public: FX_BOOL Flush(); - FX_INT32 AppendBlock(const void* pBuf, size_t size); + int32_t AppendBlock(const void* pBuf, size_t size); - FX_INT32 AppendByte(FX_BYTE byte); + int32_t AppendByte(uint8_t byte); - FX_INT32 AppendDWord(FX_DWORD i); + int32_t AppendDWord(FX_DWORD i); - FX_INT32 AppendString(FX_BSTR lpsz); + int32_t AppendString(FX_BSTR lpsz); protected: @@ -282,14 +282,14 @@ private: }; struct CFX_CharMap { - static CFX_CharMap* GetDefaultMapper(FX_INT32 codepage = 0); + static CFX_CharMap* GetDefaultMapper(int32_t codepage = 0); CFX_WideString (*m_GetWideString)(CFX_CharMap* pMap, const CFX_ByteString& bstr); CFX_ByteString (*m_GetByteString)(CFX_CharMap* pMap, const CFX_WideString& wstr); - FX_INT32 (*m_GetCodePage)(); + int32_t (*m_GetCodePage)(); }; class CFX_UTF8Decoder { @@ -301,7 +301,7 @@ public: void Clear(); - void Input(FX_BYTE byte); + void Input(uint8_t byte); void AppendChar(FX_DWORD ch); @@ -541,13 +541,13 @@ public: return -1; } }; -typedef CFX_ArrayTemplate<FX_BYTE> CFX_ByteArray; +typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray; typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray; typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray; typedef CFX_ArrayTemplate<void*> CFX_PtrArray; typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray; typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray; -typedef CFX_ArrayTemplate<FX_INT32> CFX_Int32Array; +typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array; template <class ObjectClass> class CFX_ObjectArray : public CFX_BasicArray { @@ -574,12 +574,12 @@ public: return InsertSpaceAt(m_nSize, 1); } - FX_INT32 Append(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1) + int32_t Append(const CFX_ObjectArray& src, int32_t nStart = 0, int32_t nCount = -1) { if (nCount == 0) { return 0; } - FX_INT32 nSize = src.GetSize(); + int32_t nSize = src.GetSize(); if (!nSize) { return 0; } @@ -597,18 +597,18 @@ public: InsertSpaceAt(m_nSize, nCount); ObjectClass* pStartObj = (ObjectClass*)GetDataPtr(nSize); nSize = nStart + nCount; - for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) { + for (int32_t i = nStart; i < nSize; i ++, pStartObj++) { new ((void*)pStartObj) ObjectClass(src[i]); } return nCount; } - FX_INT32 Copy(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1) + int32_t Copy(const CFX_ObjectArray& src, int32_t nStart = 0, int32_t nCount = -1) { if (nCount == 0) { return 0; } - FX_INT32 nSize = src.GetSize(); + int32_t nSize = src.GetSize(); if (!nSize) { return 0; } @@ -626,7 +626,7 @@ public: SetSize(nCount); ObjectClass* pStartObj = (ObjectClass*)m_pData; nSize = nStart + nCount; - for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) { + for (int32_t i = nStart; i < nSize; i ++, pStartObj++) { new ((void*)pStartObj) ObjectClass(src[i]); } return nCount; @@ -704,9 +704,9 @@ private: short m_SegmentSize; - FX_BYTE m_IndexSize; + uint8_t m_IndexSize; - FX_BYTE m_IndexDepth; + uint8_t m_IndexDepth; int m_DataSize; @@ -859,26 +859,26 @@ public: FX_BOOL Lookup(KeyType key, ValueType& rValue) const { FX_LPVOID pValue = NULL; - if (!CFX_MapPtrToPtr::Lookup((void*)(FX_UINTPTR)key, pValue)) { + if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) { return FALSE; } - rValue = (ValueType)(FX_UINTPTR)pValue; + rValue = (ValueType)(uintptr_t)pValue; return TRUE; } ValueType& operator[](KeyType key) { - return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(FX_UINTPTR)key); + return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(uintptr_t)key); } void SetAt(KeyType key, ValueType newValue) { - CFX_MapPtrToPtr::SetAt((void*)(FX_UINTPTR)key, (void*)(FX_UINTPTR)newValue); + CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue); } FX_BOOL RemoveKey(KeyType key) { - return CFX_MapPtrToPtr::RemoveKey((void*)(FX_UINTPTR)key); + return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key); } void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey, ValueType& rValue) const @@ -886,8 +886,8 @@ public: void* pKey = NULL; void* pValue = NULL; CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); - rKey = (KeyType)(FX_UINTPTR)pKey; - rValue = (ValueType)(FX_UINTPTR)pValue; + rKey = (KeyType)(uintptr_t)pKey; + rValue = (ValueType)(uintptr_t)pValue; } }; class CFX_CMapDWordToDWord @@ -1428,9 +1428,9 @@ protected: struct DataList { - FX_INT32 start; + int32_t start; - FX_INT32 count; + int32_t count; FX_LPBYTE data; }; public: @@ -1445,7 +1445,7 @@ public: void Clear() { - for (FX_INT32 i = m_DataLists.GetUpperBound(); i >= 0; i--) { + for (int32_t i = m_DataLists.GetUpperBound(); i >= 0; i--) { DataList list = m_DataLists.ElementAt(i); if (list.data) { FX_Free(list.data); @@ -1455,15 +1455,15 @@ public: m_CurList = 0; } - void Append(FX_INT32 nStart, FX_INT32 nCount) + void Append(int32_t nStart, int32_t nCount) { if (nStart < 0) { return; } while (nCount > 0) { - FX_INT32 temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH); + int32_t temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH); DataList list; - list.data = FX_Alloc2D(FX_BYTE, temp_count, unit); + list.data = FX_Alloc2D(uint8_t, temp_count, unit); list.start = nStart; list.count = temp_count; Append(list); @@ -1472,7 +1472,7 @@ public: } } - FX_LPBYTE GetAt(FX_INT32 nIndex) + FX_LPBYTE GetAt(int32_t nIndex) { if (nIndex < 0) { return NULL; @@ -1483,9 +1483,9 @@ public: DataList *pCurList = m_DataLists.GetDataPtr(m_CurList); if (!pCurList || nIndex < pCurList->start || nIndex >= pCurList->start + pCurList->count) { pCurList = NULL; - FX_INT32 iStart = 0; - FX_INT32 iEnd = m_DataLists.GetUpperBound(); - FX_INT32 iMid = 0; + int32_t iStart = 0; + int32_t iEnd = m_DataLists.GetUpperBound(); + int32_t iMid = 0; while (iStart <= iEnd) { iMid = (iStart + iEnd) / 2; DataList* list = m_DataLists.GetDataPtr(iMid); @@ -1505,11 +1505,11 @@ public: protected: void Append(const DataList& list) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = m_DataLists.GetUpperBound(); - FX_INT32 iFind = 0; + int32_t iStart = 0; + int32_t iEnd = m_DataLists.GetUpperBound(); + int32_t iFind = 0; while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; DataList* cur_list = m_DataLists.GetDataPtr(iMid); if (list.start < cur_list->start + cur_list->count) { iEnd = iMid - 1; @@ -1529,7 +1529,7 @@ protected: } m_DataLists.InsertAt(iFind, list); } - FX_INT32 m_CurList; + int32_t m_CurList; CFX_ArrayTemplate<DataList> m_DataLists; }; template<typename T1, typename T2> @@ -1542,19 +1542,19 @@ public: m_Data.Clear(); } - void Add(FX_INT32 nStart, FX_INT32 nCount) + void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } - T2& operator [] (FX_INT32 nIndex) + T2& operator [] (int32_t nIndex) { FX_LPBYTE data = m_Data.GetAt(nIndex); FXSYS_assert(data != NULL); return (T2&)(*(volatile T2*)data); } - T2* GetPtrAt(FX_INT32 nIndex) + T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 076c0e6a2f..c98ece9e07 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -113,15 +113,15 @@ public: } baseType x, y; }; -typedef CFX_PSVTemplate<FX_INT32> CFX_Point; +typedef CFX_PSVTemplate<int32_t> CFX_Point; typedef CFX_PSVTemplate<FX_FLOAT> CFX_PointF; -typedef CFX_PSVTemplate<FX_INT32> CFX_Size; +typedef CFX_PSVTemplate<int32_t> CFX_Size; typedef CFX_PSVTemplate<FX_FLOAT> CFX_SizeF; typedef CFX_ArrayTemplate<CFX_Point> CFX_Points; typedef CFX_ArrayTemplate<CFX_PointF> CFX_PointsF; -typedef CFX_PSVTemplate<FX_INT32> * FX_LPPOINT; +typedef CFX_PSVTemplate<int32_t> * FX_LPPOINT; typedef CFX_PSVTemplate<FX_FLOAT> * FX_LPPOINTF; -typedef CFX_PSVTemplate<FX_INT32> const * FX_LPCPOINT; +typedef CFX_PSVTemplate<int32_t> const * FX_LPCPOINT; typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF; #define CFX_FloatPoint CFX_PointF template<class baseType> @@ -227,7 +227,7 @@ public: return v.y < 0 ? -fSlope : fSlope; } }; -typedef CFX_VTemplate<FX_INT32> CFX_Vector; +typedef CFX_VTemplate<int32_t> CFX_Vector; typedef CFX_VTemplate<FX_FLOAT> CFX_VectorF; template<class baseType> class CFX_RTemplate @@ -524,11 +524,11 @@ public: baseType left, top; baseType width, height; }; -typedef CFX_RTemplate<FX_INT32> CFX_Rect; +typedef CFX_RTemplate<int32_t> CFX_Rect; typedef CFX_RTemplate<FX_FLOAT> CFX_RectF; -typedef CFX_RTemplate<FX_INT32> * FX_LPRECT; +typedef CFX_RTemplate<int32_t> * FX_LPRECT; typedef CFX_RTemplate<FX_FLOAT> * FX_LPRECTF; -typedef CFX_RTemplate<FX_INT32> const * FX_LPCRECT; +typedef CFX_RTemplate<int32_t> const * FX_LPCRECT; typedef CFX_RTemplate<FX_FLOAT> const * FX_LPCRECTF; typedef CFX_ArrayTemplate<CFX_RectF> CFX_RectFArray; struct FX_RECT { @@ -602,13 +602,13 @@ struct FX_RECT { }; struct FX_SMALL_RECT { - FX_SHORT Left; + int16_t Left; - FX_SHORT Top; + int16_t Top; - FX_SHORT Right; + int16_t Right; - FX_SHORT Bottom; + int16_t Bottom; }; class CFX_FloatRect { @@ -807,7 +807,7 @@ public: void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE); - void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended = FALSE) + void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE) { Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended); } @@ -831,17 +831,17 @@ public: FX_FLOAT GetUnitArea() const; FX_FLOAT TransformXDistance(FX_FLOAT dx) const; - FX_INT32 TransformXDistance(FX_INT32 dx) const; + int32_t TransformXDistance(int32_t dx) const; FX_FLOAT TransformYDistance(FX_FLOAT dy) const; - FX_INT32 TransformYDistance(FX_INT32 dy) const; + int32_t TransformYDistance(int32_t dy) const; FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const; - FX_INT32 TransformDistance(FX_INT32 dx, FX_INT32 dy) const; + int32_t TransformDistance(int32_t dx, int32_t dy) const; FX_FLOAT TransformDistance(FX_FLOAT distance) const; void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const; - void TransformPoint(FX_INT32 &x, FX_INT32 &y) const; - void TransformPoints(CFX_PointF *points, FX_INT32 iCount) const; - void TransformPoints(CFX_Point *points, FX_INT32 iCount) const; + void TransformPoint(int32_t &x, int32_t &y) const; + void TransformPoints(CFX_PointF *points, int32_t iCount) const; + void TransformPoints(CFX_Point *points, int32_t iCount) const; void Transform(FX_FLOAT& x, FX_FLOAT& y) const { diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h index 97c47df6f6..b31d7a43f7 100644 --- a/core/include/fxcrt/fx_ext.h +++ b/core/include/fxcrt/fx_ext.h @@ -19,31 +19,31 @@ extern "C" { FX_FLOAT FXSYS_tan(FX_FLOAT a); FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x); -FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); -FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); +FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); +FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count); -FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); -FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); +int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); +int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); -inline FX_BOOL FXSYS_islower(FX_INT32 ch) +inline FX_BOOL FXSYS_islower(int32_t ch) { return ch >= 'a' && ch <= 'z'; } -inline FX_BOOL FXSYS_isupper(FX_INT32 ch) +inline FX_BOOL FXSYS_isupper(int32_t ch) { return ch >= 'A' && ch <= 'Z'; } -inline FX_INT32 FXSYS_tolower(FX_INT32 ch) +inline int32_t FXSYS_tolower(int32_t ch) { return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20); } -inline FX_INT32 FXSYS_toupper(FX_INT32 ch) +inline int32_t FXSYS_toupper(int32_t ch) { return ch < 'a' || ch > 'z' ? ch : (ch - 0x20); } -FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE); -FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE); +FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE); +FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE); #ifdef __cplusplus } @@ -58,11 +58,11 @@ FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext); void FX_Random_MT_Close(FX_LPVOID pContext); -void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount); -void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount); -void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount); #ifdef __cplusplus } #endif @@ -74,7 +74,7 @@ typedef struct FX_GUID { FX_DWORD data1; FX_WORD data2; FX_WORD data3; - FX_BYTE data4[8]; + uint8_t data4[8]; } FX_GUID, * FX_LPGUID; typedef FX_GUID const * FX_LPCGUID; @@ -88,10 +88,10 @@ template<class baseType> class CFX_SSortTemplate { public: - void ShellSort(baseType *pArray, FX_INT32 iCount) + void ShellSort(baseType *pArray, int32_t iCount) { FXSYS_assert(pArray != NULL && iCount > 0); - FX_INT32 i, j, gap; + int32_t i, j, gap; baseType v1, v2; gap = iCount >> 1; while (gap > 0) { diff --git a/core/include/fxcrt/fx_safe_types.h b/core/include/fxcrt/fx_safe_types.h index e45e6d3c8d..ee50a53e34 100644 --- a/core/include/fxcrt/fx_safe_types.h +++ b/core/include/fxcrt/fx_safe_types.h @@ -12,7 +12,7 @@ #include "fx_system.h" typedef pdfium::base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD; -typedef pdfium::base::CheckedNumeric<FX_INT32> FX_SAFE_INT32; +typedef pdfium::base::CheckedNumeric<int32_t> FX_SAFE_INT32; typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T; typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE; diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h index 35c54cb3d2..190ce97cac 100644 --- a/core/include/fxcrt/fx_stream.h +++ b/core/include/fxcrt/fx_stream.h @@ -20,7 +20,7 @@ typedef struct FX_HFILE_ { FX_LPVOID pData; }* FX_HFILE; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -#define FX_FILESIZE FX_INT32 +#define FX_FILESIZE int32_t #else #include <fcntl.h> #include <unistd.h> @@ -37,10 +37,10 @@ typedef struct FX_HFILE_ { #define FX_GETBYTEOFFSET40(a) 0 #define FX_GETBYTEOFFSET48(a) 0 #define FX_GETBYTEOFFSET56(a) 0 -#define FX_GETBYTEOFFSET24(a) ((FX_BYTE)(a>>24)) -#define FX_GETBYTEOFFSET16(a) ((FX_BYTE)(a>>16)) -#define FX_GETBYTEOFFSET8(a) ((FX_BYTE)(a>>8)) -#define FX_GETBYTEOFFSET0(a) ((FX_BYTE)(a)) +#define FX_GETBYTEOFFSET24(a) ((uint8_t)(a>>24)) +#define FX_GETBYTEOFFSET16(a) ((uint8_t)(a>>16)) +#define FX_GETBYTEOFFSET8(a) ((uint8_t)(a>>8)) +#define FX_GETBYTEOFFSET0(a) ((uint8_t)(a)) #define FX_FILEMODE_Write 0 #define FX_FILEMODE_ReadOnly 1 #define FX_FILEMODE_Truncate 2 diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index 9903dad942..8fc9d79ebb 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -121,7 +121,7 @@ public: return m_Length == 0; } - FX_BYTE GetAt(FX_STRSIZE index) const + uint8_t GetAt(FX_STRSIZE index) const { return m_Ptr[index]; } @@ -140,7 +140,7 @@ public: return CFX_ByteStringC(m_Ptr + index, count); } - const FX_BYTE& operator[] (size_t index) const + const uint8_t& operator[] (size_t index) const { return m_Ptr[index]; } @@ -279,12 +279,12 @@ public: const CFX_ByteString& operator += (FX_BSTR bstrc); - FX_BYTE GetAt(FX_STRSIZE nIndex) const + uint8_t GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; } - FX_BYTE operator[](FX_STRSIZE nIndex) const + uint8_t operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; } diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index f0ebcf90b1..80d75908d4 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -68,35 +68,23 @@ extern "C" { #endif typedef void* FX_LPVOID; // Deprecate, use with void*. -typedef void const* FX_LPCVOID; // Deprecate, use with const void*. +typedef const void* FX_LPCVOID; // Deprecate, use with const void*. typedef void* FX_POSITION; // Keep until fxcrt containers gone -typedef signed char FX_INT8; // Deprecate, use int8_t. -typedef unsigned char FX_UINT8; // Deprecate, use uint8_t. -typedef unsigned char FX_BYTE; // Deprecate, use uint8_t. -typedef unsigned char* FX_LPBYTE; // Deprecate, use uint8_t*. -typedef unsigned char const* FX_LPCBYTE; // Deprecate, use const uint8_t*. -typedef short FX_INT16; // Deprecate, use int16_t. -typedef unsigned short FX_UINT16; // Deprecate, use uint16_t. -typedef short FX_SHORT; // Deprecate, use int16_t. +typedef uint8_t* FX_LPBYTE; // Deprecate, use uint8_t*. +typedef const uint8_t* FX_LPCBYTE; // Deprecate, use const uint8_t*. typedef unsigned short FX_WORD; // Keep - "an efficient small type" -typedef unsigned short* FX_LPWORD; // Deprecate, use FX_WORD*. -typedef unsigned short const* FX_LPCWORD; // Deprecate, use const FX_WORD*. -typedef int FX_INT32; // Deprecate, use int32_t. -typedef unsigned int FX_UINT32; // Deprecate, use uint32_t. +typedef FX_WORD* FX_LPWORD; // Deprecate, use FX_WORD*. +typedef const FX_WORD* FX_LPCWORD; // Deprecate, use const FX_WORD*. typedef unsigned int FX_DWORD; // Keep - "an efficient type" -typedef unsigned int* FX_LPDWORD; // Deprecate, use FX_DWORD*. -typedef int64_t FX_INT64; // Deprecate, use int64_t. -typedef uint64_t FX_UINT64; // Deprecate, use uint64_t. -typedef intptr_t FX_INTPTR; // Deprecate, use intptr_t. -typedef uintptr_t FX_UINTPTR; // Deprecate, use uintptr_t. +typedef FX_DWORD* FX_LPDWORD; // Deprecate, use FX_DWORD*. typedef float FX_FLOAT; // Keep, allow upgrade to doubles. typedef int FX_BOOL; // Sadly not always 0 or 1. typedef char FX_CHAR; // Keep, questionable signedness. -typedef char* FX_LPSTR; // Deprecate, use FX_CHAR*. -typedef char const* FX_LPCSTR; // Deprecate, use const FX_CHAR*. +typedef FX_CHAR* FX_LPSTR; // Deprecate, use FX_CHAR*. +typedef const FX_CHAR* FX_LPCSTR; // Deprecate, use const FX_CHAR*. typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. -typedef wchar_t* FX_LPWSTR; // Deprecate, use FX_WCHAR*. -typedef wchar_t const* FX_LPCWSTR; // Deprecate, use const FX_WCHAR*. +typedef FX_WCHAR* FX_LPWSTR; // Deprecate, use FX_WCHAR*. +typedef const FX_WCHAR* FX_LPCWSTR; // Deprecate, use const FX_WCHAR*. // PDFium string sizes are limited to 2^31-1, and the value is signed to // allow -1 as a placeholder for "unknown". @@ -260,19 +248,19 @@ wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b) #define FXSYS_abs abs #define FXDWORD_FROM_LSBFIRST(i) (i) -#define FXDWORD_FROM_MSBFIRST(i) (((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24)) +#define FXDWORD_FROM_MSBFIRST(i) (((uint8_t)(i) << 24) | ((uint8_t)((i) >> 8) << 16) | ((uint8_t)((i) >> 16) << 8) | (uint8_t)((i) >> 24)) #define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0])) #define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3])) -#define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8)) -#define FXSYS_LOBYTE(word) ((FX_BYTE)(word)) +#define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8)) +#define FXSYS_LOBYTE(word) ((uint8_t)(word)) #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) -FX_INT32 FXSYS_atoi(FX_LPCSTR str); -FX_INT32 FXSYS_wtoi(FX_LPCWSTR str); -FX_INT64 FXSYS_atoi64(FX_LPCSTR str); -FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str); -FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix); -FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix); +int32_t FXSYS_atoi(FX_LPCSTR str); +int32_t FXSYS_wtoi(FX_LPCWSTR str); +int64_t FXSYS_atoi64(FX_LPCSTR str); +int64_t FXSYS_wtoi64(FX_LPCWSTR str); +FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix); +FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix); int FXSYS_round(FX_FLOAT f); #define FXSYS_Mul(a, b) ((a) * (b)) #define FXSYS_Div(a, b) ((a) / (b)) diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h index 42ab623afb..466acd45d4 100644 --- a/core/include/fxcrt/fx_ucd.h +++ b/core/include/fxcrt/fx_ucd.h @@ -141,13 +141,13 @@ public: return m_dwCharProps & FX_CHARTYPEBITSMASK;
}
FX_WORD m_wCharCode;
- FX_BYTE m_nBreakType;
- FX_INT8 m_nRotation;
+ uint8_t m_nBreakType;
+ int8_t m_nRotation;
FX_DWORD m_dwCharProps;
FX_DWORD m_dwCharStyles;
- FX_INT32 m_iCharWidth;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVertialScale;
+ int32_t m_iCharWidth;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVertialScale;
};
typedef CFX_ArrayTemplate<CFX_Char> CFX_CharArray;
class CFX_TxtChar : public CFX_Char
@@ -163,10 +163,10 @@ public: {
}
FX_DWORD m_dwStatus;
- FX_INT16 m_iBidiClass;
- FX_INT16 m_iBidiLevel;
- FX_INT16 m_iBidiPos;
- FX_INT16 m_iBidiOrder;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
FX_LPVOID m_pUserData;
};
typedef CFX_ArrayTemplate<CFX_TxtChar> CFX_TxtCharArray;
@@ -186,12 +186,12 @@ public: {
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iFontHeight;
- FX_INT16 m_iBidiClass;
- FX_INT16 m_iBidiLevel;
- FX_INT16 m_iBidiPos;
- FX_INT16 m_iBidiOrder;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
FX_DWORD m_dwLayoutStyles;
FX_DWORD m_dwIdentity;
IFX_Unknown *m_pUserData;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h index 440c329439..30c1c77bbe 100644 --- a/core/include/fxge/fpf.h +++ b/core/include/fxge/fpf.h @@ -31,19 +31,19 @@ public: virtual CFX_ByteString GetFamilyName() = 0; virtual CFX_WideString GetPsName() = 0; virtual FX_DWORD GetFontStyle() const = 0; - virtual FX_BYTE GetCharset() const = 0; + virtual uint8_t GetCharset() const = 0; - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode) = 0; - virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex) = 0; + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode) = 0; + virtual int32_t GetGlyphWidth(int32_t iGlyphIndex) = 0; - virtual FX_INT32 GetAscent() const = 0; - virtual FX_INT32 GetDescent() const = 0; + virtual int32_t GetAscent() const = 0; + virtual int32_t GetDescent() const = 0; - virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox) = 0; + virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; - virtual FX_INT32 GetHeight() const = 0; - virtual FX_INT32 GetItalicAngle() const = 0; + virtual int32_t GetHeight() const = 0; + virtual int32_t GetItalicAngle() const = 0; virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize) = 0; protected: @@ -58,7 +58,7 @@ public: virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0; virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer) = 0; - virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; + virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, uint8_t charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; }; #endif // CORE_INCLUDE_FXGE_FPF_H_ diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h index 74738d0d0f..d798ca3511 100644 --- a/core/include/fxge/fx_dib.h +++ b/core/include/fxge/fx_dib.h @@ -74,10 +74,10 @@ class CFX_DIBitmap; #define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff) #define FX_CCOLOR(val) (255-(val)) #define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k)) -#define FXSYS_GetCValue(cmyk) ((FX_BYTE)((cmyk) >> 24) & 0xff) -#define FXSYS_GetMValue(cmyk) ((FX_BYTE)((cmyk) >> 16) & 0xff) -#define FXSYS_GetYValue(cmyk) ((FX_BYTE)((cmyk) >> 8) & 0xff) -#define FXSYS_GetKValue(cmyk) ((FX_BYTE)(cmyk) & 0xff) +#define FXSYS_GetCValue(cmyk) ((uint8_t)((cmyk) >> 24) & 0xff) +#define FXSYS_GetMValue(cmyk) ((uint8_t)((cmyk) >> 16) & 0xff) +#define FXSYS_GetYValue(cmyk) ((uint8_t)((cmyk) >> 8) & 0xff) +#define FXSYS_GetKValue(cmyk) ((uint8_t)(cmyk) & 0xff) void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k); inline FX_CMYK CmykEncode(int c, int m, int y, int k) { @@ -90,10 +90,10 @@ inline FX_ARGB ArgbEncode(int a, int r, int g, int b) return (a << 24) | (r << 16) | (g << 8) | b; } FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); -#define FXARGB_A(argb) ((FX_BYTE)((argb) >> 24)) -#define FXARGB_R(argb) ((FX_BYTE)((argb) >> 16)) -#define FXARGB_G(argb) ((FX_BYTE)((argb) >> 8)) -#define FXARGB_B(argb) ((FX_BYTE)(argb)) +#define FXARGB_A(argb) ((uint8_t)((argb) >> 24)) +#define FXARGB_R(argb) ((uint8_t)((argb) >> 16)) +#define FXARGB_G(argb) ((uint8_t)((argb) >> 8)) +#define FXARGB_B(argb) ((uint8_t)(argb)) #define FXARGB_MAKE(a,r,g,b) (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #define FXARGB_MUL_ALPHA(argb, alpha) (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb) & 0xffffff)) #define FXRGB2GRAY(r,g,b) (((b) * 11 + (g) * 59 + (r) * 30) / 100) @@ -101,15 +101,15 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); #define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) (((backdrop) * (255-(source_alpha)) + (source)*(source_alpha))/255) #define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest)*(src)/255) #define FXCMYK_GETDIB(p) ((((FX_LPBYTE)(p))[0] << 24 | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | ((FX_LPBYTE)(p))[3])) -#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (FX_BYTE)((cmyk) >> 24), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((cmyk) >> 16), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)((cmyk) >> 8), \ - ((FX_LPBYTE)(p))[3] = (FX_BYTE)(cmyk)) +#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (uint8_t)((cmyk) >> 24), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((cmyk) >> 16), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)((cmyk) >> 8), \ + ((FX_LPBYTE)(p))[3] = (uint8_t)(cmyk)) #define FXARGB_GETDIB(p) ((((FX_LPBYTE)(p))[0]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[3] << 24)) -#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (FX_BYTE)(argb), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)((argb) >> 16), \ - ((FX_LPBYTE)(p))[3] = (FX_BYTE)((argb) >> 24) +#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (uint8_t)(argb), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((argb) >> 8), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)((argb) >> 16), \ + ((FX_LPBYTE)(p))[3] = (uint8_t)((argb) >> 24) #define FXARGB_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \ @@ -118,21 +118,21 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \ *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3) -#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (FX_BYTE)(argb>>24), \ - ((FX_LPBYTE)(p))[0] = (FX_BYTE)((argb) >> 16), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)(argb) +#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (uint8_t)(argb>>24), \ + ((FX_LPBYTE)(p))[0] = (uint8_t)((argb) >> 16), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((argb) >> 8), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)(argb) #define FXARGB_GETRGBORDERDIB(p) (((FX_LPBYTE)(p))[2]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0] << 16) | (((FX_LPBYTE)(p))[3] << 24) #define FXARGB_RGBORDERCOPY(dest, src) *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3), \ *(FX_LPBYTE)(dest) = *((FX_LPBYTE)(src)+2), \ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)) #define FXARGB_TODIB(argb) (argb) -#define FXCMYK_TODIB(cmyk) ((FX_BYTE)((cmyk) >> 24) | ((FX_BYTE)((cmyk) >> 16)) << 8 | ((FX_BYTE)((cmyk) >> 8)) << 16 | ((FX_BYTE)(cmyk) << 24)) -#define FXARGB_TOBGRORDERDIB(argb) ((FX_BYTE)(argb>>16) | ((FX_BYTE)(argb>>8)) << 8 | ((FX_BYTE)(argb)) << 16 | ((FX_BYTE)(argb>>24) << 24)) -#define FXGETFLAG_COLORTYPE(flag) (FX_BYTE)((flag)>>8) -#define FXGETFLAG_ALPHA_FILL(flag) (FX_BYTE)(flag) -#define FXGETFLAG_ALPHA_STROKE(flag) (FX_BYTE)((flag)>>16) +#define FXCMYK_TODIB(cmyk) ((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | ((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24)) +#define FXARGB_TOBGRORDERDIB(argb) ((uint8_t)(argb>>16) | ((uint8_t)(argb>>8)) << 8 | ((uint8_t)(argb)) << 16 | ((uint8_t)(argb>>24) << 24)) +#define FXGETFLAG_COLORTYPE(flag) (uint8_t)((flag)>>8) +#define FXGETFLAG_ALPHA_FILL(flag) (uint8_t)(flag) +#define FXGETFLAG_ALPHA_STROKE(flag) (uint8_t)((flag)>>16) #define FXSETFLAG_COLORTYPE(flag, val) flag = (((val)<<8)|(flag&0xffff00ff)) #define FXSETFLAG_ALPHA_FILL(flag, val) flag = ((val)|(flag&0xffffff00)) #define FXSETFLAG_ALPHA_STROKE(flag, val) flag = (((val)<<16)|(flag&0xff00ffff)) @@ -415,7 +415,7 @@ public: ~CFX_ScanlineCompositor(); - FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette, + FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); @@ -519,11 +519,11 @@ public: ~CFX_ImageStretcher(); - FX_INT32 Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, + int32_t Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); IFX_ScanlineComposer* m_pDest; const CFX_DIBSource* m_pSource; CStretchEngine* m_pStretchEngine; @@ -538,15 +538,15 @@ public: FX_LPBYTE m_pScanline; FX_LPBYTE m_pMaskScanline; FXDIB_Format m_DestFormat; - FX_INT32 m_Status; + int32_t m_Status; - FX_INT32 StartQuickStretch(); + int32_t StartQuickStretch(); - FX_INT32 StartStretch(); + int32_t StartStretch(); - FX_INT32 ContinueQuickStretch(IFX_Pause* pPause); + int32_t ContinueQuickStretch(IFX_Pause* pPause); - FX_INT32 ContinueStretch(IFX_Pause* pPause); + int32_t ContinueStretch(IFX_Pause* pPause); }; class CFX_ImageTransformer { @@ -556,10 +556,10 @@ public: ~CFX_ImageTransformer(); - FX_INT32 Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); + int32_t Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); CFX_AffineMatrix* m_pMatrix; FX_RECT m_StretchClip; int m_ResultLeft, m_ResultTop, m_ResultWidth, m_ResultHeight; @@ -577,13 +577,13 @@ public: ~CFX_ImageRenderer(); - FX_INT32 Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, + int32_t Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, FX_DWORD dib_flags, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); protected: CFX_DIBitmap* m_pDevice; const CFX_ClipRgn* m_pClipRgn; diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h index 60374eff45..a880166c39 100644 --- a/core/include/fxge/fx_ge.h +++ b/core/include/fxge/fx_ge.h @@ -65,7 +65,7 @@ protected: void InitPlatform(); void DestroyPlatform(); private: - FX_BYTE m_GammaValue[256]; + uint8_t m_GammaValue[256]; CFX_FontCache* m_pFontCache; CFX_FontMgr* m_pFontMgr; CCodec_ModuleMgr* m_pCodecModule; @@ -133,8 +133,8 @@ protected: void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask); }; -extern const FX_BYTE g_GammaRamp[256]; -extern const FX_BYTE g_GammaInverse[256]; +extern const uint8_t g_GammaRamp[256]; +extern const uint8_t g_GammaInverse[256]; #define FX_GAMMA(value) (value) #define FX_GAMMA_INVERSE(value) (value) inline FX_ARGB ArgbGamma(FX_ARGB argb) diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h index 90cd03455b..b22d31fa9f 100644 --- a/core/include/fxge/fx_ge_apple.h +++ b/core/include/fxge/fx_ge_apple.h @@ -13,9 +13,9 @@ class CFX_QuartzDevice : public CFX_RenderDevice public: CFX_QuartzDevice(); ~CFX_QuartzDevice(); - FX_BOOL Attach(CGContextRef context, FX_INT32 nDeviceClass = FXDC_DISPLAY); + FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); FX_BOOL Attach(CFX_DIBitmap* pBitmap); - FX_BOOL Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format); + FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format); CGContextRef GetContext(); diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h index c9cb2a35a9..3972090326 100644 --- a/core/include/fxge/fx_ge_win32.h +++ b/core/include/fxge/fx_ge_win32.h @@ -17,7 +17,7 @@ typedef struct WINDIB_Open_Args_ { int flags; - const FX_BYTE* memory_base; + const uint8_t* memory_base; size_t memory_size; diff --git a/core/include/reflow/fpdf_layout.h b/core/include/reflow/fpdf_layout.h index ebd879c764..b1038db329 100644 --- a/core/include/reflow/fpdf_layout.h +++ b/core/include/reflow/fpdf_layout.h @@ -252,7 +252,7 @@ typedef struct _LayoutProviderStyle { m_Language = LP_Lang_Unknow; m_bIgnoreInvisibleText = TRUE; } - FX_INT32 m_Language; + int32_t m_Language; FX_BOOL m_bIgnoreInvisibleText; } LAYOUTPROVIDER_STYLE; class IPDF_LayoutProvider diff --git a/core/include/reflow/reflowengine.h b/core/include/reflow/reflowengine.h index af3c943e97..30c7174053 100644 --- a/core/include/reflow/reflowengine.h +++ b/core/include/reflow/reflowengine.h @@ -22,11 +22,11 @@ public: virtual CFX_PrivateData* GetPrivateDataCtrl() = 0; - virtual void GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix) = 0; + virtual void GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix) = 0; virtual FX_FLOAT GetPageHeight() = 0; virtual FX_FLOAT GetPageWidth() = 0; - virtual void FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str) = 0; - virtual FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y) = 0; + virtual void FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str) = 0; + virtual FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y) = 0; }; typedef struct _RF_ParseStyle { _RF_ParseStyle() diff --git a/core/src/fdrm/crypto/fx_crypt.cpp b/core/src/fdrm/crypto/fx_crypt.cpp index e67e5d7aab..da9fcc5693 100644 --- a/core/src/fdrm/crypto/fx_crypt.cpp +++ b/core/src/fdrm/crypto/fx_crypt.cpp @@ -62,23 +62,23 @@ void CRYPT_ArcFourCryptBlock(FX_LPBYTE pData, FX_DWORD size, FX_LPCBYTE key, FX_ struct md5_context { FX_DWORD total[2]; FX_DWORD state[4]; - FX_BYTE buffer[64]; + uint8_t buffer[64]; }; #define GET_FX_DWORD(n,b,i) \ { \ - (n) = (FX_DWORD) ((FX_BYTE *) b)[(i)] \ - | (((FX_DWORD) ((FX_BYTE *) b)[(i)+1]) << 8) \ - | (((FX_DWORD) ((FX_BYTE *) b)[(i)+2]) << 16) \ - | (((FX_DWORD) ((FX_BYTE *) b)[(i)+3]) << 24); \ + (n) = (FX_DWORD) ((uint8_t *) b)[(i)] \ + | (((FX_DWORD) ((uint8_t *) b)[(i)+1]) << 8) \ + | (((FX_DWORD) ((uint8_t *) b)[(i)+2]) << 16) \ + | (((FX_DWORD) ((uint8_t *) b)[(i)+3]) << 24); \ } #define PUT_FX_DWORD(n,b,i) \ { \ - (((FX_BYTE *) b)[(i)] ) = (FX_BYTE) (((n) ) & 0xFF); \ - (((FX_BYTE *) b)[(i)+1]) = (FX_BYTE) (((n) >> 8) & 0xFF); \ - (((FX_BYTE *) b)[(i)+2]) = (FX_BYTE) (((n) >> 16) & 0xFF); \ - (((FX_BYTE *) b)[(i)+3]) = (FX_BYTE) (((n) >> 24) & 0xFF); \ + (((uint8_t *) b)[(i)] ) = (uint8_t) (((n) ) & 0xFF); \ + (((uint8_t *) b)[(i)+1]) = (uint8_t) (((n) >> 8) & 0xFF); \ + (((uint8_t *) b)[(i)+2]) = (uint8_t) (((n) >> 16) & 0xFF); \ + (((uint8_t *) b)[(i)+3]) = (uint8_t) (((n) >> 24) & 0xFF); \ } -void md5_process( struct md5_context *ctx, const FX_BYTE data[64] ) +void md5_process( struct md5_context *ctx, const uint8_t data[64] ) { FX_DWORD A, B, C, D, X[16]; GET_FX_DWORD( X[0], data, 0 ); @@ -222,17 +222,17 @@ void CRYPT_MD5Update(FX_LPVOID pctx, FX_LPCBYTE input, FX_DWORD length ) FXSYS_memcpy32( (void *) (ctx->buffer + left), (void *) input, length ); } } -const FX_BYTE md5_padding[64] = { +const uint8_t md5_padding[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -void CRYPT_MD5Finish(FX_LPVOID pctx, FX_BYTE digest[16] ) +void CRYPT_MD5Finish(FX_LPVOID pctx, uint8_t digest[16] ) { struct md5_context *ctx = (struct md5_context *)pctx; FX_DWORD last, padn; - FX_BYTE msglen[8]; + uint8_t msglen[8]; PUT_FX_DWORD( ctx->total[0], msglen, 0 ); PUT_FX_DWORD( ctx->total[1], msglen, 4 ); last = ( ctx->total[0] >> 3 ) & 0x3F; @@ -244,7 +244,7 @@ void CRYPT_MD5Finish(FX_LPVOID pctx, FX_BYTE digest[16] ) PUT_FX_DWORD( ctx->state[2], digest, 8 ); PUT_FX_DWORD( ctx->state[3], digest, 12 ); } -void CRYPT_MD5Generate(FX_LPCBYTE input, FX_DWORD length, FX_BYTE digest[16]) +void CRYPT_MD5Generate(FX_LPCBYTE input, FX_DWORD length, uint8_t digest[16]) { md5_context ctx; CRYPT_MD5Start(&ctx); diff --git a/core/src/fdrm/crypto/fx_crypt_sha.cpp b/core/src/fdrm/crypto/fx_crypt_sha.cpp index 4e931b2d03..1a55d11633 100644 --- a/core/src/fdrm/crypto/fx_crypt_sha.cpp +++ b/core/src/fdrm/crypto/fx_crypt_sha.cpp @@ -121,7 +121,7 @@ void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size) s->blkused = len; } } -void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]) +void CRYPT_SHA1Finish(FX_LPVOID context, uint8_t digest[20]) { SHA_State * s = (SHA_State*)context; int i; @@ -154,7 +154,7 @@ void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]) digest[i * 4 + 3] = (s->h[i]) & 0xFF; } } -void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]) +void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[20]) { SHA_State s; CRYPT_SHA1Start(&s); @@ -164,7 +164,7 @@ void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]) typedef struct { FX_DWORD total[2]; FX_DWORD state[8]; - FX_BYTE buffer[64]; + uint8_t buffer[64]; } sha256_context; #define GET_FX_DWORD(n,b,i) \ @@ -176,10 +176,10 @@ sha256_context; } #define PUT_FX_DWORD(n,b,i) \ { \ - (b)[(i) ] = (FX_BYTE) ( (n) >> 24 ); \ - (b)[(i) + 1] = (FX_BYTE) ( (n) >> 16 ); \ - (b)[(i) + 2] = (FX_BYTE) ( (n) >> 8 ); \ - (b)[(i) + 3] = (FX_BYTE) ( (n) ); \ + (b)[(i) ] = (uint8_t) ( (n) >> 24 ); \ + (b)[(i) + 1] = (uint8_t) ( (n) >> 16 ); \ + (b)[(i) + 2] = (uint8_t) ( (n) >> 8 ); \ + (b)[(i) + 3] = (uint8_t) ( (n) ); \ } void CRYPT_SHA256Start( FX_LPVOID context ) { @@ -195,7 +195,7 @@ void CRYPT_SHA256Start( FX_LPVOID context ) ctx->state[6] = 0x1F83D9AB; ctx->state[7] = 0x5BE0CD19; } -static void sha256_process( sha256_context *ctx, const FX_BYTE data[64] ) +static void sha256_process( sha256_context *ctx, const uint8_t data[64] ) { FX_DWORD temp1, temp2, W[64]; FX_DWORD A, B, C, D, E, F, G, H; @@ -347,18 +347,18 @@ void CRYPT_SHA256Update( void* context, FX_LPCBYTE input, FX_DWORD length ) (void *) input, length ); } } -static const FX_BYTE sha256_padding[64] = { +static const uint8_t sha256_padding[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -void CRYPT_SHA256Finish( FX_LPVOID context, FX_BYTE digest[32] ) +void CRYPT_SHA256Finish( FX_LPVOID context, uint8_t digest[32] ) { sha256_context *ctx = (sha256_context *)context; FX_DWORD last, padn; FX_DWORD high, low; - FX_BYTE msglen[8]; + uint8_t msglen[8]; high = ( ctx->total[0] >> 29 ) | ( ctx->total[1] << 3 ); low = ( ctx->total[0] << 3 ); @@ -377,7 +377,7 @@ void CRYPT_SHA256Finish( FX_LPVOID context, FX_BYTE digest[32] ) PUT_FX_DWORD( ctx->state[6], digest, 24 ); PUT_FX_DWORD( ctx->state[7], digest, 28 ); } -void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]) +void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[32]) { sha256_context ctx; CRYPT_SHA256Start(&ctx); @@ -385,14 +385,14 @@ void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]) CRYPT_SHA256Finish(&ctx, digest); } typedef struct { - FX_UINT64 total[2]; - FX_UINT64 state[8]; - FX_BYTE buffer[128]; + uint64_t total[2]; + uint64_t state[8]; + uint8_t buffer[128]; } sha384_context; -FX_UINT64 FX_ato64i(FX_LPCSTR str) +uint64_t FX_ato64i(FX_LPCSTR str) { FXSYS_assert(str != NULL); - FX_UINT64 ret = 0; + uint64_t ret = 0; int len = (int)FXSYS_strlen(str); len = len > 16 ? 16 : len; for (int i = 0; i < len; ++i) { @@ -441,7 +441,7 @@ void CRYPT_SHA384Start(FX_LPVOID context) temp2 = SHA384_S2(a) + SHA384_F0(a,b,c); \ d += temp1; h = temp1 + temp2; \ } -static const FX_BYTE sha384_padding[128] = { +static const uint8_t sha384_padding[128] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -536,31 +536,31 @@ static FX_LPCSTR constants[] = { }; #define GET_FX_64WORD(n,b,i) \ { \ - (n) = ( (FX_UINT64) (b)[(i) ] << 56 ) \ - | ( (FX_UINT64) (b)[(i) + 1] << 48 ) \ - | ( (FX_UINT64) (b)[(i) + 2] << 40 ) \ - | ( (FX_UINT64) (b)[(i) + 3] << 32 ) \ - | ( (FX_UINT64) (b)[(i) + 4] << 24 ) \ - | ( (FX_UINT64) (b)[(i) + 5] << 16 ) \ - | ( (FX_UINT64) (b)[(i) + 6] << 8 ) \ - | ( (FX_UINT64) (b)[(i) + 7] ); \ + (n) = ( (uint64_t) (b)[(i) ] << 56 ) \ + | ( (uint64_t) (b)[(i) + 1] << 48 ) \ + | ( (uint64_t) (b)[(i) + 2] << 40 ) \ + | ( (uint64_t) (b)[(i) + 3] << 32 ) \ + | ( (uint64_t) (b)[(i) + 4] << 24 ) \ + | ( (uint64_t) (b)[(i) + 5] << 16 ) \ + | ( (uint64_t) (b)[(i) + 6] << 8 ) \ + | ( (uint64_t) (b)[(i) + 7] ); \ } #define PUT_FX_64DWORD(n,b,i) \ { \ - (b)[(i) ] = (FX_BYTE) ( (n) >> 56 ); \ - (b)[(i) + 1] = (FX_BYTE) ( (n) >> 48 ); \ - (b)[(i) + 2] = (FX_BYTE) ( (n) >> 40 ); \ - (b)[(i) + 3] = (FX_BYTE) ( (n) >> 32 ); \ - (b)[(i) + 4] = (FX_BYTE) ( (n) >> 24 ); \ - (b)[(i) + 5] = (FX_BYTE) ( (n) >> 16 ); \ - (b)[(i) + 6] = (FX_BYTE) ( (n) >> 8 ); \ - (b)[(i) + 7] = (FX_BYTE) ( (n) ); \ + (b)[(i) ] = (uint8_t) ( (n) >> 56 ); \ + (b)[(i) + 1] = (uint8_t) ( (n) >> 48 ); \ + (b)[(i) + 2] = (uint8_t) ( (n) >> 40 ); \ + (b)[(i) + 3] = (uint8_t) ( (n) >> 32 ); \ + (b)[(i) + 4] = (uint8_t) ( (n) >> 24 ); \ + (b)[(i) + 5] = (uint8_t) ( (n) >> 16 ); \ + (b)[(i) + 6] = (uint8_t) ( (n) >> 8 ); \ + (b)[(i) + 7] = (uint8_t) ( (n) ); \ } -static void sha384_process( sha384_context *ctx, const FX_BYTE data[128] ) +static void sha384_process( sha384_context *ctx, const uint8_t data[128] ) { - FX_UINT64 temp1, temp2; - FX_UINT64 A, B, C, D, E, F, G, H; - FX_UINT64 W[80]; + uint64_t temp1, temp2; + uint64_t A, B, C, D, E, F, G, H; + uint64_t W[80]; GET_FX_64WORD(W[0], data, 0); GET_FX_64WORD(W[1], data, 8); GET_FX_64WORD(W[2], data, 16); @@ -586,7 +586,7 @@ static void sha384_process( sha384_context *ctx, const FX_BYTE data[128] ) G = ctx->state[6]; H = ctx->state[7]; for (int i = 0; i < 10; ++i) { - FX_UINT64 temp[8]; + uint64_t temp[8]; if (i < 2) { temp[0] = W[i * 8]; temp[1] = W[i * 8 + 1]; @@ -655,13 +655,13 @@ void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE input, FX_DWORD length) (void *) input, length ); } } -void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]) +void CRYPT_SHA384Finish(FX_LPVOID context, uint8_t digest[48]) { sha384_context *ctx = (sha384_context *)context; FX_DWORD last, padn; - FX_BYTE msglen[16]; + uint8_t msglen[16]; FXSYS_memset32(msglen, 0, 16); - FX_UINT64 high, low; + uint64_t high, low; high = ( ctx->total[0] >> 29 ) | ( ctx->total[1] << 3 ); low = ( ctx->total[0] << 3 ); @@ -678,7 +678,7 @@ void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]) PUT_FX_64DWORD(ctx->state[4], digest, 32); PUT_FX_64DWORD(ctx->state[5], digest, 40); } -void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]) +void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[64]) { sha384_context context; CRYPT_SHA384Start(&context); @@ -705,13 +705,13 @@ void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size) { CRYPT_SHA384Update(context, data, size); } -void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]) +void CRYPT_SHA512Finish(FX_LPVOID context, uint8_t digest[64]) { sha384_context *ctx = (sha384_context *)context; FX_DWORD last, padn; - FX_BYTE msglen[16]; + uint8_t msglen[16]; FXSYS_memset32(msglen, 0, 16); - FX_UINT64 high, low; + uint64_t high, low; high = ( ctx->total[0] >> 29 ) | ( ctx->total[1] << 3 ); low = ( ctx->total[0] << 3 ); @@ -730,7 +730,7 @@ void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]) PUT_FX_64DWORD(ctx->state[6], digest, 48); PUT_FX_64DWORD(ctx->state[7], digest, 56); } -void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]) +void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[64]) { sha384_context context; CRYPT_SHA512Start(&context); diff --git a/core/src/fpdfapi/fpdf_edit/editint.h b/core/src/fpdfapi/fpdf_edit/editint.h index faa23f929d..38c33439ec 100644 --- a/core/src/fpdfapi/fpdf_edit/editint.h +++ b/core/src/fpdfapi/fpdf_edit/editint.h @@ -14,8 +14,8 @@ public: FX_BOOL Start(); - FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj); - FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); + int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj); + int32_t CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); FX_FILESIZE End(CPDF_Creator* pCreator); @@ -23,7 +23,7 @@ public: CFX_ByteTextBuf m_Buffer; FX_DWORD m_dwObjNum; - FX_INT32 m_index; + int32_t m_index; protected: CFX_DWordArray m_OffsetArray; @@ -36,9 +36,9 @@ public: FX_BOOL Start(); - FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator); + int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator); - FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator); + int32_t CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator); FX_BOOL End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE); FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum); @@ -51,9 +51,9 @@ public: FX_DWORD m_dwTempObjNum; protected: - FX_INT32 EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE); + int32_t EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE); FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); - FX_INT32 m_iSeg; + int32_t m_iSeg; CPDF_ObjectStream m_ObjStream; CFX_ByteTextBuf m_Buffer; }; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index b64151ad06..65b482bf30 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp @@ -142,7 +142,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix) size += pContentArray[i]->GetSize() + 1; } int pos = 0; - FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, size); + FX_LPBYTE pBuf = FX_Alloc(uint8_t, size); for (i = 0; i < iCount; ++i) { FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize()); pos += pContentArray[i]->GetSize() + 1; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 3abbcee046..035baa398f 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -8,13 +8,13 @@ #include "editint.h" #define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024) #define PDF_XREFSTREAM_MAXSIZE 10000 -extern void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_data, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_data, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict); -FX_INT32 PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset) +int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset) { - FX_INT32 len = 0; + int32_t len = 0; if (pObj == NULL) { if (pFile->AppendString(FX_BSTRC(" null")) < 0) { return -1; @@ -171,10 +171,10 @@ FX_INT32 PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive } return 1; } -FX_INT32 PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, FX_BOOL bCompress) +int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, FX_BOOL bCompress) { FX_FILESIZE offset = 0; - FX_INT32 len = 0; + int32_t len = 0; FXSYS_assert(pDocument && pFile); CPDF_Parser *pParser = (CPDF_Parser*)pDocument->GetParser(); if (pParser) { @@ -259,14 +259,14 @@ FX_INT32 PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive } return offset; } -FX_INT32 PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dwObjNum, CFX_FileBufferArchive *pFile) +int32_t PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dwObjNum, CFX_FileBufferArchive *pFile) { if (!pEncryptDict) { return 0; } FXSYS_assert(pFile); FX_FILESIZE offset = 0; - FX_INT32 len = 0; + int32_t len = 0; if (pFile->AppendString(FX_BSTRC("/Encrypt")) < 0) { return -1; } @@ -289,7 +289,7 @@ FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_LPDWORD pBuffe return FALSE; } FX_LPVOID pContext = FX_Random_MT_Start(dwSeed1); - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < 2; i++) { *pBuffer++ = FX_Random_MT_Generate(pContext); } @@ -414,7 +414,7 @@ FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_ return TRUE; } m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size); - m_pData = FX_Alloc(FX_BYTE, m_dwSize); + m_pData = FX_Alloc(uint8_t, m_dwSize); pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize); m_bNewBuf = TRUE; return TRUE; @@ -439,14 +439,14 @@ FX_BOOL CPDF_ObjectStream::Start() m_index = 0; return TRUE; } -FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj) +int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj) { m_ObjNumArray.Add(dwObjNum); m_OffsetArray.Add(m_Buffer.GetLength()); m_Buffer << pObj; return 1; } -FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize) +int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize) { m_ObjNumArray.Add(dwObjNum); m_OffsetArray.Add(m_Buffer.GetLength()); @@ -466,12 +466,12 @@ FX_FILESIZE CPDF_ObjectStream::End(CPDF_Creator* pCreator) m_dwObjNum = ++pCreator->m_dwLastObjNum; } CFX_ByteTextBuf tempBuffer; - FX_INT32 iCount = m_ObjNumArray.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_ObjNumArray.GetSize(); + for (int32_t i = 0; i < iCount; i++) { tempBuffer << m_ObjNumArray.ElementAt(i) << FX_BSTRC(" ") << m_OffsetArray.ElementAt(i) << FX_BSTRC(" "); } FX_FILESIZE &offset = pCreator->m_Offset; - FX_INT32 len = pFile->AppendDWord(m_dwObjNum); + int32_t len = pFile->AppendDWord(m_dwObjNum); if (len < 0) { return -1; } @@ -552,7 +552,7 @@ FX_BOOL CPDF_XRefStream::Start() m_iSeg = 0; return TRUE; } -FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator) +int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator) { if (!pCreator) { return 0; @@ -564,7 +564,7 @@ FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_O } return EndObjectStream(pCreator); } -FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator) +int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator) { if (!pCreator) { return 0; @@ -601,7 +601,7 @@ static void _AppendIndex1(CFX_ByteTextBuf& buffer, FX_FILESIZE offset) buffer.AppendByte(0); buffer.AppendByte(0); } -static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, FX_INT32 index) +static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, int32_t index) { buffer.AppendByte(2); buffer.AppendByte(FX_GETBYTEOFFSET24(objnum)); @@ -611,7 +611,7 @@ static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, FX_INT32 ind buffer.AppendByte(FX_GETBYTEOFFSET8(index)); buffer.AppendByte(FX_GETBYTEOFFSET0(index)); } -FX_INT32 CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF) +int32_t CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF) { FX_FILESIZE objOffset = 0; if (bEOF) { @@ -624,8 +624,8 @@ FX_INT32 CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF) if (!dwObjStmNum) { dwObjStmNum = ++pCreator->m_dwLastObjNum; } - FX_INT32 iSize = m_ObjStream.m_ObjNumArray.GetSize(); - FX_INT32 iSeg = m_IndexArray.GetSize() / 2; + int32_t iSize = m_ObjStream.m_ObjNumArray.GetSize(); + int32_t iSeg = m_IndexArray.GetSize() / 2; if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) { if (m_dwTempObjNum == 0) { _AppendIndex0(m_Buffer); @@ -656,7 +656,7 @@ FX_INT32 CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF) } return 1; } - FX_INT32 &j = m_ObjStream.m_index; + int32_t &j = m_ObjStream.m_index; for (int i = m_iSeg; i < iSeg; i++) { FX_DWORD start = m_IndexArray.ElementAt(i * 2); FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start; @@ -700,7 +700,7 @@ FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF } _AppendIndex1(m_Buffer, offset_tmp); FX_FILESIZE &offset = pCreator->m_Offset; - FX_INT32 len = pFile->AppendDWord(objnum); + int32_t len = pFile->AppendDWord(objnum); if (len < 0) { return FALSE; } @@ -722,8 +722,8 @@ FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF } offset += len; } else { - FX_INT32 iSeg = m_IndexArray.GetSize() / 2; - for (FX_INT32 i = 0; i < iSeg; i++) { + int32_t iSeg = m_IndexArray.GetSize() / 2; + for (int32_t i = 0; i < iSeg; i++) { if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2))) < 0) { return FALSE; } @@ -754,7 +754,7 @@ FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF FX_CHAR offset_buf[20]; FXSYS_memset32(offset_buf, 0, sizeof(offset_buf)); FXSYS_i64toa(m_PrevOffset, offset_buf, 10); - FX_INT32 len = (FX_INT32)FXSYS_strlen(offset_buf); + int32_t len = (int32_t)FXSYS_strlen(offset_buf); if (pFile->AppendBlock(offset_buf, len) < 0) { return -1; } @@ -832,7 +832,7 @@ FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator) } } } else { - FX_INT32 iSeg = m_IndexArray.GetSize() / 2; + int32_t iSeg = m_IndexArray.GetSize() / 2; for (int i = 0; i < iSeg; i++) { FX_DWORD start = m_IndexArray.ElementAt(i * 2); FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start; @@ -845,14 +845,14 @@ FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator) } FX_BOOL CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum) { - FX_INT32 iSize = m_IndexArray.GetSize(); + int32_t iSize = m_IndexArray.GetSize(); if (iSize == 0) { m_IndexArray.Add(objnum); m_IndexArray.Add(1); } else { FXSYS_assert(iSize > 1); FX_DWORD startobjnum = m_IndexArray.ElementAt(iSize - 2); - FX_INT32 iCount = m_IndexArray.ElementAt(iSize - 1); + int32_t iCount = m_IndexArray.ElementAt(iSize - 1); if (objnum == startobjnum + iCount) { m_IndexArray[iSize - 1] = iCount + 1; } else { @@ -906,20 +906,20 @@ static FX_BOOL _IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag) if (!(flag & FPDFCREATE_INCREMENTAL)) { return FALSE; } - FX_INT32 iSize = pXRef->m_IndexArray.GetSize() / 2; - FX_INT32 iCount = 0; - for (FX_INT32 i = 0; i < iSize; i++) { + int32_t iSize = pXRef->m_IndexArray.GetSize() / 2; + int32_t iCount = 0; + for (int32_t i = 0; i < iSize; i++) { iCount += pXRef->m_IndexArray.ElementAt(i * 2 + 1); } return (iCount >= PDF_XREFSTREAM_MAXSIZE); } -FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) +int32_t CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) { if (!m_pXRefStream) { return 1; } FX_DWORD objnum = pObj->GetObjNum(); - if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (FX_INT32)objnum && m_pParser->m_ObjVersion[objnum] > 0) { + if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (int32_t)objnum && m_pParser->m_ObjVersion[objnum] > 0) { return 1; } if (pObj->GetType() == PDFOBJ_NUMBER) { @@ -958,13 +958,13 @@ FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) } return 0; } -FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize) +int32_t CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize) { if (!m_pXRefStream) { return 1; } m_pXRefStream->AddObjectNumberToIndexArray(objnum); - FX_INT32 iRet = m_pXRefStream->CompressIndirectObject(objnum, pBuffer, dwSize, this); + int32_t iRet = m_pXRefStream->CompressIndirectObject(objnum, pBuffer, dwSize, this); if (iRet < 1) { return iRet; } @@ -979,7 +979,7 @@ FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE p } return 0; } -FX_INT32 CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum) +int32_t CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum) { if (!m_pXRefStream) { return 1; @@ -996,7 +996,7 @@ FX_INT32 CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum) } return 0; } -FX_INT32 CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto) +int32_t CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto) { CPDF_FlateEncoder encoder; encoder.Initialize((CPDF_Stream*)pStream, pStream == m_pMetadata ? FALSE : m_bCompress); @@ -1026,9 +1026,9 @@ FX_INT32 CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, m_Offset += len; return 1; } -FX_INT32 CPDF_Creator::WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj) +int32_t CPDF_Creator::WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj) { - FX_INT32 len = m_File.AppendDWord(objnum); + int32_t len = m_File.AppendDWord(objnum); if (len < 0) { return -1; } @@ -1057,17 +1057,17 @@ FX_INT32 CPDF_Creator::WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj } return 0; } -FX_INT32 CPDF_Creator::WriteIndirectObj(const CPDF_Object* pObj) +int32_t CPDF_Creator::WriteIndirectObj(const CPDF_Object* pObj) { - FX_INT32 iRet = WriteIndirectObjectToStream(pObj); + int32_t iRet = WriteIndirectObjectToStream(pObj); if (iRet < 1) { return iRet; } return WriteIndirectObj(pObj->GetObjNum(), pObj); } -FX_INT32 CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt) +int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt) { - FX_INT32 len = 0; + int32_t len = 0; if (pObj == NULL) { if (m_File.AppendString(FX_BSTRC(" null")) < 0) { return -1; @@ -1246,14 +1246,14 @@ FX_INT32 CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, } return 1; } -FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) +int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) { if(m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) { return 0; } m_ObjectOffset[objnum] = m_Offset; FX_LPVOID valuetemp = NULL; - FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, valuetemp); + FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, valuetemp); FX_BOOL bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream; if(m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) { CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum); @@ -1269,7 +1269,7 @@ FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) m_pDocument->ReleaseIndirectObject(objnum); } } else { - FX_BYTE* pBuffer; + uint8_t* pBuffer; FX_DWORD size; m_pParser->GetIndirectBinary(objnum, pBuffer, size); if (pBuffer == NULL) { @@ -1282,7 +1282,7 @@ FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) return -1; } } else { - FX_INT32 len = m_File.AppendDWord(objnum); + int32_t len = m_File.AppendDWord(objnum); if (len < 0) { return -1; } @@ -1312,12 +1312,12 @@ FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) } return 1; } -FX_INT32 CPDF_Creator::WriteOldObjs(IFX_Pause *pPause) +int32_t CPDF_Creator::WriteOldObjs(IFX_Pause *pPause) { FX_DWORD nOldSize = m_pParser->m_CrossRef.GetSize(); - FX_DWORD objnum = (FX_DWORD)(FX_UINTPTR)m_Pos; + FX_DWORD objnum = (FX_DWORD)(uintptr_t)m_Pos; for(; objnum < nOldSize; objnum ++) { - FX_INT32 iRet = WriteOldIndirectObject(objnum); + int32_t iRet = WriteOldIndirectObject(objnum); if (!iRet) { continue; } @@ -1326,20 +1326,20 @@ FX_INT32 CPDF_Creator::WriteOldObjs(IFX_Pause *pPause) } m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]); if (pPause && pPause->NeedToPauseNow()) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)(objnum + 1); + m_Pos = (FX_LPVOID)(uintptr_t)(objnum + 1); return 1; } } return 0; } -FX_INT32 CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause) +int32_t CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause) { - FX_INT32 iCount = m_NewObjNumArray.GetSize(); - FX_INT32 index = (FX_INT32)(FX_UINTPTR)m_Pos; + int32_t iCount = m_NewObjNumArray.GetSize(); + int32_t index = (int32_t)(uintptr_t)m_Pos; while (index < iCount) { FX_DWORD objnum = m_NewObjNumArray.ElementAt(index); CPDF_Object *pObj = NULL; - m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj); + m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, (FX_LPVOID&)pObj); if (NULL == pObj) { ++index; continue; @@ -1351,7 +1351,7 @@ FX_INT32 CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause) m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]); index++; if (pPause && pPause->NeedToPauseNow()) { - m_Pos = (FX_POSITION)(FX_UINTPTR)index; + m_Pos = (FX_POSITION)(uintptr_t)index; return 1; } } @@ -1406,11 +1406,11 @@ void CPDF_Creator::InitNewObjNumOffsets() } AppendNewObjNum(objnum); } - FX_INT32 iCount = m_NewObjNumArray.GetSize(); + int32_t iCount = m_NewObjNumArray.GetSize(); if (iCount == 0) { return; } - FX_INT32 i = 0; + int32_t i = 0; FX_DWORD dwStartObjNum = 0; FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0; while (i < iCount) { @@ -1447,10 +1447,10 @@ void CPDF_Creator::InitNewObjNumOffsets() } void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum) { - FX_INT32 iStart = 0, iFind = 0; - FX_INT32 iEnd = m_NewObjNumArray.GetUpperBound(); + int32_t iStart = 0, iFind = 0; + int32_t iEnd = m_NewObjNumArray.GetUpperBound(); while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FX_DWORD dwMid = m_NewObjNumArray.ElementAt(iMid); if (objbum < dwMid) { iEnd = iMid - 1; @@ -1469,7 +1469,7 @@ void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum) } m_NewObjNumArray.InsertAt(iFind, objbum); } -FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) +int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) { FXSYS_assert(m_iStage > -1 || m_iStage < 20); if (m_iStage == 0) { @@ -1497,13 +1497,13 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) return -1; } m_Offset += 7; - FX_INT32 version = 7; + int32_t version = 7; if (m_FileVersion) { version = m_FileVersion; } else if (m_pParser) { version = m_pParser->GetFileVersion(); } - FX_INT32 len = m_File.AppendDWord(version % 10); + int32_t len = m_File.AppendDWord(version % 10); if (len < 0) { return -1; } @@ -1517,15 +1517,15 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) } else { IFX_FileRead* pSrcFile = m_pParser->GetFileAccess(); m_Offset = pSrcFile->GetSize(); - m_Pos = (FX_LPVOID)(FX_UINTPTR)m_Offset; + m_Pos = (FX_LPVOID)(uintptr_t)m_Offset; m_iStage = 15; } } if (m_iStage == 15) { if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) { IFX_FileRead* pSrcFile = m_pParser->GetFileAccess(); - FX_BYTE buffer[4096]; - FX_DWORD src_size = (FX_DWORD)(FX_UINTPTR)m_Pos; + uint8_t buffer[4096]; + FX_DWORD src_size = (FX_DWORD)(uintptr_t)m_Pos; while (src_size) { FX_DWORD block_size = src_size > 4096 ? 4096 : src_size; if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) { @@ -1536,7 +1536,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) } src_size -= block_size; if (pPause && pPause->NeedToPauseNow()) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)src_size; + m_Pos = (FX_LPVOID)(uintptr_t)src_size; return 1; } } @@ -1564,30 +1564,30 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause) InitNewObjNumOffsets(); return m_iStage; } -FX_INT32 CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause) +int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause) { FXSYS_assert(m_iStage >= 20 || m_iStage < 30); if (m_iStage == 20) { if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 && m_pParser) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)0; + m_Pos = (FX_LPVOID)(uintptr_t)0; m_iStage = 21; } else { m_iStage = 25; } } if (m_iStage == 21) { - FX_INT32 iRet = WriteOldObjs(pPause); + int32_t iRet = WriteOldObjs(pPause); if (iRet) { return iRet; } m_iStage = 25; } if (m_iStage == 25) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)0; + m_Pos = (FX_LPVOID)(uintptr_t)0; m_iStage = 26; } if (m_iStage == 26) { - FX_INT32 iRet = WriteNewObjs((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0, pPause); + int32_t iRet = WriteNewObjs((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0, pPause); if (iRet) { return iRet; } @@ -1613,7 +1613,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause) } return m_iStage; } -FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) +int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) { FXSYS_assert(m_iStage >= 80 || m_iStage < 90); FX_DWORD dwLastObjNum = m_dwLastObjNum; @@ -1630,13 +1630,13 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) if (m_File.AppendString(str) < 0) { return -1; } - m_Pos = (FX_LPVOID)(FX_UINTPTR)1; + m_Pos = (FX_LPVOID)(uintptr_t)1; m_iStage = 81; } else { if (m_File.AppendString(FX_BSTRC("xref\r\n")) < 0) { return -1; } - m_Pos = (FX_LPVOID)(FX_UINTPTR)0; + m_Pos = (FX_LPVOID)(uintptr_t)0; m_iStage = 82; } } else { @@ -1645,7 +1645,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) } if (m_iStage == 81) { CFX_ByteString str; - FX_DWORD i = (FX_DWORD)(FX_UINTPTR)m_Pos, j; + FX_DWORD i = (FX_DWORD)(uintptr_t)m_Pos, j; while (i <= dwLastObjNum) { while (i <= dwLastObjNum && !m_ObjectOffset.GetPtrAt(i)) { i++; @@ -1675,7 +1675,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) break; } if (pPause && pPause->NeedToPauseNow()) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)i; + m_Pos = (FX_LPVOID)(uintptr_t)i; return 1; } } @@ -1683,10 +1683,10 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) } if (m_iStage == 82) { CFX_ByteString str; - FX_INT32 iCount = m_NewObjNumArray.GetSize(); - FX_INT32 i = (FX_INT32)(FX_UINTPTR)m_Pos; + int32_t iCount = m_NewObjNumArray.GetSize(); + int32_t i = (int32_t)(uintptr_t)m_Pos; while (i < iCount) { - FX_INT32 j = i; + int32_t j = i; FX_DWORD objnum = m_NewObjNumArray.ElementAt(i); while (j < iCount) { if (++j == iCount) { @@ -1715,7 +1715,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) } } if (pPause && (i % 100) == 0 && pPause->NeedToPauseNow()) { - m_Pos = (FX_LPVOID)(FX_UINTPTR)i; + m_Pos = (FX_LPVOID)(uintptr_t)i; return 1; } } @@ -1723,7 +1723,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause) } return m_iStage; } -static FX_INT32 _OutPutIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset) +static int32_t _OutPutIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset) { FXSYS_assert(pFile); if (sizeof(offset) > 4) { @@ -1759,7 +1759,7 @@ static FX_INT32 _OutPutIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset) } return 0; } -FX_INT32 CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause) +int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause) { FXSYS_assert(m_iStage >= 90); if ((m_dwFlags & FPDFCREATE_OBJECTSTREAM) == 0) { @@ -1918,7 +1918,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause) } } else { int count = m_NewObjNumArray.GetSize(); - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < count; i++) { FX_DWORD objnum = m_NewObjNumArray.ElementAt(i); if (m_File.AppendDWord(objnum) < 0) { @@ -2035,7 +2035,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault ) m_pIDArray->Add(pID1->Clone()); } else { pBuffer = FX_Alloc(FX_DWORD, 4); - PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer); + PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer); CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD)); m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument); } @@ -2053,7 +2053,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault ) return; } FX_LPDWORD pBuffer = FX_Alloc(FX_DWORD, 4); - PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer); + PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer); CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD)); m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument); FX_Free(pBuffer); @@ -2076,12 +2076,12 @@ void CPDF_Creator::InitID(FX_BOOL bDefault ) } } } -FX_INT32 CPDF_Creator::Continue(IFX_Pause *pPause) +int32_t CPDF_Creator::Continue(IFX_Pause *pPause) { if (m_iStage < 0) { return m_iStage; } - FX_INT32 iRet = 0; + int32_t iRet = 0; while (m_iStage < 100) { if (m_iStage < 20) { iRet = WriteDoc_Stage1(pPause); @@ -2103,7 +2103,7 @@ FX_INT32 CPDF_Creator::Continue(IFX_Pause *pPause) } return m_iStage; } -FX_BOOL CPDF_Creator::SetFileVersion(FX_INT32 fileVersion ) +FX_BOOL CPDF_Creator::SetFileVersion(int32_t fileVersion ) { if (fileVersion < 10 || fileVersion > 17) { return FALSE; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index e75fd079bf..d2d81d5566 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -178,7 +178,7 @@ static const FX_WCHAR g_FX_CP1257Unicodes[128] = { 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9, }; typedef struct { - FX_BYTE m_Charset; + uint8_t m_Charset; const FX_WCHAR* m_pUnicodes; } FX_CharsetUnicodes; const FX_CharsetUnicodes g_FX_CharsetUnicodes[] = { @@ -429,12 +429,12 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B } #endif #if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_) -FX_UINT32 FX_GetLangHashCode( FX_LPCSTR pStr) +uint32_t FX_GetLangHashCode( FX_LPCSTR pStr) { FXSYS_assert( pStr != NULL); - FX_INT32 iLength = FXSYS_strlen(pStr); + int32_t iLength = FXSYS_strlen(pStr); FX_LPCSTR pStrEnd = pStr + iLength; - FX_UINT32 uHashCode = 0; + uint32_t uHashCode = 0; while ( pStr < pStrEnd) { uHashCode = 31 * uHashCode + tolower(*pStr++); } @@ -512,12 +512,12 @@ static const FX_LANG2CS gs_FXLang2CharsetTable[] = { {3923451837, 134}, {3923451838, 136}, }; -static FX_WORD FX_GetCsFromLangCode(FX_UINT32 uCode) +static FX_WORD FX_GetCsFromLangCode(uint32_t uCode) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1; + int32_t iStart = 0; + int32_t iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1; while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid]; if (uCode == charset.uLang) { return charset.uCharset; @@ -529,13 +529,13 @@ static FX_WORD FX_GetCsFromLangCode(FX_UINT32 uCode) }; return 0; } -static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, FX_INT32 iLength) +static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, int32_t iLength) { FXSYS_assert(pLang); if (iLength < 0) { iLength = FXSYS_strlen(pLang); } - FX_UINT32 uHash = FX_GetLangHashCode(pLang); + uint32_t uHash = FX_GetLangHashCode(pLang); return FX_GetCsFromLangCode(uHash); } static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest) @@ -1028,7 +1028,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert) pBBox->AddInteger(bbox.right); pBBox->AddInteger(bbox.top); pFontDesc->SetAt("FontBBox", pBBox); - FX_INT32 nStemV = 0; + int32_t nStemV = 0; if (pFont->m_pSubstFont) { nStemV = pFont->m_pSubstFont->m_Weight / 5; } else { diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp index 9096bf938e..8d105a5bd8 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp @@ -12,7 +12,7 @@ #include "../fpdf_render/render_int.h" CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size) { - FX_INT32 width, height, color_trans, num_comps, bits; + int32_t width, height, color_trans, num_comps, bits; if (!CPDF_ModuleMgr::Get()->GetJpegModule()-> LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) { return NULL; @@ -70,12 +70,12 @@ void CPDF_Image::SetJpegImage(IFX_FileRead *pFile) if (dwEstimateSize > 8192) { dwEstimateSize = 8192; } - FX_LPBYTE pData = FX_Alloc(FX_BYTE, dwEstimateSize); + FX_LPBYTE pData = FX_Alloc(uint8_t, dwEstimateSize); pFile->ReadBlock(pData, 0, dwEstimateSize); CPDF_Dictionary *pDict = InitJPEG(pData, dwEstimateSize); FX_Free(pData); if (!pDict && size > dwEstimateSize) { - pData = FX_Alloc(FX_BYTE, size); + pData = FX_Alloc(uint8_t, size); pFile->ReadBlock(pData, 0, size); pDict = InitJPEG(pData, size); FX_Free(pData); @@ -91,16 +91,16 @@ void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, FX_LPBYTE &buf, FX_STRSIZE &size, FX_BOOL bLossLess) { } -void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam) +void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam) { - FX_INT32 BitmapWidth = pBitmap->GetWidth(); - FX_INT32 BitmapHeight = pBitmap->GetHeight(); + int32_t BitmapWidth = pBitmap->GetWidth(); + int32_t BitmapHeight = pBitmap->GetHeight(); if (BitmapWidth < 1 || BitmapHeight < 1) { return; } FX_LPBYTE src_buf = pBitmap->GetBuffer(); - FX_INT32 src_pitch = pBitmap->GetPitch(); - FX_INT32 bpp = pBitmap->GetBPP(); + int32_t src_pitch = pBitmap->GetPitch(); + int32_t bpp = pBitmap->GetBPP(); FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb); CPDF_Dictionary* pDict = new CPDF_Dictionary; pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject")); @@ -110,8 +110,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F FX_LPBYTE dest_buf = NULL; FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1; if (bpp == 1) { - FX_INT32 reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0; - FX_INT32 set_a = 0, set_r = 0, set_g = 0, set_b = 0; + int32_t reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0; + int32_t set_a = 0, set_r = 0, set_g = 0, set_b = 0; if (!pBitmap->IsAlphaMask()) { ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g, reset_b); ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b); @@ -149,20 +149,20 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F opType = 0; } } else if (bpp == 8) { - FX_INT32 iPalette = pBitmap->GetPaletteSize(); + int32_t iPalette = pBitmap->GetPaletteSize(); if (iPalette > 0) { CPDF_Array* pCS = new CPDF_Array; m_pDocument->AddIndirectObject(pCS); pCS->AddName(FX_BSTRC("Indexed")); pCS->AddName(FX_BSTRC("DeviceRGB")); pCS->AddInteger(iPalette - 1); - FX_LPBYTE pColorTable = FX_Alloc2D(FX_BYTE, iPalette, 3); + FX_LPBYTE pColorTable = FX_Alloc2D(uint8_t, iPalette, 3); FX_LPBYTE ptr = pColorTable; - for (FX_INT32 i = 0; i < iPalette; i ++) { + for (int32_t i = 0; i < iPalette; i ++) { FX_DWORD argb = pBitmap->GetPaletteArgb(i); - ptr[0] = (FX_BYTE)(argb >> 16); - ptr[1] = (FX_BYTE)(argb >> 8); - ptr[2] = (FX_BYTE)argb; + ptr[0] = (uint8_t)(argb >> 16); + ptr[1] = (uint8_t)(argb >> 8); + ptr[2] = (uint8_t)argb; ptr += 3; } CPDF_Stream *pCTS = CPDF_Stream::Create(pColorTable, iPalette * 3, CPDF_Dictionary::Create()); @@ -202,8 +202,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F } } if (pMaskBitmap) { - FX_INT32 maskWidth = pMaskBitmap->GetWidth(); - FX_INT32 maskHeight = pMaskBitmap->GetHeight(); + int32_t maskWidth = pMaskBitmap->GetWidth(); + int32_t maskHeight = pMaskBitmap->GetHeight(); FX_LPBYTE mask_buf = NULL; FX_STRSIZE mask_size; CPDF_Dictionary* pMaskDict = new CPDF_Dictionary; @@ -218,9 +218,9 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) { _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, TRUE); } else { - mask_buf = FX_Alloc2D(FX_BYTE, maskHeight, maskWidth); + mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth); mask_size = maskHeight * maskWidth; // Safe since checked alloc returned. - for (FX_INT32 a = 0; a < maskHeight; a ++) { + for (int32_t a = 0; a < maskHeight; a ++) { FXSYS_memcpy32(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(a), maskWidth); } } @@ -271,15 +271,15 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap(); pNewBitmap->Create(BitmapWidth, BitmapHeight, FXDIB_Argb); FX_LPBYTE dst_buf = pNewBitmap->GetBuffer(); - FX_INT32 src_offset = 0; - for (FX_INT32 row = 0; row < BitmapHeight; row ++) { + int32_t src_offset = 0; + for (int32_t row = 0; row < BitmapHeight; row ++) { src_offset = row * src_pitch; - for (FX_INT32 column = 0; column < BitmapWidth; column ++) { + for (int32_t column = 0; column < BitmapWidth; column ++) { FX_FLOAT alpha = src_buf[src_offset + 3] / 255.0f; - dst_buf[src_offset] = (FX_BYTE)(src_buf[src_offset] * alpha); - dst_buf[src_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha); - dst_buf[src_offset + 2] = (FX_BYTE)(src_buf[src_offset + 2] * alpha); - dst_buf[src_offset + 3] = (FX_BYTE)(src_buf[src_offset + 3]); + dst_buf[src_offset] = (uint8_t)(src_buf[src_offset] * alpha); + dst_buf[src_offset + 1] = (uint8_t)(src_buf[src_offset + 1] * alpha); + dst_buf[src_offset + 2] = (uint8_t)(src_buf[src_offset + 2] * alpha); + dst_buf[src_offset + 3] = (uint8_t)(src_buf[src_offset + 3]); src_offset += 4; } } @@ -297,11 +297,11 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F } } else if (opType == 1) { if (!bStream) { - dest_buf = FX_Alloc2D(FX_BYTE, dest_pitch, BitmapHeight); + dest_buf = FX_Alloc2D(uint8_t, dest_pitch, BitmapHeight); dest_size = dest_pitch * BitmapHeight; // Safe since checked alloc returned. } FX_LPBYTE pDest = dest_buf; - for (FX_INT32 i = 0; i < BitmapHeight; i ++) { + for (int32_t i = 0; i < BitmapHeight; i ++) { if (!bStream) { FXSYS_memcpy32(pDest, src_buf, dest_pitch); pDest += dest_pitch; @@ -312,21 +312,21 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F } } else if (opType == 2) { if (!bStream) { - dest_buf = FX_Alloc2D(FX_BYTE, dest_pitch, BitmapHeight); + dest_buf = FX_Alloc2D(uint8_t, dest_pitch, BitmapHeight); dest_size = dest_pitch * BitmapHeight; // Safe since checked alloc returned. } else { - dest_buf = FX_Alloc(FX_BYTE, dest_pitch); + dest_buf = FX_Alloc(uint8_t, dest_pitch); } FX_LPBYTE pDest = dest_buf; - FX_INT32 src_offset = 0; - FX_INT32 dest_offset = 0; - for (FX_INT32 row = 0; row < BitmapHeight; row ++) { + int32_t src_offset = 0; + int32_t dest_offset = 0; + for (int32_t row = 0; row < BitmapHeight; row ++) { src_offset = row * src_pitch; - for (FX_INT32 column = 0; column < BitmapWidth; column ++) { + for (int32_t column = 0; column < BitmapWidth; column ++) { FX_FLOAT alpha = bUseMatte ? src_buf[src_offset + 3] / 255.0f : 1; - pDest[dest_offset] = (FX_BYTE)(src_buf[src_offset + 2] * alpha); - pDest[dest_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha); - pDest[dest_offset + 2] = (FX_BYTE)(src_buf[src_offset] * alpha); + pDest[dest_offset] = (uint8_t)(src_buf[src_offset + 2] * alpha); + pDest[dest_offset + 1] = (uint8_t)(src_buf[src_offset + 1] * alpha); + pDest[dest_offset + 2] = (uint8_t)(src_buf[src_offset] * alpha); dest_offset += 3; src_offset += bpp == 24 ? 3 : 4; } diff --git a/core/src/fpdfapi/fpdf_font/common.h b/core/src/fpdfapi/fpdf_font/common.h index 923a394662..57461d1908 100644 --- a/core/src/fpdfapi/fpdf_font/common.h +++ b/core/src/fpdfapi/fpdf_font/common.h @@ -11,9 +11,9 @@ typedef signed char TT_int8_t; typedef unsigned char TT_uint8_t; typedef signed short TT_int16_t; typedef unsigned short TT_uint16_t; -typedef FX_INT32 TT_int32_t; +typedef int32_t TT_int32_t; typedef FX_DWORD TT_uint32_t; -typedef FX_INT64 TT_int64_t; -typedef FX_UINT64 TT_uint64_t; +typedef int64_t TT_int64_t; +typedef uint64_t TT_uint64_t; #endif // CORE_SRC_FPDFAPI_FPDF_FONT_COMMON_H_ diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h index 697ccffafd..1e52607d98 100644 --- a/core/src/fpdfapi/fpdf_font/font_int.h +++ b/core/src/fpdfapi/fpdf_font/font_int.h @@ -48,8 +48,8 @@ private: }; struct _CMap_CodeRange { int m_CharSize; - FX_BYTE m_Lower[4]; - FX_BYTE m_Upper[4]; + uint8_t m_Lower[4]; + uint8_t m_Upper[4]; }; class CPDF_CMapParser { @@ -113,7 +113,7 @@ protected: int m_Charset, m_Coding; CodingScheme m_CodingScheme; int m_nCodeRanges; - FX_BYTE* m_pLeadingBytes; + uint8_t* m_pLeadingBytes; FX_WORD* m_pMapping; FX_LPBYTE m_pAddMapping; FX_BOOL m_bLoaded; @@ -128,13 +128,13 @@ public: int m_Coding; CPDF_CMap::CodingScheme m_CodingScheme; FX_DWORD m_LeadingSegCount; - FX_BYTE m_LeadingSegs[4]; + uint8_t m_LeadingSegs[4]; }; typedef struct _FileHeader { - FX_BYTE btTag[4]; - FX_BYTE btVersion; - FX_BYTE btFormat; - FX_BYTE btReserved1[2]; + uint8_t btTag[4]; + uint8_t btVersion; + uint8_t btFormat; + uint8_t btReserved1[2]; FX_DWORD dwStartIndex; FX_DWORD dwEndIndex; FX_DWORD dwDataSize; diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp index 80dd1df803..0058e140d4 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp @@ -412,7 +412,7 @@ CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, FX_BSTR name) pFontGlobals->Set(pDoc, font_id, pFont); return pFont; } -const FX_BYTE ChineseFontNames[][5] = { +const uint8_t ChineseFontNames[][5] = { {0xCB, 0xCE, 0xCC, 0xE5, 0x00}, {0xBF, 0xAC, 0xCC, 0xE5, 0x00}, {0xBA, 0xDA, 0xCC, 0xE5, 0x00}, @@ -816,7 +816,7 @@ FX_BOOL CPDF_Font::IsStandardFont() const } return TRUE; } -extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode); +extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode); CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype) { FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox); @@ -838,7 +838,7 @@ int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph) if (charcode > 0xff) { return -1; } - int index = m_GlyphIndex[(FX_BYTE)charcode]; + int index = m_GlyphIndex[(uint8_t)charcode]; if (index == 0xffff) { return -1; } @@ -892,14 +892,14 @@ int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level) m_CharWidth[charcode] = 0; } } - return (FX_INT16)m_CharWidth[charcode]; + return (int16_t)m_CharWidth[charcode]; } void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level) { if (charcode > 0xff) { charcode = 0; } - if (m_CharBBox[charcode].Left == (FX_SHORT)0xffff) { + if (m_CharBBox[charcode].Left == (int16_t)0xffff) { LoadCharMetrics(charcode); } rect.left = m_CharBBox[charcode].Left; @@ -1073,7 +1073,7 @@ int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode) if (charcode > 0xff) { return -1; } - int index = m_ExtGID[(FX_BYTE)charcode]; + int index = m_ExtGID[(uint8_t)charcode]; if (index == 0xffff) { return -1; } @@ -1130,7 +1130,7 @@ void CPDF_Type1Font::LoadGlyphMap() if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) { FX_BOOL bGotOne = FALSE; for (int charcode = 0; charcode < 256; charcode ++) { - const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; + const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; for (int j = 0; j < 4; j ++) { FX_WORD unicode = prefix[j] * 256 + charcode; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode); @@ -1482,7 +1482,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() } m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); if (bMSSymbol) { - const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; + const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; for (int j = 0; j < 4; j ++) { FX_WORD unicode = prefix[j] * 256 + charcode; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode); @@ -1525,7 +1525,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() return; } if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) { - const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; + const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; FX_BOOL bGotOne = FALSE; for (int charcode = 0; charcode < 256; charcode ++) { for (int j = 0; j < 4; j ++) { @@ -1627,10 +1627,10 @@ FX_BOOL CPDF_Type3Font::_Load() } CPDF_Array* pBBox = m_pFontDict->GetArray(FX_BSTRC("FontBBox")); if (pBBox) { - m_FontBBox.left = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000); - m_FontBBox.bottom = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000); - m_FontBBox.right = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000); - m_FontBBox.top = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000); + m_FontBBox.left = (int32_t)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000); + m_FontBBox.bottom = (int32_t)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000); + m_FontBBox.right = (int32_t)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000); + m_FontBBox.top = (int32_t)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000); } int StartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar")); CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths")); @@ -1671,10 +1671,10 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level) return NULL; } CPDF_Type3Char* pChar = NULL; - if (m_CacheMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (FX_LPVOID&)pChar)) { + if (m_CacheMap.Lookup((FX_LPVOID)(uintptr_t)charcode, (FX_LPVOID&)pChar)) { if (pChar->m_bPageRequired && m_pPageResources) { delete pChar; - m_CacheMap.RemoveKey((FX_LPVOID)(FX_UINTPTR)charcode); + m_CacheMap.RemoveKey((FX_LPVOID)(uintptr_t)charcode); return LoadChar(charcode, level + 1); } return pChar; @@ -1691,7 +1691,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level) pChar->m_pForm = new CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL); pChar->m_pForm->ParseContent(NULL, NULL, pChar, NULL, level + 1); FX_FLOAT scale = m_FontMatrix.GetXUnit(); - pChar->m_Width = (FX_INT32)(pChar->m_Width * scale + 0.5f); + pChar->m_Width = (int32_t)(pChar->m_Width * scale + 0.5f); FX_RECT &rcBBox = pChar->m_BBox; CFX_FloatRect char_rect((FX_FLOAT)rcBBox.left / 1000.0f, (FX_FLOAT)rcBBox.bottom / 1000.0f, (FX_FLOAT)rcBBox.right / 1000.0f, (FX_FLOAT)rcBBox.top / 1000.0f); @@ -1703,7 +1703,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level) rcBBox.right = FXSYS_round(char_rect.right * 1000); rcBBox.top = FXSYS_round(char_rect.top * 1000); rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000); - m_CacheMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pChar); + m_CacheMap.SetAt((FX_LPVOID)(uintptr_t)charcode, pChar); if (pChar->m_pForm->CountObjects() == 0) { delete pChar->m_pForm; pChar->m_pForm = NULL; diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp index c7110d39c9..8e8fccd8a3 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp @@ -475,7 +475,7 @@ const FX_LPCSTR ZapfEncodingNames[224] = { NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL }; -const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode) +const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode) { if (encoding == PDFFONT_ENCODING_PDFDOC) { if (charcode < 24) { @@ -512,15 +512,15 @@ FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) case FXFT_ENCODING_UNICODE: return (FX_WORD)charcode; case FXFT_ENCODING_ADOBE_STANDARD: - return StandardEncoding[(FX_BYTE)charcode]; + return StandardEncoding[(uint8_t)charcode]; case FXFT_ENCODING_ADOBE_EXPERT: - return MacExpertEncoding[(FX_BYTE)charcode]; + return MacExpertEncoding[(uint8_t)charcode]; case FXFT_ENCODING_ADOBE_LATIN_1: - return AdobeWinAnsiEncoding[(FX_BYTE)charcode]; + return AdobeWinAnsiEncoding[(uint8_t)charcode]; case FXFT_ENCODING_APPLE_ROMAN: - return MacRomanEncoding[(FX_BYTE)charcode]; + return MacRomanEncoding[(uint8_t)charcode]; case PDFFONT_ENCODING_PDFDOC: - return PDFDocEncoding[(FX_BYTE)charcode]; + return PDFDocEncoding[(uint8_t)charcode]; } return 0; } diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp index a08660c52f..a6209cb536 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -124,7 +124,7 @@ static FX_DWORD CMap_GetCode(FX_BSTR word) int num = 0; if (word.GetAt(0) == '<') { for (int i = 1; i < word.GetLength(); i ++) { - FX_BYTE digit = word.GetAt(i); + uint8_t digit = word.GetAt(i); if (digit >= '0' && digit <= '9') { digit = digit - '0'; } else if (digit >= 'a' && digit <= 'f') { @@ -161,17 +161,17 @@ static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR return FALSE; } for (i = 0; i < range.m_CharSize; i ++) { - FX_BYTE digit1 = first.GetAt(i * 2 + 1); - FX_BYTE digit2 = first.GetAt(i * 2 + 2); - FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10); + uint8_t digit1 = first.GetAt(i * 2 + 1); + uint8_t digit2 = first.GetAt(i * 2 + 2); + uint8_t byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10); byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10)); range.m_Lower[i] = byte; } FX_DWORD size = second.GetLength(); for (i = 0; i < range.m_CharSize; i ++) { - FX_BYTE digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0; - FX_BYTE digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0; - FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10); + uint8_t digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0; + uint8_t digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0; + uint8_t byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10); byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10)); range.m_Upper[i] = byte; } @@ -254,7 +254,7 @@ void CPDF_CMapParser::ParseWord(FX_BSTR word) if (nSegs > 1) { m_pCMap->m_CodingScheme = CPDF_CMap::MixedFourBytes; m_pCMap->m_nCodeRanges = nSegs; - m_pCMap->m_pLeadingBytes = FX_Alloc2D(FX_BYTE, nSegs, sizeof(_CMap_CodeRange)); + m_pCMap->m_pLeadingBytes = FX_Alloc2D(uint8_t, nSegs, sizeof(_CMap_CodeRange)); FXSYS_memcpy32(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange)); } else if (nSegs == 1) { m_pCMap->m_CodingScheme = (m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte; @@ -376,7 +376,7 @@ FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, FX_LPCSTR pName, FX_BO m_Coding = map.m_Coding; m_CodingScheme = map.m_CodingScheme; if (m_CodingScheme == MixedTwoBytes) { - m_pLeadingBytes = FX_Alloc(FX_BYTE, 256); + m_pLeadingBytes = FX_Alloc(uint8_t, 256); for (FX_DWORD i = 0; i < map.m_LeadingSegCount; i ++) { for (int b = map.m_LeadingSegs[i * 2]; b <= map.m_LeadingSegs[i * 2 + 1]; b ++) { m_pLeadingBytes[b] = 1; @@ -410,7 +410,7 @@ FX_BOOL CPDF_CMap::LoadEmbedded(FX_LPCBYTE pData, FX_DWORD size) parser.ParseWord(word); } if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) { - m_pAddMapping = FX_Alloc(FX_BYTE, parser.m_AddMaps.GetSize() + 4); + m_pAddMapping = FX_Alloc(uint8_t, parser.m_AddMaps.GetSize() + 4); *(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8; FXSYS_memcpy32(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize()); FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword); @@ -500,15 +500,15 @@ FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) con offset += 2; return ((FX_LPBYTE)pString)[offset - 2] * 256 + ((FX_LPBYTE)pString)[offset - 1]; case MixedTwoBytes: { - FX_BYTE byte1 = ((FX_LPBYTE)pString)[offset++]; + uint8_t byte1 = ((FX_LPBYTE)pString)[offset++]; if (!m_pLeadingBytes[byte1]) { return byte1; } - FX_BYTE byte2 = ((FX_LPBYTE)pString)[offset++]; + uint8_t byte2 = ((FX_LPBYTE)pString)[offset++]; return byte1 * 256 + byte2; } case MixedFourBytes: { - FX_BYTE codes[4]; + uint8_t codes[4]; int char_size = 1; codes[0] = ((FX_LPBYTE)pString)[offset++]; _CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes; @@ -589,10 +589,10 @@ int _GetCharSize(FX_DWORD charcode, _CMap_CodeRange* pRanges, int iRangesSize) if (!iRangesSize) { return 1; } - FX_BYTE codes[4]; + uint8_t codes[4]; codes[0] = codes[1] = 0x00; - codes[2] = (FX_BYTE)(charcode >> 8 & 0xFF); - codes[3] = (FX_BYTE)charcode; + codes[2] = (uint8_t)(charcode >> 8 & 0xFF); + codes[3] = (uint8_t)charcode; int offset = 0, size = 4; for (int i = 0; i < 4; ++i) { int iSeg = iRangesSize - 1; @@ -623,11 +623,11 @@ int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const { switch (m_CodingScheme) { case OneByte: - str[0] = (FX_BYTE)charcode; + str[0] = (uint8_t)charcode; return 1; case TwoBytes: - str[0] = (FX_BYTE)(charcode / 256); - str[1] = (FX_BYTE)(charcode % 256); + str[0] = (uint8_t)(charcode / 256); + str[1] = (uint8_t)(charcode % 256); return 2; case MixedTwoBytes: case MixedFourBytes: @@ -638,24 +638,24 @@ int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const iSize = 1; } if (iSize > 1) { - FXSYS_memset32(str, 0, sizeof(FX_BYTE) * iSize); + FXSYS_memset32(str, 0, sizeof(uint8_t) * iSize); } - str[iSize - 1] = (FX_BYTE)charcode; + str[iSize - 1] = (uint8_t)charcode; return iSize; } else if (charcode < 0x10000) { - str[0] = (FX_BYTE)(charcode >> 8); - str[1] = (FX_BYTE)charcode; + str[0] = (uint8_t)(charcode >> 8); + str[1] = (uint8_t)charcode; return 2; } else if (charcode < 0x1000000) { - str[0] = (FX_BYTE)(charcode >> 16); - str[1] = (FX_BYTE)(charcode >> 8); - str[2] = (FX_BYTE)charcode; + str[0] = (uint8_t)(charcode >> 16); + str[1] = (uint8_t)(charcode >> 8); + str[2] = (uint8_t)charcode; return 3; } else { - str[0] = (FX_BYTE)(charcode >> 24); - str[1] = (FX_BYTE)(charcode >> 16); - str[2] = (FX_BYTE)(charcode >> 8); - str[3] = (FX_BYTE)charcode; + str[0] = (uint8_t)(charcode >> 24); + str[1] = (uint8_t)(charcode >> 16); + str[2] = (uint8_t)(charcode >> 8); + str[3] = (uint8_t)charcode; return 4; } } @@ -837,7 +837,7 @@ FX_DWORD CPDF_CIDFont::_CharCodeFromUnicode(FX_WCHAR unicode) const return 0; } #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - FX_BYTE buffer[32]; + uint8_t buffer[32]; int ret = FXSYS_WideCharToMultiByte(g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, (char*)buffer, 4, NULL, NULL); if (ret == 1) { return buffer[0]; @@ -990,7 +990,7 @@ FX_BOOL CPDF_CIDFont::_Load() } return TRUE; } -FX_FLOAT _CIDTransformToFloat(FX_BYTE ch) +FX_FLOAT _CIDTransformToFloat(uint8_t ch) { if (ch < 128) { return ch * 1.0f / 127; @@ -1150,7 +1150,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph) unsigned long length = 0; int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length); if (!error) { - m_Font.m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length); + m_Font.m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length); } } int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, m_Font.m_pGsubData, NULL); @@ -1421,7 +1421,7 @@ FX_BOOL CPDF_CIDFont::LoadGB2312() } const struct _CIDTransform { FX_WORD CID; - FX_BYTE a, b, c, d, e, f; + uint8_t a, b, c, d, e, f; } Japan1_VertCIDs[] = { {97, 129, 0, 0, 127, 55, 0}, diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp index ae67d2f0ef..ab15c47cb3 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp @@ -20,8 +20,8 @@ extern "C" { } }; struct _IntPair { - FX_INT32 key; - FX_INT32 value; + int32_t key; + int32_t value; }; void CFX_GlyphMap::SetAt(int key, int value) { @@ -431,7 +431,7 @@ IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont) unsigned long length = 0; int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length); if (!error) { - pFont->m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length); + pFont->m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length); } if (!pFont->m_pGsubData) { return NULL; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index 5a9f1a8cb8..82f90d17a6 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -113,7 +113,7 @@ CPDF_TextObject::~CPDF_TextObject() } void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const { - pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[index]; + pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[index]; pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0; pInfo->m_OriginY = 0; if (pInfo->m_CharCode == -1) { @@ -150,7 +150,7 @@ int CPDF_TextObject::CountChars() const void CPDF_TextObject::GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const { if (m_nChars == 1) { - charcode = (FX_DWORD)(FX_UINTPTR)m_pCharCodes; + charcode = (FX_DWORD)(uintptr_t)m_pCharCodes; kerning = 0; return; } @@ -254,7 +254,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKernin } } else { int offset = 0; - m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pFont->GetNextChar(pStrs[0], pStrs[0].GetLength(), offset); + m_pCharCodes = (FX_DWORD*)(uintptr_t)pFont->GetNextChar(pStrs[0], pStrs[0].GetLength(), offset); } } void CPDF_TextObject::SetText(const CFX_ByteString& str) @@ -311,7 +311,7 @@ void CPDF_TextObject::SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKerni } } } else { - m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pCharCodes[0]; + m_pCharCodes = (FX_DWORD*)(uintptr_t)pCharCodes[0]; } RecalcPositionData(); } @@ -360,7 +360,7 @@ void CPDF_TextObject::GetCharRect(int index, CFX_FloatRect& rect) const FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000; int count = 0; for (int i = 0; i < m_nChars; i ++) { - FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i]; + FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; if (charcode == (FX_DWORD) - 1) { continue; } @@ -404,7 +404,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextA } FX_FLOAT fontsize = m_TextState.GetFontSize(); for (int i = 0; i < m_nChars; i ++) { - FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i]; + FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; if (charcode == (FX_DWORD) - 1) { curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000; continue; @@ -531,7 +531,7 @@ void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const FX_FLOAT fontsize = m_TextState.GetFontSize(); int index = 0; for (int i = 0; i < m_nChars; i ++) { - FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i]; + FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; if (charcode == (FX_DWORD) - 1) { continue; } @@ -583,7 +583,7 @@ void CPDF_TextObject::SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharP return; } if (nChars == 1) { - m_pCharCodes = (FX_DWORD*)(FX_UINTPTR) * pCharCodes; + m_pCharCodes = (FX_DWORD*)(uintptr_t) * pCharCodes; } else { m_pCharCodes = FX_Alloc(FX_DWORD, nChars); FXSYS_memcpy32(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars); diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp index 8b9ff8ea96..ea61078209 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp @@ -129,7 +129,7 @@ static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels) { if (pDestBuf == pSrcBuf) for (int i = 0; i < pixels; i ++) { - FX_BYTE temp = pDestBuf[2]; + uint8_t temp = pDestBuf[2]; pDestBuf[2] = pDestBuf[0]; pDestBuf[0] = temp; pDestBuf += 3; @@ -168,7 +168,7 @@ void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, i if (!m_dwStdConversion) { AdobeCMYK_to_sRGB1(pSrcBuf[0], pSrcBuf[1], pSrcBuf[2], pSrcBuf[3], pDestBuf[2], pDestBuf[1], pDestBuf[0]); } else { - FX_BYTE k = pSrcBuf[3]; + uint8_t k = pSrcBuf[3]; pDestBuf[2] = 255 - FX_MIN(255, pSrcBuf[0] + k); pDestBuf[1] = 255 - FX_MIN(255, pSrcBuf[1] + k); pDestBuf[0] = 255 - FX_MIN(255, pSrcBuf[2] + k); @@ -178,7 +178,7 @@ void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, i } } } -const FX_BYTE g_sRGBSamples1[] = { +const uint8_t g_sRGBSamples1[] = { 0, 3, 6, 10, 13, 15, 18, 20, 22, 23, 25, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 61, @@ -192,7 +192,7 @@ const FX_BYTE g_sRGBSamples1[] = { 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115, 115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 118, 119, 119, 119, 120, }; -const FX_BYTE g_sRGBSamples2[] = { +const uint8_t g_sRGBSamples2[] = { 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164, @@ -514,9 +514,9 @@ void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int lab[1] = (FX_FLOAT)(pSrcBuf[1] - 128); lab[2] = (FX_FLOAT)(pSrcBuf[2] - 128); GetRGB(lab, R, G, B); - pDestBuf[0] = (FX_INT32)(B * 255); - pDestBuf[1] = (FX_INT32)(G * 255); - pDestBuf[2] = (FX_INT32)(R * 255); + pDestBuf[0] = (int32_t)(B * 255); + pDestBuf[1] = (int32_t)(G * 255); + pDestBuf[2] = (int32_t)(R * 255); pDestBuf += 3; pSrcBuf += 3; } @@ -611,7 +611,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) } else { // No valid alternative colorspace pAlterCS->ReleaseCS(); - FX_INT32 nDictComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0; + int32_t nDictComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0; if (nDictComponents != 1 && nDictComponents != 3 && nDictComponents != 4) { return FALSE; } @@ -715,14 +715,14 @@ void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, pDestBuf, pSrcBuf, pixels); } else { if (m_pCache == NULL) { - ((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc2D(FX_BYTE, nMaxColors, 3); - FX_LPBYTE temp_src = FX_Alloc2D(FX_BYTE, nMaxColors, m_nComponents); + ((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc2D(uint8_t, nMaxColors, 3); + FX_LPBYTE temp_src = FX_Alloc2D(uint8_t, nMaxColors, m_nComponents); FX_LPBYTE pSrc = temp_src; for (int i = 0; i < nMaxColors; i ++) { FX_DWORD color = i; FX_DWORD order = nMaxColors / 52; for (int c = 0; c < m_nComponents; c ++) { - *pSrc++ = (FX_BYTE)(color / order * 5); + *pSrc++ = (uint8_t)(color / order * 5); color %= order; order /= 52; } @@ -826,7 +826,7 @@ FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) } FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const { - int index = (FX_INT32)(*pBuf); + int index = (int32_t)(*pBuf); if (index < 0 || index > m_MaxIndex) { return FALSE; } @@ -1204,7 +1204,7 @@ int CPDF_ColorSpace::GetBufSize() const FX_FLOAT* CPDF_ColorSpace::CreateBuf() { int size = GetBufSize(); - FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size); + uint8_t* pBuf = FX_Alloc(uint8_t, size); return (FX_FLOAT*)pBuf; } FX_BOOL CPDF_ColorSpace::sRGB() const @@ -1270,9 +1270,9 @@ void CPDF_ColorSpace::TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, src[j] = (FX_FLOAT)(*src_buf ++) / 255; } GetRGB(src, R, G, B); - *dest_buf ++ = (FX_INT32)(B * 255); - *dest_buf ++ = (FX_INT32)(G * 255); - *dest_buf ++ = (FX_INT32)(R * 255); + *dest_buf ++ = (int32_t)(B * 255); + *dest_buf ++ = (int32_t)(G * 255); + *dest_buf ++ = (int32_t)(R * 255); } } void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled) @@ -1420,9 +1420,9 @@ FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) { return FALSE; } - R = (FX_INT32)(r * 255 + 0.5f); - G = (FX_INT32)(g * 255 + 0.5f); - B = (FX_INT32)(b * 255 + 0.5f); + R = (int32_t)(r * 255 + 0.5f); + G = (int32_t)(g * 255 + 0.5f); + B = (int32_t)(b * 255 + 0.5f); return TRUE; } CPDF_Pattern* CPDF_Color::GetPattern() const diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 241b5895c5..00ea4c5fce 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -572,7 +572,7 @@ CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream) } CPDF_StreamAcc stream; stream.LoadAllData(pIccProfileStream, FALSE); - FX_BYTE digest[20]; + uint8_t digest[20]; CPDF_Stream* pCopiedStream = NULL; CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest); if (m_HashProfileMap.Lookup(CFX_ByteStringC(digest, 20), (void*&)pCopiedStream)) { @@ -621,7 +621,7 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream) ftData = new CPDF_CountedObject<CPDF_StreamAcc*>; CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc; CPDF_Dictionary* pFontDict = pFontStream->GetDict(); - FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3")); + int32_t org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3")); if (org_size < 0) { org_size = 0; } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp index d29dee77d8..dadf6bf9cb 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp @@ -77,7 +77,7 @@ FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) { int size = m_Operators.GetSize(); for (int i = 0; i < size; i ++) { - PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i]; + PDF_PSOP op = (PDF_PSOP)(uintptr_t)m_Operators[i]; if (op == PSOP_PROC) { i ++; } else if (op == PSOP_CONST) { @@ -492,7 +492,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) if (!pSize && i == 0) { m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size")); } - if (nTotalSamples > 0 && (FX_UINT32)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) { + if (nTotalSamples > 0 && (uint32_t)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) { return FALSE; } nTotalSamples *= m_pEncodeInfo[i].sizes; @@ -512,7 +512,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) return FALSE; } nTotalSamples *= m_nBitsPerSample; - if (nTotalSamples > 0 && ((FX_UINT32)m_nOutputs) > UINT_MAX / nTotalSamples) { + if (nTotalSamples > 0 && ((uint32_t)m_nOutputs) > UINT_MAX / nTotalSamples) { return FALSE; } nTotalSamples *= m_nOutputs; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 2bf3b1d4c3..bb4b9dee23 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -60,7 +60,7 @@ CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src) for (int i = 0; i < m_PathCount; i ++) { m_pPathList[i] = src.m_pPathList[i]; } - m_pTypeList = FX_Alloc(FX_BYTE, alloc_size); + m_pTypeList = FX_Alloc(uint8_t, alloc_size); FXSYS_memcpy32(m_pTypeList, src.m_pTypeList, m_PathCount); } else { m_pPathList = NULL; @@ -88,7 +88,7 @@ void CPDF_ClipPathData::SetCount(int path_count, int text_count) m_PathCount = path_count; int alloc_size = (path_count + 7) / 8 * 8; m_pPathList = new CPDF_Path[alloc_size]; - m_pTypeList = FX_Alloc(FX_BYTE, alloc_size); + m_pTypeList = FX_Alloc(uint8_t, alloc_size); } if (text_count) { m_TextCount = text_count; @@ -155,7 +155,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge) pNewPath[i] = pData->m_pPathList[i]; } delete[] pData->m_pPathList; - FX_BYTE* pNewType = FX_Alloc(FX_BYTE, pData->m_PathCount + 8); + uint8_t* pNewType = FX_Alloc(uint8_t, pData->m_PathCount + 8); FXSYS_memcpy32(pNewType, pData->m_pTypeList, pData->m_PathCount); if (pData->m_pTypeList) { FX_Free(pData->m_pTypeList); @@ -164,7 +164,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge) pData->m_pTypeList = pNewType; } pData->m_pPathList[pData->m_PathCount] = path; - pData->m_pTypeList[pData->m_PathCount] = (FX_BYTE)type; + pData->m_pTypeList[pData->m_PathCount] = (uint8_t)type; pData->m_PathCount ++; } void CPDF_ClipPath::DeletePath(int index) diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index b3e3cd6a2c..a92e9e783d 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -1553,7 +1553,7 @@ CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf) FX_LPCBYTE str = src_buf.GetBuffer(); FX_DWORD size = src_buf.GetSize(); for (FX_DWORD i = 0; i < size; i ++) { - FX_BYTE ch = str[i]; + uint8_t ch = str[i]; if (ch >= '0' && ch <= '9') { if (bFirst) { code = (ch - '0') * 16; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index d8b24593ef..bc2138e19e 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -23,7 +23,7 @@ FX_BOOL _PDF_HasInvalidOpChar(FX_LPCSTR op) if(!op) { return FALSE; } - FX_BYTE ch; + uint8_t ch; while((ch = *op++)) { if(_PDF_OpCharType[ch] == 'I') { return TRUE; @@ -235,7 +235,7 @@ void CPDF_StreamContentParser::ParsePathObject() } } } -CPDF_StreamParser::CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize) +CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize) { m_pBuf = pData; m_Size = dwSize; @@ -262,7 +262,7 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b delete pDecoder; return -1; } - dest_buf = FX_Alloc2D(FX_BYTE, pitch, height); + dest_buf = FX_Alloc2D(uint8_t, pitch, height); dest_size = pitch * height; // Safe since checked alloc returned. for (int row = 0; row < height; row ++) { FX_LPBYTE pLine = pDecoder->GetScanline(row); @@ -277,11 +277,11 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_b } ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, const CPDF_Dictionary* pParams); -FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams, +FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD PDF_DecodeInlineStream(const FX_BYTE* src_buf, FX_DWORD limit, +FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit, int width, int height, CFX_ByteString& decoder, CPDF_Dictionary* pParam, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { @@ -373,7 +373,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti if (OrigSize > m_Size - m_Pos) { OrigSize = m_Size - m_Pos; } - pData = FX_Alloc(FX_BYTE, OrigSize); + pData = FX_Alloc(uint8_t, OrigSize); FXSYS_memcpy32(pData, m_pBuf + m_Pos, OrigSize); dwStreamSize = OrigSize; m_Pos += OrigSize; @@ -421,7 +421,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti dwStreamSize += m_Pos - dwPrevPos; } m_Pos = dwSavePos; - pData = FX_Alloc(FX_BYTE, dwStreamSize); + pData = FX_Alloc(uint8_t, dwStreamSize); FXSYS_memcpy32(pData, m_pBuf + m_Pos, dwStreamSize); m_Pos += dwStreamSize; } @@ -1049,7 +1049,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) } m_Size += size + 1; } - m_pData = FX_Alloc(FX_BYTE, m_Size); + m_pData = FX_Alloc(uint8_t, m_Size); FX_DWORD pos = 0; for (i = 0; i < m_nStreams; i ++) { FXSYS_memcpy32(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize()); diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h index 7c527150b3..1f5428d56f 100644 --- a/core/src/fpdfapi/fpdf_page/pageint.h +++ b/core/src/fpdfapi/fpdf_page/pageint.h @@ -16,7 +16,7 @@ class CPDF_StreamParser { public: - CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize); + CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize); ~CPDF_StreamParser(); CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode); @@ -52,10 +52,10 @@ protected: void GetNextWord(FX_BOOL& bIsNumber); CFX_ByteString ReadString(); CFX_ByteString ReadHexString(); - const FX_BYTE* m_pBuf; + const uint8_t* m_pBuf; FX_DWORD m_Size; FX_DWORD m_Pos; - FX_BYTE m_WordBuffer[256]; + uint8_t m_WordBuffer[256]; FX_DWORD m_WordSize; CPDF_Object* m_pLastObj; }; @@ -153,7 +153,7 @@ public: FX_FLOAT GetNumber16(FX_DWORD index); int GetInteger(FX_DWORD index) { - return (FX_INT32)(GetNumber(index)); + return (int32_t)(GetNumber(index)); } FX_BOOL OnOperator(FX_LPCSTR op); void BigCaseCaller(int index); @@ -338,7 +338,7 @@ KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_Counted } } findData = NULL; - return (KeyType)(FX_UINTPTR)NULL; + return (KeyType)(uintptr_t)NULL; } template <class KeyType, class ValueType> FX_BOOL PDF_DocPageData_Release(CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, KeyType findKey, ValueType findValue, FX_BOOL bForce = FALSE) @@ -422,11 +422,11 @@ class CPDF_IccProfile public: CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize); ~CPDF_IccProfile(); - FX_INT32 GetComponents() const { return m_nSrcComponents; } + int32_t GetComponents() const { return m_nSrcComponents; } FX_BOOL m_bsRGB; FX_LPVOID m_pTransform; private: - FX_INT32 m_nSrcComponents; + int32_t m_nSrcComponents; }; class CPDF_DeviceCS : public CPDF_ColorSpace { diff --git a/core/src/fpdfapi/fpdf_parser/filters_int.h b/core/src/fpdfapi/fpdf_parser/filters_int.h index 1139371fda..6652cc0ccc 100644 --- a/core/src/fpdfapi/fpdf_parser/filters_int.h +++ b/core/src/fpdfapi/fpdf_parser/filters_int.h @@ -26,7 +26,7 @@ public: virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf); virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {} void* m_pContext; - FX_BYTE m_DestBuffer[FPDF_FILTER_BUFFER_SIZE]; + uint8_t m_DestBuffer[FPDF_FILTER_BUFFER_SIZE]; }; class CPDF_LzwFilter : public CFX_DataFilter { @@ -40,11 +40,11 @@ public: FX_DWORD m_nCodes; FX_DWORD m_CodeLen; FX_DWORD m_OldCode; - FX_BYTE m_LastChar; + uint8_t m_LastChar; FX_DWORD m_nLeftBits, m_LeftBits; - FX_BYTE m_DecodeStack[4000]; + uint8_t m_DecodeStack[4000]; FX_DWORD m_StackLen; - void AddCode(FX_DWORD prefix_code, FX_BYTE append_char); + void AddCode(FX_DWORD prefix_code, uint8_t append_char); void DecodeString(FX_DWORD code); }; class CPDF_PredictorFilter : public CFX_DataFilter diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index d18caab217..b1fde0be71 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -9,7 +9,7 @@ #include "../../../include/fxcodec/fx_codec.h" #include <limits.h> #define _STREAM_MAX_SIZE_ 20 * 1024 * 1024 -FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) +FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { dest_size = 0; dest_buf = NULL; @@ -19,7 +19,7 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b FX_DWORD zcount = 0; FX_DWORD pos = 0; while (pos < src_size) { - FX_BYTE ch = src_buf[pos]; + uint8_t ch = src_buf[pos]; if (ch < '!' && ch != '\n' && ch != '\r' && ch != ' ' && ch != '\t') { break; } @@ -39,12 +39,12 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b if (zcount * 4 > UINT_MAX - (pos - zcount)) { return (FX_DWORD) - 1; } - dest_buf = FX_Alloc(FX_BYTE, zcount * 4 + (pos - zcount)); + dest_buf = FX_Alloc(uint8_t, zcount * 4 + (pos - zcount)); int state = 0; - FX_UINT32 res = 0; + uint32_t res = 0; pos = dest_size = 0; while (pos < src_size) { - FX_BYTE ch = src_buf[pos++]; + uint8_t ch = src_buf[pos++]; if (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t') { continue; } @@ -61,7 +61,7 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b state ++; if (state == 5) { for (int i = 0; i < 4; i ++) { - dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8); + dest_buf[dest_size++] = (uint8_t)(res >> (3 - i) * 8); } state = 0; res = 0; @@ -74,7 +74,7 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b res = res * 85 + 84; } for (i = 0; i < state - 1; i ++) { - dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8); + dest_buf[dest_size++] = (uint8_t)(res >> (3 - i) * 8); } } if (pos < src_size && src_buf[pos] == '>') { @@ -82,18 +82,18 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b } return pos; } -FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) +FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { FX_DWORD i; for (i = 0; i < src_size; i ++) if (src_buf[i] == '>') { break; } - dest_buf = FX_Alloc( FX_BYTE, i / 2 + 1); + dest_buf = FX_Alloc( uint8_t, i / 2 + 1); dest_size = 0; FX_BOOL bFirstDigit = TRUE; for (i = 0; i < src_size; i ++) { - FX_BYTE ch = src_buf[i]; + uint8_t ch = src_buf[i]; if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r') { continue; } @@ -122,7 +122,7 @@ FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b } return i; } -FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) +FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { FX_DWORD i = 0; FX_DWORD old; @@ -149,7 +149,7 @@ FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& d if (dest_size >= _STREAM_MAX_SIZE_) { return -1; } - dest_buf = FX_Alloc( FX_BYTE, dest_size); + dest_buf = FX_Alloc( uint8_t, dest_size); i = 0; int dest_count = 0; while (i < src_size) { @@ -245,7 +245,7 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD return CPDF_ModuleMgr::Get()->GetFlateModule()->CreateDecoder(src_buf, src_size, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, Columns); } -FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams, +FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { int predictor = 0; @@ -468,7 +468,7 @@ CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len, CFX_CharMap* pCharMap dest_buf2 += 2; for (int i = 0; i < len; i ++) { *dest_buf2++ = pString[i] >> 8; - *dest_buf2++ = (FX_BYTE)pString[i]; + *dest_buf2++ = (uint8_t)pString[i]; } result.ReleaseBuffer(encLen); return result; @@ -488,7 +488,7 @@ CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex) } result.AppendChar('('); for (int i = 0; i < srclen; i ++) { - FX_BYTE ch = src[i]; + uint8_t ch = src[i]; if (ch == ')' || ch == '\\' || ch == '(') { result.AppendChar('\\'); } else if (ch == 0x0a) { @@ -503,7 +503,7 @@ CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex) result.AppendChar(')'); return result.GetByteString(); } -void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) +void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); if (pEncoders) { @@ -518,7 +518,7 @@ void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Color pEncoders->GetFlateModule()->Encode(src_buf, src_size, predictor, Colors, BitsPerComponent, Columns, dest_buf, dest_size); } } -FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) +FX_DWORD FlateDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); if (pEncoders) { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp index b11c7eeb44..f2643694ec 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp @@ -343,7 +343,7 @@ FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const { { CPDF_Object* pObj; - if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj)) { + if (m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, (FX_LPVOID&)pObj)) { bForm = pObj->GetType() == PDFOBJ_STREAM && ((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Form"); return TRUE; diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp index e35b0a9d10..4ca97fe9e8 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp @@ -7,7 +7,7 @@ #include <time.h> #include "../../../include/fpdfapi/fpdf_parser.h" #include "../../../include/fdrm/fx_crypt.h" -const FX_BYTE defpasscode[32] = { +const uint8_t defpasscode[32] = { 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, @@ -17,11 +17,11 @@ void CalcEncryptKey(CPDF_Dictionary* pEncrypt, FX_LPCBYTE password, FX_DWORD pas FX_LPBYTE key, int keylen, FX_BOOL bIgnoreMeta, CPDF_Array* pIdArray) { int revision = pEncrypt->GetInteger(FX_BSTRC("R")); - FX_BYTE passcode[32]; + uint8_t passcode[32]; for (FX_DWORD i = 0; i < 32; i ++) { passcode[i] = i < pass_size ? password[i] : defpasscode[i - pass_size]; } - FX_BYTE md5[100]; + uint8_t md5[100]; CRYPT_MD5Start(md5); CRYPT_MD5Update(md5, passcode, 32); CFX_ByteString okey = pEncrypt->GetString(FX_BSTRC("O")); @@ -36,7 +36,7 @@ void CalcEncryptKey(CPDF_Dictionary* pEncrypt, FX_LPCBYTE password, FX_DWORD pas FX_DWORD tag = (FX_DWORD) - 1; CRYPT_MD5Update(md5, (FX_LPBYTE)&tag, 4); } - FX_BYTE digest[16]; + uint8_t digest[16]; CRYPT_MD5Finish(md5, digest); FX_DWORD copy_len = keylen; if (copy_len > sizeof(digest)) { @@ -55,8 +55,8 @@ CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() return new CPDF_StandardCryptoHandler; } typedef struct _PDF_CRYPTOITEM { - FX_INT32 m_Cipher; - FX_INT32 m_KeyLen; + int32_t m_Cipher; + int32_t m_KeyLen; FX_BOOL m_bChecked; CPDF_StandardCryptoHandler* m_pCryptoHandler; } PDF_CRYPTOITEM; @@ -85,7 +85,7 @@ FX_BOOL CPDF_StandardSecurityHandler::OnInit(CPDF_Parser* pParser, CPDF_Dictiona } return CheckSecurity(m_KeyLen); } -FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(FX_INT32 key_len) +FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(int32_t key_len) { CFX_ByteString password = m_pParser->GetPassword(); if (CheckPassword(password, password.GetLength(), TRUE, m_EncryptKey, key_len)) { @@ -198,14 +198,14 @@ FX_BOOL CPDF_StandardSecurityHandler::GetCryptInfo(int& cipher, FX_LPCBYTE& buff } #define FX_GET_32WORD(n,b,i) \ { \ - (n) = (FX_DWORD)(( (FX_UINT64) (b)[(i)] << 24 ) \ - | ( (FX_UINT64) (b)[(i) + 1] << 16 ) \ - | ( (FX_UINT64) (b)[(i) + 2] << 8 ) \ - | ( (FX_UINT64) (b)[(i) + 3] )); \ + (n) = (FX_DWORD)(( (uint64_t) (b)[(i)] << 24 ) \ + | ( (uint64_t) (b)[(i) + 1] << 16 ) \ + | ( (uint64_t) (b)[(i) + 2] << 8 ) \ + | ( (uint64_t) (b)[(i) + 3] )); \ } int BigOrder64BitsMod3(FX_LPBYTE data) { - FX_UINT64 ret = 0; + uint64_t ret = 0; for (int i = 0; i < 4; ++i) { FX_DWORD value; FX_GET_32WORD(value, data, 4 * i); @@ -218,14 +218,14 @@ int BigOrder64BitsMod3(FX_LPBYTE data) void Revision6_Hash(FX_LPCBYTE password, FX_DWORD size, FX_LPCBYTE salt, FX_LPCBYTE vector, FX_LPBYTE hash) { int iBlockSize = 32; - FX_BYTE sha[128]; + uint8_t sha[128]; CRYPT_SHA256Start(sha); CRYPT_SHA256Update(sha, password, size); CRYPT_SHA256Update(sha, salt, 8); if (vector) { CRYPT_SHA256Update(sha, vector, 48); } - FX_BYTE digest[32]; + uint8_t digest[32]; CRYPT_SHA256Finish(sha, digest); CFX_ByteTextBuf buf; FX_LPBYTE input = digest; @@ -235,7 +235,7 @@ void Revision6_Hash(FX_LPCBYTE password, FX_DWORD size, FX_LPCBYTE salt, FX_LPCB int iBufLen = buf.GetLength(); CFX_ByteTextBuf interDigest; int i = 0; - FX_LPBYTE aes = FX_Alloc(FX_BYTE, 2048); + FX_LPBYTE aes = FX_Alloc(uint8_t, 2048); while (i < 64 || i < E[iBufLen - 1] + 32) { int iRoundSize = size + iBlockSize; if (vector) { @@ -300,8 +300,8 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(FX_LPCBYTE password, return FALSE; } FX_LPCBYTE pkey = bOwner ? (FX_LPCBYTE)okey : (FX_LPCBYTE)ukey; - FX_BYTE sha[128]; - FX_BYTE digest[32]; + uint8_t sha[128]; + uint8_t digest[32]; if (m_Revision >= 6) { Revision6_Hash(password, size, (FX_LPCBYTE)pkey + 32, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest); } else { @@ -334,9 +334,9 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(FX_LPCBYTE password, if (ekey.GetLength() < 32) { return FALSE; } - FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048); + uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, digest, 32, FALSE); - FX_BYTE iv[16]; + uint8_t iv[16]; FXSYS_memset32(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESDecrypt(aes, key, ekey, 32); @@ -346,14 +346,14 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(FX_LPCBYTE password, if (perms.IsEmpty()) { return FALSE; } - FX_BYTE perms_buf[16]; + uint8_t perms_buf[16]; FXSYS_memset32(perms_buf, 0, sizeof(perms_buf)); FX_DWORD copy_len = sizeof(perms_buf); if (copy_len > (FX_DWORD)perms.GetLength()) { copy_len = perms.GetLength(); } FXSYS_memcpy32(perms_buf, (FX_LPCBYTE)perms, copy_len); - FX_BYTE buf[16]; + uint8_t buf[16]; CRYPT_AESDecrypt(aes, buf, perms_buf, 16); FX_Free(aes); if (buf[9] != 'a' || buf[10] != 'd' || buf[11] != 'b') { @@ -371,12 +371,12 @@ int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD pa { return CheckPassword(password, pass_size, bOwner, key, m_KeyLen); } -int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key, FX_INT32 key_len) +int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key, int32_t key_len) { if (m_Revision >= 5) { return AES256_CheckPassword(password, size, bOwner, key); } - FX_BYTE keybuf[32]; + uint8_t keybuf[32]; if (key == NULL) { key = keybuf; } @@ -386,7 +386,7 @@ int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD si return CheckUserPassword(password, size, FALSE, key, key_len) || CheckUserPassword(password, size, TRUE, key, key_len); } FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size, - FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len) + FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, int32_t key_len) { CalcEncryptKey(m_pEncryptDict, password, pass_size, key, key_len, bIgnoreEncryptMeta, m_pParser->GetIDArray()); @@ -394,12 +394,12 @@ FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(FX_LPCBYTE password, FX_ if (ukey.GetLength() < 16) { return FALSE; } - FX_BYTE ukeybuf[32]; + uint8_t ukeybuf[32]; if (m_Revision == 2) { FXSYS_memcpy32(ukeybuf, defpasscode, 32); CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len); } else { - FX_BYTE test[32], tmpkey[32]; + uint8_t test[32], tmpkey[32]; FX_DWORD copy_len = sizeof(test); if (copy_len > (FX_DWORD)ukey.GetLength()) { copy_len = ukey.GetLength(); @@ -413,7 +413,7 @@ FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(FX_LPCBYTE password, FX_ } CRYPT_ArcFourCryptBlock(test, 32, tmpkey, key_len); } - FX_BYTE md5[100]; + uint8_t md5[100]; CRYPT_MD5Start(md5); CRYPT_MD5Update(md5, defpasscode, 32); CPDF_Array* pIdArray = m_pParser->GetIDArray(); @@ -433,22 +433,22 @@ CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pa { return GetUserPassword(owner_pass, pass_size, m_KeyLen); } -CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len) +CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, int32_t key_len) { CFX_ByteString okey = m_pEncryptDict->GetString(FX_BSTRC("O")); - FX_BYTE passcode[32]; + uint8_t passcode[32]; FX_DWORD i; for (i = 0; i < 32; i ++) { passcode[i] = i < pass_size ? owner_pass[i] : defpasscode[i - pass_size]; } - FX_BYTE digest[16]; + uint8_t digest[16]; CRYPT_MD5Generate(passcode, 32, digest); if (m_Revision >= 3) { for (int i = 0; i < 50; i ++) { CRYPT_MD5Generate(digest, 16, digest); } } - FX_BYTE enckey[32]; + uint8_t enckey[32]; FXSYS_memset32(enckey, 0, sizeof(enckey)); FX_DWORD copy_len = key_len; if (copy_len > sizeof(digest)) { @@ -459,14 +459,14 @@ CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pa if (okeylen > 32) { okeylen = 32; } - FX_BYTE okeybuf[64]; + uint8_t okeybuf[64]; FXSYS_memset32(okeybuf, 0, sizeof(okeybuf)); FXSYS_memcpy32(okeybuf, okey.c_str(), okeylen); if (m_Revision == 2) { CRYPT_ArcFourCryptBlock(okeybuf, okeylen, enckey, key_len); } else { for (int i = 19; i >= 0; i --) { - FX_BYTE tempkey[32]; + uint8_t tempkey[32]; FXSYS_memset32(tempkey, 0, sizeof(tempkey)); for (int j = 0; j < m_KeyLen; j ++) { tempkey[j] = enckey[j] ^ i; @@ -481,7 +481,7 @@ CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pa return CFX_ByteString(okeybuf, len); } FX_BOOL CPDF_StandardSecurityHandler::CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, - FX_LPBYTE key, FX_INT32 key_len) + FX_LPBYTE key, int32_t key_len) { CFX_ByteString user_pass = GetUserPassword(password, pass_size, key_len); if (CheckUserPassword(user_pass, user_pass.GetLength(), FALSE, key, key_len)) { @@ -511,11 +511,11 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ } if (m_Revision >= 5) { int t = (int)time(NULL); - FX_BYTE sha[128]; + uint8_t sha[128]; CRYPT_SHA256Start(sha); - CRYPT_SHA256Update(sha, (FX_BYTE*)&t, sizeof t); + CRYPT_SHA256Update(sha, (uint8_t*)&t, sizeof t); CRYPT_SHA256Update(sha, m_EncryptKey, 32); - CRYPT_SHA256Update(sha, (FX_BYTE*)"there", 5); + CRYPT_SHA256Update(sha, (uint8_t*)"there", 5); CRYPT_SHA256Finish(sha, m_EncryptKey); AES256_SetPassword(pEncryptDict, user_pass, user_size, FALSE, m_EncryptKey); if (bDefault) { @@ -525,29 +525,29 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ return; } if (bDefault) { - FX_BYTE passcode[32]; + uint8_t passcode[32]; FX_DWORD i; for (i = 0; i < 32; i ++) { passcode[i] = i < owner_size ? owner_pass[i] : defpasscode[i - owner_size]; } - FX_BYTE digest[16]; + uint8_t digest[16]; CRYPT_MD5Generate(passcode, 32, digest); if (m_Revision >= 3) { for (int i = 0; i < 50; i ++) { CRYPT_MD5Generate(digest, 16, digest); } } - FX_BYTE enckey[32]; + uint8_t enckey[32]; FXSYS_memcpy32(enckey, digest, key_len); for (i = 0; i < 32; i ++) { passcode[i] = i < user_size ? user_pass[i] : defpasscode[i - user_size]; } CRYPT_ArcFourCryptBlock(passcode, 32, enckey, key_len); - FX_BYTE tempkey[32]; + uint8_t tempkey[32]; if (m_Revision >= 3) { for (i = 1; i <= 19; i ++) { for (int j = 0; j < key_len; j ++) { - tempkey[j] = enckey[j] ^ (FX_BYTE)i; + tempkey[j] = enckey[j] ^ (uint8_t)i; } CRYPT_ArcFourCryptBlock(passcode, 32, tempkey, key_len); } @@ -556,25 +556,25 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ } CalcEncryptKey(m_pEncryptDict, (FX_LPBYTE)user_pass, user_size, m_EncryptKey, key_len, FALSE, pIdArray); if (m_Revision < 3) { - FX_BYTE tempbuf[32]; + uint8_t tempbuf[32]; FXSYS_memcpy32(tempbuf, defpasscode, 32); CRYPT_ArcFourCryptBlock(tempbuf, 32, m_EncryptKey, key_len); pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(tempbuf, 32)); } else { - FX_BYTE md5[100]; + uint8_t md5[100]; CRYPT_MD5Start(md5); CRYPT_MD5Update(md5, defpasscode, 32); if (pIdArray) { CFX_ByteString id = pIdArray->GetString(0); CRYPT_MD5Update(md5, (FX_LPBYTE)id.c_str(), id.GetLength()); } - FX_BYTE digest[32]; + uint8_t digest[32]; CRYPT_MD5Finish(md5, digest); CRYPT_ArcFourCryptBlock(digest, 16, m_EncryptKey, key_len); - FX_BYTE tempkey[32]; + uint8_t tempkey[32]; for (int i = 1; i <= 19; i ++) { for (int j = 0; j < key_len; j ++) { - tempkey[j] = m_EncryptKey[j] ^ (FX_BYTE)i; + tempkey[j] = m_EncryptKey[j] ^ (uint8_t)i; } CRYPT_ArcFourCryptBlock(digest, 16, tempkey, key_len); } @@ -594,14 +594,14 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_ } void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key) { - FX_BYTE sha[128]; + uint8_t sha[128]; CRYPT_SHA1Start(sha); CRYPT_SHA1Update(sha, key, 32); - CRYPT_SHA1Update(sha, (FX_BYTE*)"hello", 5); - FX_BYTE digest[20]; + CRYPT_SHA1Update(sha, (uint8_t*)"hello", 5); + uint8_t digest[20]; CRYPT_SHA1Finish(sha, digest); CFX_ByteString ukey = pEncryptDict->GetString(FX_BSTRC("U")); - FX_BYTE digest1[48]; + uint8_t digest1[48]; if (m_Revision >= 6) { Revision6_Hash(password, size, digest, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest1); } else { @@ -626,9 +626,9 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD } CRYPT_SHA256Finish(sha, digest1); } - FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048); + uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, digest1, 32, TRUE); - FX_BYTE iv[16]; + uint8_t iv[16]; FXSYS_memset32(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESEncrypt(aes, digest1, key, 32); @@ -638,11 +638,11 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permissions, FX_BOOL bEncryptMetadata, FX_LPCBYTE key) { - FX_BYTE buf[16]; - buf[0] = (FX_BYTE)permissions; - buf[1] = (FX_BYTE)(permissions >> 8); - buf[2] = (FX_BYTE)(permissions >> 16); - buf[3] = (FX_BYTE)(permissions >> 24); + uint8_t buf[16]; + buf[0] = (uint8_t)permissions; + buf[1] = (uint8_t)(permissions >> 8); + buf[2] = (uint8_t)(permissions >> 16); + buf[3] = (uint8_t)(permissions >> 24); buf[4] = 0xff; buf[5] = 0xff; buf[6] = 0xff; @@ -651,9 +651,9 @@ void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict buf[9] = 'a'; buf[10] = 'd'; buf[11] = 'b'; - FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048); + uint8_t* aes = FX_Alloc(uint8_t, 2048); CRYPT_AESSetKey(aes, 16, key, 32, TRUE); - FX_BYTE iv[16], buf1[16]; + uint8_t iv[16], buf1[16]; FXSYS_memset32(iv, 0, 16); CRYPT_AESSetIV(aes, iv); CRYPT_AESEncrypt(aes, buf1, buf, 16); @@ -667,16 +667,16 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F FXSYS_memcpy32(dest_buf, src_buf, src_size); return; } - FX_BYTE realkey[16]; + uint8_t realkey[16]; int realkeylen = 16; if (m_Cipher != FXCIPHER_AES || m_KeyLen != 32) { - FX_BYTE key1[32]; + uint8_t key1[32]; FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen); - key1[m_KeyLen + 0] = (FX_BYTE)objnum; - key1[m_KeyLen + 1] = (FX_BYTE)(objnum >> 8); - key1[m_KeyLen + 2] = (FX_BYTE)(objnum >> 16); - key1[m_KeyLen + 3] = (FX_BYTE)gennum; - key1[m_KeyLen + 4] = (FX_BYTE)(gennum >> 8); + key1[m_KeyLen + 0] = (uint8_t)objnum; + key1[m_KeyLen + 1] = (uint8_t)(objnum >> 8); + key1[m_KeyLen + 2] = (uint8_t)(objnum >> 16); + key1[m_KeyLen + 3] = (uint8_t)gennum; + key1[m_KeyLen + 4] = (uint8_t)(gennum >> 8); FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3); FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2); if (m_Cipher == FXCIPHER_AES) { @@ -691,15 +691,15 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F if (m_Cipher == FXCIPHER_AES) { CRYPT_AESSetKey(m_pAESContext, 16, m_KeyLen == 32 ? m_EncryptKey : realkey, m_KeyLen, bEncrypt); if (bEncrypt) { - FX_BYTE iv[16]; + uint8_t iv[16]; for (int i = 0; i < 16; i ++) { - iv[i] = (FX_BYTE)rand(); + iv[i] = (uint8_t)rand(); } CRYPT_AESSetIV(m_pAESContext, iv); FXSYS_memcpy32(dest_buf, iv, 16); int nblocks = src_size / 16; CRYPT_AESEncrypt(m_pAESContext, dest_buf + 16, src_buf, nblocks * 16); - FX_BYTE padding[16]; + uint8_t padding[16]; FXSYS_memcpy32(padding, src_buf + nblocks * 16, src_size % 16); FXSYS_memset8(padding + src_size % 16, 16 - src_size % 16, 16 - src_size % 16); CRYPT_AESEncrypt(m_pAESContext, dest_buf + nblocks * 16 + 16, padding, 16); @@ -719,9 +719,9 @@ void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, F } } typedef struct _AESCryptContext { - FX_BYTE m_Context[2048]; + uint8_t m_Context[2048]; FX_BOOL m_bIV; - FX_BYTE m_Block[16]; + uint8_t m_Block[16]; FX_DWORD m_BlockOffset; } AESCryptContext; FX_LPVOID CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt) @@ -736,20 +736,20 @@ FX_LPVOID CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennu CRYPT_AESSetKey(pContext->m_Context, 16, m_EncryptKey, 32, bEncrypt); if (bEncrypt) { for (int i = 0; i < 16; i ++) { - pContext->m_Block[i] = (FX_BYTE)rand(); + pContext->m_Block[i] = (uint8_t)rand(); } CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block); } return pContext; } - FX_BYTE key1[48]; + uint8_t key1[48]; FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen); FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3); FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2); if (m_Cipher == FXCIPHER_AES) { FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4); } - FX_BYTE realkey[16]; + uint8_t realkey[16]; CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey); int realkeylen = m_KeyLen + 5; if (realkeylen > 16) { @@ -762,13 +762,13 @@ FX_LPVOID CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennu CRYPT_AESSetKey(pContext->m_Context, 16, realkey, 16, bEncrypt); if (bEncrypt) { for (int i = 0; i < 16; i ++) { - pContext->m_Block[i] = (FX_BYTE)rand(); + pContext->m_Block[i] = (uint8_t)rand(); } CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block); } return pContext; } - void* pContext = FX_Alloc(FX_BYTE, 1040); + void* pContext = FX_Alloc(uint8_t, 1040); CRYPT_ArcFourSetup(pContext, realkey, realkeylen); return pContext; } @@ -809,7 +809,7 @@ FX_BOOL CPDF_StandardCryptoHandler::CryptStream(FX_LPVOID context, FX_LPCBYTE sr pContext->m_bIV = FALSE; pContext->m_BlockOffset = 0; } else if (src_off < src_size) { - FX_BYTE block_buf[16]; + uint8_t block_buf[16]; if (bEncrypt) { CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16); } else { @@ -839,17 +839,17 @@ FX_BOOL CPDF_StandardCryptoHandler::CryptFinish(FX_LPVOID context, CFX_BinaryBuf } AESCryptContext* pContext = (AESCryptContext*)context; if (bEncrypt) { - FX_BYTE block_buf[16]; + uint8_t block_buf[16]; if (pContext->m_BlockOffset == 16) { CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16); dest_buf.AppendBlock(block_buf, 16); pContext->m_BlockOffset = 0; } - FXSYS_memset8(pContext->m_Block + pContext->m_BlockOffset, (FX_BYTE)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset); + FXSYS_memset8(pContext->m_Block + pContext->m_BlockOffset, (uint8_t)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset); CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16); dest_buf.AppendBlock(block_buf, 16); } else if (pContext->m_BlockOffset == 16) { - FX_BYTE block_buf[16]; + uint8_t block_buf[16]; CRYPT_AESDecrypt(pContext->m_Context, block_buf, pContext->m_Block, 16); if (block_buf[15] <= 16) { dest_buf.AppendBlock(block_buf, 16 - block_buf[15]); @@ -879,7 +879,7 @@ FX_BOOL CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_Sec FXSYS_memcpy32(m_EncryptKey, key, m_KeyLen); } if (m_Cipher == FXCIPHER_AES) { - m_pAESContext = FX_Alloc(FX_BYTE, 2048); + m_pAESContext = FX_Alloc(uint8_t, 2048); } return TRUE; } @@ -911,7 +911,7 @@ FX_BOOL CPDF_StandardCryptoHandler::Init(int cipher, FX_LPCBYTE key, int keylen) m_KeyLen = keylen; FXSYS_memcpy32(m_EncryptKey, key, keylen); if (m_Cipher == FXCIPHER_AES) { - m_pAESContext = FX_Alloc(FX_BYTE, 2048); + m_pAESContext = FX_Alloc(uint8_t, 2048); } return TRUE; } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp index 6fa7419a41..8cb0cee82a 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp @@ -296,7 +296,7 @@ void CPDF_DecryptFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf) extern "C" { static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size) { - return FX_Alloc2D(FX_BYTE, items, size); + return FX_Alloc2D(uint8_t, items, size); } static void my_free_func (void* opaque, void* address) { @@ -361,8 +361,8 @@ void CPDF_LzwFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_Binar m_nLeftBits = 8 - new_bits; m_LeftBits = src_buf[i] % (1 << m_nLeftBits); if (code < 256) { - dest_buf.AppendByte((FX_BYTE)code); - m_LastChar = (FX_BYTE)code; + dest_buf.AppendByte((uint8_t)code); + m_LastChar = (uint8_t)code; if (m_OldCode != -1) { AddCode(m_OldCode, m_LastChar); } @@ -406,7 +406,7 @@ void CPDF_LzwFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_Binar } } } -void CPDF_LzwFilter::AddCode(FX_DWORD prefix_code, FX_BYTE append_char) +void CPDF_LzwFilter::AddCode(FX_DWORD prefix_code, uint8_t append_char) { if (m_nCodes + m_bEarlyChange == 4094) { return; @@ -431,13 +431,13 @@ void CPDF_LzwFilter::DecodeString(FX_DWORD code) if (m_StackLen >= sizeof(m_DecodeStack)) { return; } - m_DecodeStack[m_StackLen++] = (FX_BYTE)data; + m_DecodeStack[m_StackLen++] = (uint8_t)data; code = data >> 16; } if (m_StackLen >= sizeof(m_DecodeStack)) { return; } - m_DecodeStack[m_StackLen++] = (FX_BYTE)code; + m_DecodeStack[m_StackLen++] = (uint8_t)code; } CPDF_PredictorFilter::CPDF_PredictorFilter(int predictor, int colors, int bpc, int cols) { @@ -461,23 +461,23 @@ CPDF_PredictorFilter::~CPDF_PredictorFilter() FX_Free(m_pRefLine); } } -static FX_BYTE PaethPredictor(int a, int b, int c) +static uint8_t PaethPredictor(int a, int b, int c) { int p = a + b - c; int pa = FXSYS_abs(p - a); int pb = FXSYS_abs(p - b); int pc = FXSYS_abs(p - c); if (pa <= pb && pa <= pc) { - return (FX_BYTE)a; + return (uint8_t)a; } if (pb <= pc) { - return (FX_BYTE)b; + return (uint8_t)b; } - return (FX_BYTE)c; + return (uint8_t)c; } static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, int Bpp) { - FX_BYTE tag = cur_buf[0]; + uint8_t tag = cur_buf[0]; if (tag == 0) { return; } @@ -486,10 +486,10 @@ static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, i ref_buf ++; } for (int byte = 0; byte < pitch; byte ++) { - FX_BYTE raw_byte = cur_buf[byte]; + uint8_t raw_byte = cur_buf[byte]; switch (tag) { case 1: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= Bpp) { left = cur_buf[byte - Bpp]; } @@ -497,7 +497,7 @@ static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, i break; } case 2: { - FX_BYTE up = 0; + uint8_t up = 0; if (ref_buf) { up = ref_buf[byte]; } @@ -505,11 +505,11 @@ static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, i break; } case 3: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= Bpp) { left = cur_buf[byte - Bpp]; } - FX_BYTE up = 0; + uint8_t up = 0; if (ref_buf) { up = ref_buf[byte]; } @@ -517,15 +517,15 @@ static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, i break; } case 4: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= Bpp) { left = cur_buf[byte - Bpp]; } - FX_BYTE up = 0; + uint8_t up = 0; if (ref_buf) { up = ref_buf[byte]; } - FX_BYTE upper_left = 0; + uint8_t upper_left = 0; if (byte >= Bpp && ref_buf) { upper_left = ref_buf[byte - Bpp]; } @@ -538,9 +538,9 @@ static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, i void CPDF_PredictorFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) { if (m_pCurLine == NULL) { - m_pCurLine = FX_Alloc(FX_BYTE, m_Pitch); + m_pCurLine = FX_Alloc(uint8_t, m_Pitch); if (!m_bTiff) { - m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch); + m_pRefLine = FX_Alloc(uint8_t, m_Pitch); } } while (1) { @@ -579,7 +579,7 @@ CPDF_Ascii85Filter::CPDF_Ascii85Filter() void CPDF_Ascii85Filter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) { for (FX_DWORD i = 0; i < src_size; i ++) { - FX_BYTE byte = src_buf[i]; + uint8_t byte = src_buf[i]; if (PDF_CharType[byte] == 'W') { continue; } @@ -604,7 +604,7 @@ void CPDF_Ascii85Filter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_B m_CharCount ++; if (m_CharCount == 5) { for (int i = 0; i < 4; i ++) { - dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8)); + dest_buf.AppendByte((uint8_t)(m_CurDWord >> (3 - i) * 8)); } m_State = 0; } @@ -615,7 +615,7 @@ void CPDF_Ascii85Filter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_B m_CurDWord = m_CurDWord * 85 + 84; } for (i = 0; i < m_CharCount - 1; i ++) { - dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8)); + dest_buf.AppendByte((uint8_t)(m_CurDWord >> (3 - i) * 8)); } } m_State = 2; @@ -638,7 +638,7 @@ CPDF_AsciiHexFilter::CPDF_AsciiHexFilter() void CPDF_AsciiHexFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) { for (FX_DWORD i = 0; i < src_size; i ++) { - FX_BYTE byte = src_buf[i]; + uint8_t byte = src_buf[i]; if (PDF_CharType[byte] == 'W') { continue; } @@ -673,7 +673,7 @@ CPDF_RunLenFilter::CPDF_RunLenFilter() void CPDF_RunLenFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) { for (FX_DWORD i = 0; i < src_size; i ++) { - FX_BYTE byte = src_buf[i]; + uint8_t byte = src_buf[i]; switch (m_State) { case 0: if (byte < 128) { @@ -755,7 +755,7 @@ void CPDF_JpegFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_Bina m_Pitch = m_Width * m_nComps; } if (m_pScanline == NULL) { - m_pScanline = FX_Alloc(FX_BYTE, m_Pitch + 4); + m_pScanline = FX_Alloc(uint8_t, m_Pitch + 4); } while (1) { if (!CPDF_ModuleMgr::Get()->GetJpegModule()->ReadScanline(m_pContext, m_pScanline)) { @@ -803,8 +803,8 @@ FX_BOOL CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, m_nRows = nRows; m_nColumns = nColumns; m_Pitch = (m_nColumns + 7) / 8; - m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch); - m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch); + m_pRefBuf = FX_Alloc(uint8_t, m_Pitch); FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch); FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch); m_iRow = 0; @@ -839,9 +839,9 @@ void CPDF_FaxFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf) { ProcessData(m_InputBuf.GetBuffer(), m_InputBuf.GetSize(), m_InputBitPos, TRUE, dest_buf); } -FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos); -FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns); -FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns); +FX_BOOL _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos); +FX_BOOL _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const uint8_t* ref_buf, int columns); +FX_BOOL _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns); void CPDF_FaxFilter::ProcessData(FX_LPCBYTE src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish, CFX_BinaryBuf& dest_buf) { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp index c18668d683..d636f96b68 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp @@ -295,8 +295,8 @@ CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visite case PDFOBJ_REFERENCE: { CPDF_Reference* pRef = (CPDF_Reference*)this; FX_DWORD obj_num = pRef->m_RefObjNum; - if (bDirect && !visited->GetValueAt((void*)(FX_UINTPTR)obj_num)) { - visited->SetAt((void*)(FX_UINTPTR)obj_num, (void*)1); + if (bDirect && !visited->GetValueAt((void*)(uintptr_t)obj_num)) { + visited->SetAt((void*)(uintptr_t)obj_num, (void*)1); CPDF_Object* ret; if (pRef->GetDirect()) ret = pRef->GetDirect()->CloneInternal(TRUE, visited); @@ -896,7 +896,7 @@ void CPDF_Stream::InitStream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pD { InitStream(pDict); m_GenNum = (FX_DWORD) - 1; - m_pDataBuf = FX_Alloc(FX_BYTE, size); + m_pDataBuf = FX_Alloc(uint8_t, size); if (pData) { FXSYS_memcpy32(m_pDataBuf, pData, size); } @@ -918,7 +918,7 @@ void CPDF_Stream::SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, if (bKeepBuf) { m_pDataBuf = (FX_LPBYTE)pData; } else { - m_pDataBuf = FX_Alloc(FX_BYTE, size); + m_pDataBuf = FX_Alloc(uint8_t, size); if (pData) { FXSYS_memcpy32(m_pDataBuf, pData, size); } @@ -970,8 +970,8 @@ FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const if (!m_pFile || !pOther->m_pFile) { return FALSE; } - FX_BYTE srcBuf[1024]; - FX_BYTE destBuf[1024]; + uint8_t srcBuf[1024]; + uint8_t destBuf[1024]; FX_DWORD size = m_dwSize; FX_DWORD srcOffset = m_FileOffset; FX_DWORD destOffset = pOther->m_FileOffset; @@ -1008,7 +1008,7 @@ FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const if (NULL == pBuf) { return FALSE; } - FX_BYTE srcBuf[1024]; + uint8_t srcBuf[1024]; FX_DWORD size = m_dwSize; while (size > 0) { FX_DWORD actualSize = size > 1024 ? 1024 : size; @@ -1040,7 +1040,7 @@ CPDF_Stream* CPDF_Stream::Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpf CPDF_Stream* pObj = new CPDF_Stream(NULL, 0, NULL); CPDF_StreamFilter *pSF = GetStreamFilter(TRUE); if (pSF) { - FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, 4096); + FX_LPBYTE pBuf = FX_Alloc(uint8_t, 4096); FX_DWORD dwRead; do { dwRead = pSF->ReadBlock(pBuf, 4096); @@ -1086,7 +1086,7 @@ void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess, return; } if (!pStream->IsMemoryBased()) { - pSrcData = m_pSrcData = FX_Alloc(FX_BYTE, dwSrcSize); + pSrcData = m_pSrcData = FX_Alloc(uint8_t, dwSrcSize); if (!pStream->ReadRawData(0, pSrcData, dwSrcSize)) { return; } @@ -1165,7 +1165,7 @@ FX_LPBYTE CPDF_StreamAcc::DetachData() m_dwSize = 0; return p; } - FX_LPBYTE p = FX_Alloc(FX_BYTE, m_dwSize); + FX_LPBYTE p = FX_Alloc(uint8_t, m_dwSize); FXSYS_memcpy32(p, m_pData, m_dwSize); return p; } @@ -1200,7 +1200,7 @@ CPDF_Object* CPDF_IndirectObjects::GetIndirectObject(FX_DWORD objnum, struct PAR } FX_LPVOID value; { - if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { + if (m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, value)) { if (((CPDF_Object*)value)->GetObjNum() == -1) { return NULL; } @@ -1218,25 +1218,25 @@ CPDF_Object* CPDF_IndirectObjects::GetIndirectObject(FX_DWORD objnum, struct PAR if (m_LastObjNum < objnum) { m_LastObjNum = objnum; } - if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { + if (m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, value)) { if (value) { ((CPDF_Object *)value)->Destroy(); } } - m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); + m_IndirectObjs.SetAt((FX_LPVOID)(uintptr_t)objnum, pObj); return pObj; } int CPDF_IndirectObjects::GetIndirectType(FX_DWORD objnum) { FX_LPVOID value; - if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { + if (m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, value)) { return ((CPDF_Object*)value)->GetType(); } if (m_pParser) { PARSE_CONTEXT context; FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT)); context.m_Flags = PDFPARSE_TYPEONLY; - return (int)(FX_UINTPTR)m_pParser->ParseIndirectObject(this, objnum, &context); + return (int)(uintptr_t)m_pParser->ParseIndirectObject(this, objnum, &context); } return 0; } @@ -1246,21 +1246,21 @@ FX_DWORD CPDF_IndirectObjects::AddIndirectObject(CPDF_Object* pObj) return pObj->m_ObjNum; } m_LastObjNum ++; - m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)m_LastObjNum, pObj); + m_IndirectObjs.SetAt((FX_LPVOID)(uintptr_t)m_LastObjNum, pObj); pObj->m_ObjNum = m_LastObjNum; return m_LastObjNum; } void CPDF_IndirectObjects::ReleaseIndirectObject(FX_DWORD objnum) { FX_LPVOID value; - if (!m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { + if (!m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, value)) { return; } if (((CPDF_Object*)value)->GetObjNum() == -1) { return; } ((CPDF_Object*)value)->Destroy(); - m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum); + m_IndirectObjs.RemoveKey((FX_LPVOID)(uintptr_t)objnum); } void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj) { @@ -1268,7 +1268,7 @@ void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO return; } FX_LPVOID value = NULL; - if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { + if (m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, value)) { if (value) { if (pObj->GetGenNum() <= ((CPDF_Object*)value)->GetGenNum()) @@ -1278,7 +1278,7 @@ void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO } } pObj->m_ObjNum = objnum; - m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); + m_IndirectObjs.SetAt((FX_LPVOID)(uintptr_t)objnum, pObj); if (m_LastObjNum < objnum) { m_LastObjNum = objnum; } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 9c35615a72..4afc3a668b 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -27,7 +27,7 @@ FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict) } return FALSE; } -static FX_INT32 _CompareDWord(const void* p1, const void* p2) +static int32_t _CompareDWord(const void* p1, const void* p2) { return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2); } @@ -98,8 +98,8 @@ void CPDF_Parser::CloseParser(FX_BOOL bReParse) m_CrossRef.RemoveAll(); m_V5Type.RemoveAll(); m_ObjVersion.RemoveAll(); - FX_INT32 iLen = m_Trailers.GetSize(); - for (FX_INT32 i = 0; i < iLen; ++i) { + int32_t iLen = m_Trailers.GetSize(); + for (int32_t i = 0; i < iLen; ++i) { if (CPDF_Dictionary* trailer = m_Trailers.GetAt(i)) trailer->Release(); } @@ -109,11 +109,11 @@ void CPDF_Parser::CloseParser(FX_BOOL bReParse) m_pLinearized = NULL; } } -static FX_INT32 GetHeaderOffset(IFX_FileRead* pFile) +static int32_t GetHeaderOffset(IFX_FileRead* pFile) { FX_DWORD tag = FXDWORD_FROM_LSBFIRST(0x46445025); - FX_BYTE buf[4]; - FX_INT32 offset = 0; + uint8_t buf[4]; + int32_t offset = 0; while (1) { if (!pFile->ReadBlock(buf, offset, 4)) { return -1; @@ -152,7 +152,7 @@ FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse, FX m_bXRefStream = FALSE; m_LastXRefOffset = 0; m_bOwnFileRead = bOwnFileRead; - FX_INT32 offset = GetHeaderOffset(pFileAccess); + int32_t offset = GetHeaderOffset(pFileAccess); if (offset == -1) { if (bOwnFileRead && pFileAccess) { pFileAccess->Release(); @@ -160,7 +160,7 @@ FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse, FX return PDFPARSE_ERROR_FORMAT; } m_Syntax.InitParser(pFileAccess, offset); - FX_BYTE ch; + uint8_t ch; if (!m_Syntax.GetCharAt(5, ch)) { return PDFPARSE_ERROR_FORMAT; } @@ -331,11 +331,11 @@ FX_FILESIZE CPDF_Parser::GetObjectOffset(FX_DWORD objnum) return m_CrossRef[objnum]; } if (m_V5Type[objnum] == 2) { - return m_CrossRef[(FX_INT32)m_CrossRef[objnum]]; + return m_CrossRef[(int32_t)m_CrossRef[objnum]]; } return 0; } -static FX_INT32 GetDirectInteger(CPDF_Dictionary* pDict, FX_BSTR key) +static int32_t GetDirectInteger(CPDF_Dictionary* pDict, FX_BSTR key) { CPDF_Object* pObj = pDict->GetElement(key); if (pObj == NULL) { @@ -346,7 +346,7 @@ static FX_INT32 GetDirectInteger(CPDF_Dictionary* pDict, FX_BSTR key) } return 0; } -static FX_BOOL CheckDirectType(CPDF_Dictionary* pDict, FX_BSTR key, FX_INT32 iType) +static FX_BOOL CheckDirectType(CPDF_Dictionary* pDict, FX_BSTR key, int32_t iType) { CPDF_Object* pObj = pDict->GetElement(key); if (!pObj) { @@ -363,7 +363,7 @@ FX_BOOL CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos) if (m_pTrailer == NULL) { return FALSE; } - FX_INT32 xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); + int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); if (xrefsize <= 0 || xrefsize > (1 << 20)) { return FALSE; } @@ -400,7 +400,7 @@ FX_BOOL CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos) XRefStreamList.InsertAt(0, pDict->GetInteger(FX_BSTRC("XRefStm"))); m_Trailers.Add(pDict); } - for (FX_INT32 i = 0; i < CrossRefList.GetSize(); i ++) + for (int32_t i = 0; i < CrossRefList.GetSize(); i ++) if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], FALSE, i == 0)) { return FALSE; } @@ -415,7 +415,7 @@ FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos, FX_DWORD d if (m_pTrailer == NULL) { return FALSE; } - FX_INT32 xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); + int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); if (xrefsize == 0) { return FALSE; } @@ -434,7 +434,7 @@ FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos, FX_DWORD d XRefStreamList.InsertAt(0, pDict->GetInteger(FX_BSTRC("XRefStm"))); m_Trailers.Add(pDict); } - for (FX_INT32 i = 1; i < CrossRefList.GetSize(); i ++) + for (int32_t i = 1; i < CrossRefList.GetSize(); i ++) if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], FALSE, i == 0)) { return FALSE; } @@ -451,12 +451,12 @@ FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCou FX_DWORD start_objnum = 0; FX_DWORD count = dwObjCount; FX_FILESIZE SavedPos = m_Syntax.SavePos(); - FX_INT32 recordsize = 20; + int32_t recordsize = 20; char* pBuf = FX_Alloc(char, 1024 * recordsize + 1); pBuf[1024 * recordsize] = '\0'; - FX_INT32 nBlocks = count / 1024 + 1; - for (FX_INT32 block = 0; block < nBlocks; block ++) { - FX_INT32 block_size = block == nBlocks - 1 ? count % 1024 : 1024; + int32_t nBlocks = count / 1024 + 1; + for (int32_t block = 0; block < nBlocks; block ++) { + int32_t block_size = block == nBlocks - 1 ? count % 1024 : 1024; FX_DWORD dwReadSize = block_size * recordsize; if ((FX_FILESIZE)(dwStartPos + dwReadSize) > m_Syntax.m_FileLen) { FX_Free(pBuf); @@ -466,16 +466,16 @@ FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCou FX_Free(pBuf); return FALSE; } - for (FX_INT32 i = 0; i < block_size; i ++) { + for (int32_t i = 0; i < block_size; i ++) { FX_DWORD objnum = start_objnum + block * 1024 + i; char* pEntry = pBuf + i * recordsize; if (pEntry[17] == 'f') { m_CrossRef.SetAtGrow(objnum, 0); m_V5Type.SetAtGrow(objnum, 0); } else { - FX_INT32 offset = FXSYS_atoi(pEntry); + int32_t offset = FXSYS_atoi(pEntry); if (offset == 0) { - for (FX_INT32 c = 0; c < 10; c ++) { + for (int32_t c = 0; c < 10; c ++) { if (pEntry[c] < '0' || pEntry[c] > '9') { FX_Free(pBuf); return FALSE; @@ -483,7 +483,7 @@ FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCou } } m_CrossRef.SetAtGrow(objnum, offset); - FX_INT32 version = FXSYS_atoi(pEntry + 11); + int32_t version = FXSYS_atoi(pEntry + 11); if (version >= 1) { m_bVersionUpdated = TRUE; } @@ -537,7 +537,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_B m_Syntax.ToNextWord(); SavedPos = m_Syntax.SavePos(); FX_BOOL bFirstItem = FALSE; - FX_INT32 recordsize = 20; + int32_t recordsize = 20; if (bFirst) { bFirstItem = TRUE; } @@ -545,12 +545,12 @@ FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_B if (!bSkip) { char* pBuf = FX_Alloc(char, 1024 * recordsize + 1); pBuf[1024 * recordsize] = '\0'; - FX_INT32 nBlocks = count / 1024 + 1; + int32_t nBlocks = count / 1024 + 1; FX_BOOL bFirstBlock = TRUE; - for (FX_INT32 block = 0; block < nBlocks; block ++) { - FX_INT32 block_size = block == nBlocks - 1 ? count % 1024 : 1024; + for (int32_t block = 0; block < nBlocks; block ++) { + int32_t block_size = block == nBlocks - 1 ? count % 1024 : 1024; m_Syntax.ReadBlock((FX_LPBYTE)pBuf, block_size * recordsize); - for (FX_INT32 i = 0; i < block_size; i ++) { + for (int32_t i = 0; i < block_size; i ++) { FX_DWORD objnum = start_objnum + block * 1024 + i; char* pEntry = pBuf + i * recordsize; if (pEntry[17] == 'f') { @@ -560,7 +560,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_B } if (bFirstBlock) { FX_FILESIZE offset = (FX_FILESIZE)FXSYS_atoi64(pEntry); - FX_INT32 version = FXSYS_atoi(pEntry + 11); + int32_t version = FXSYS_atoi(pEntry + 11); if (offset == 0 && version == 65535 && start_objnum != 0) { start_objnum--; objnum = 0; @@ -571,7 +571,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_B } else { FX_FILESIZE offset = (FX_FILESIZE)FXSYS_atoi64(pEntry); if (offset == 0) { - for (FX_INT32 c = 0; c < 10; c ++) { + for (int32_t c = 0; c < 10; c ++) { if (pEntry[c] < '0' || pEntry[c] > '9') { FX_Free(pBuf); return FALSE; @@ -579,7 +579,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_B } } m_CrossRef.SetAtGrow(objnum, offset); - FX_INT32 version = FXSYS_atoi(pEntry + 11); + int32_t version = FXSYS_atoi(pEntry + 11); if (version >= 1) { m_bVersionUpdated = TRUE; } @@ -630,11 +630,11 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() m_pTrailer->Release(); m_pTrailer = NULL; } - FX_INT32 status = 0; - FX_INT32 inside_index = 0; + int32_t status = 0; + int32_t inside_index = 0; FX_DWORD objnum = 0, gennum = 0; - FX_INT32 depth = 0; - FX_LPBYTE buffer = FX_Alloc(FX_BYTE, 4096); + int32_t depth = 0; + FX_LPBYTE buffer = FX_Alloc(uint8_t, 4096); FX_FILESIZE pos = m_Syntax.m_HeaderOffset; FX_FILESIZE start_pos = 0, start_pos1 = 0; FX_FILESIZE last_obj = -1, last_xref = -1, last_trailer = -1; @@ -648,7 +648,7 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() break; } for (FX_DWORD i = 0; i < size; i ++) { - FX_BYTE byte = buffer[i]; + uint8_t byte = buffer[i]; switch (status) { case 0: if (PDF_CharType[byte] == 'W') { @@ -822,11 +822,11 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() } else { i += (FX_DWORD)nLen; } - if (m_CrossRef.GetSize() > (FX_INT32)objnum && m_CrossRef[objnum]) { + if (m_CrossRef.GetSize() > (int32_t)objnum && m_CrossRef[objnum]) { if (pObject) { FX_DWORD oldgen = m_ObjVersion.GetAt(objnum); m_CrossRef[objnum] = obj_pos; - m_ObjVersion.SetAt(objnum, (FX_SHORT)gennum); + m_ObjVersion.SetAt(objnum, (int16_t)gennum); if (oldgen != gennum) { m_bVersionUpdated = TRUE; } @@ -834,7 +834,7 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() } else { m_CrossRef.SetAtGrow(objnum, obj_pos); m_V5Type.SetAtGrow(objnum, 1); - m_ObjVersion.SetAtGrow(objnum, (FX_SHORT)gennum); + m_ObjVersion.SetAtGrow(objnum, (int16_t)gennum); } if (pObject) { pObject->Release(); @@ -990,10 +990,10 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() FX_Free(buffer); return TRUE; } -static FX_DWORD _GetVarInt(FX_LPCBYTE p, FX_INT32 n) +static FX_DWORD _GetVarInt(FX_LPCBYTE p, int32_t n) { FX_DWORD result = 0; - for (FX_INT32 i = 0; i < n; i ++) { + for (int32_t i = 0; i < n; i ++) { result = result * 256 + p[i]; } return result; @@ -1019,7 +1019,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL return FALSE; } prev = pStream->GetDict()->GetInteger(FX_BSTRC("Prev")); - FX_INT32 size = pStream->GetDict()->GetInteger(FX_BSTRC("Size")); + int32_t size = pStream->GetDict()->GetInteger(FX_BSTRC("Size")); if (size < 0) { pStream->Release(); return FALSE; @@ -1033,7 +1033,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL } else { m_Trailers.Add((CPDF_Dictionary*)pStream->GetDict()->Clone()); } - std::vector<std::pair<FX_INT32, FX_INT32> > arrIndex; + std::vector<std::pair<int32_t, int32_t> > arrIndex; CPDF_Array* pArray = pStream->GetDict()->GetArray(FX_BSTRC("Index")); if (pArray) { FX_DWORD nPairSize = pArray->GetCount() / 2; @@ -1075,12 +1075,12 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL FX_DWORD dwTotalSize = acc.GetSize(); FX_DWORD segindex = 0; for (FX_DWORD i = 0; i < arrIndex.size(); i ++) { - FX_INT32 startnum = arrIndex[i].first; + int32_t startnum = arrIndex[i].first; if (startnum < 0) { continue; } - m_dwXrefStartObjNum = pdfium::base::checked_cast<FX_DWORD, FX_INT32> (startnum); - FX_DWORD count = pdfium::base::checked_cast<FX_DWORD, FX_INT32> (arrIndex[i].second); + m_dwXrefStartObjNum = pdfium::base::checked_cast<FX_DWORD, int32_t> (startnum); + FX_DWORD count = pdfium::base::checked_cast<FX_DWORD, int32_t> (arrIndex[i].second); FX_SAFE_DWORD dwCaculatedSize = segindex; dwCaculatedSize += count; dwCaculatedSize *= totalWidth; @@ -1090,12 +1090,12 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL FX_LPCBYTE segstart = pData + segindex * totalWidth; FX_SAFE_DWORD dwMaxObjNum = startnum; dwMaxObjNum += count; - FX_DWORD dwV5Size = pdfium::base::checked_cast<FX_DWORD, FX_INT32> (m_V5Type.GetSize()); + FX_DWORD dwV5Size = pdfium::base::checked_cast<FX_DWORD, int32_t> (m_V5Type.GetSize()); if (!dwMaxObjNum.IsValid() || dwMaxObjNum.ValueOrDie() > dwV5Size) { continue; } for (FX_DWORD j = 0; j < count; j ++) { - FX_INT32 type = 1; + int32_t type = 1; FX_LPCBYTE entrystart = segstart + j * totalWidth; if (WidthArray[0]) { type = _GetVarInt(entrystart, WidthArray[0]); @@ -1212,8 +1212,8 @@ CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX if (pObjStream == NULL) { return NULL; } - FX_INT32 n = pObjStream->GetDict()->GetInteger(FX_BSTRC("N")); - FX_INT32 offset = pObjStream->GetDict()->GetInteger(FX_BSTRC("First")); + int32_t n = pObjStream->GetDict()->GetInteger(FX_BSTRC("N")); + int32_t offset = pObjStream->GetDict()->GetInteger(FX_BSTRC("First")); CPDF_SyntaxParser syntax; CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((FX_LPBYTE)pObjStream->GetData(), (size_t)pObjStream->GetSize(), FALSE)); syntax.InitParser(file.Get(), 0); @@ -1235,7 +1235,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX CPDF_StreamAcc* CPDF_Parser::GetObjectStream(FX_DWORD objnum) { CPDF_StreamAcc* pStreamAcc = NULL; - if (m_ObjectStreamMap.Lookup((void*)(FX_UINTPTR)objnum, (void*&)pStreamAcc)) { + if (m_ObjectStreamMap.Lookup((void*)(uintptr_t)objnum, (void*&)pStreamAcc)) { return pStreamAcc; } const CPDF_Stream* pStream = m_pDocument ? (CPDF_Stream*)m_pDocument->GetIndirectObject(objnum) : NULL; @@ -1244,7 +1244,7 @@ CPDF_StreamAcc* CPDF_Parser::GetObjectStream(FX_DWORD objnum) } pStreamAcc = new CPDF_StreamAcc; pStreamAcc->LoadAllData(pStream); - m_ObjectStreamMap.SetAt((void*)(FX_UINTPTR)objnum, pStreamAcc); + m_ObjectStreamMap.SetAt((void*)(uintptr_t)objnum, pStreamAcc); return pStreamAcc; } FX_FILESIZE CPDF_Parser::GetObjectSize(FX_DWORD objnum) @@ -1283,8 +1283,8 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, FX_LPBYTE& pBuffer, FX_DWOR if (pObjStream == NULL) { return; } - FX_INT32 n = pObjStream->GetDict()->GetInteger(FX_BSTRC("N")); - FX_INT32 offset = pObjStream->GetDict()->GetInteger(FX_BSTRC("First")); + int32_t n = pObjStream->GetDict()->GetInteger(FX_BSTRC("N")); + int32_t offset = pObjStream->GetDict()->GetInteger(FX_BSTRC("First")); CPDF_SyntaxParser syntax; FX_LPCBYTE pData = pObjStream->GetData(); FX_DWORD totalsize = pObjStream->GetSize(); @@ -1301,7 +1301,7 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, FX_LPBYTE& pBuffer, FX_DWOR FX_DWORD nextoff = syntax.GetDirectNum(); size = nextoff - thisoff; } - pBuffer = FX_Alloc(FX_BYTE, size); + pBuffer = FX_Alloc(uint8_t, size); FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size); return; } @@ -1368,7 +1368,7 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, FX_LPBYTE& pBuffer, FX_DWOR nextoff = m_Syntax.SavePos(); } size = (FX_DWORD)(nextoff - pos); - pBuffer = FX_Alloc(FX_BYTE, size); + pBuffer = FX_Alloc(uint8_t, size); m_Syntax.RestorePos(pos); m_Syntax.ReadBlock(pBuffer, size); m_Syntax.RestorePos(SavedPos); @@ -1553,7 +1553,7 @@ FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse m_bXRefStream = FALSE; m_LastXRefOffset = 0; m_bOwnFileRead = bOwnFileRead; - FX_INT32 offset = GetHeaderOffset(pFileAccess); + int32_t offset = GetHeaderOffset(pFileAccess); if (offset == -1) { return PDFPARSE_ERROR_FORMAT; } @@ -1579,7 +1579,7 @@ FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse if (m_pTrailer == NULL) { return FALSE; } - FX_INT32 xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); + int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size")); if (xrefsize > 0) { m_CrossRef.SetSize(xrefsize); m_V5Type.SetSize(xrefsize); @@ -1651,10 +1651,10 @@ FX_DWORD CPDF_Parser::LoadLinearizedMainXRefTable() m_pTrailer = NULL; } m_Syntax.RestorePos(m_LastXRefOffset - m_Syntax.m_HeaderOffset); - FX_BYTE ch = 0; + uint8_t ch = 0; FX_DWORD dwCount = 0; m_Syntax.GetNextChar(ch); - FX_INT32 type = PDF_CharType[ch]; + int32_t type = PDF_CharType[ch]; while (type == 'W') { ++dwCount; if (m_Syntax.m_FileLen >= (FX_FILESIZE)(m_Syntax.SavePos() + m_Syntax.m_HeaderOffset)) { @@ -1702,7 +1702,7 @@ CPDF_SyntaxParser::~CPDF_SyntaxParser() FX_Free(m_pFileBuf); } } -FX_BOOL CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, FX_BYTE& ch) +FX_BOOL CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch) { FX_FILESIZE save_pos = m_Pos; m_Pos = pos; @@ -1710,7 +1710,7 @@ FX_BOOL CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, FX_BYTE& ch) m_Pos = save_pos; return ret; } -FX_BOOL CPDF_SyntaxParser::GetNextChar(FX_BYTE& ch) +FX_BOOL CPDF_SyntaxParser::GetNextChar(uint8_t& ch) { FX_FILESIZE pos = m_Pos + m_HeaderOffset; if (pos >= m_FileLen) { @@ -1739,7 +1739,7 @@ FX_BOOL CPDF_SyntaxParser::GetNextChar(FX_BYTE& ch) m_Pos ++; return TRUE; } -FX_BOOL CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch) +FX_BOOL CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch) { pos += m_HeaderOffset; if (pos >= m_FileLen) { @@ -1782,11 +1782,11 @@ void CPDF_SyntaxParser::GetNextWord() { m_WordSize = 0; m_bIsNumber = TRUE; - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return; } - FX_BYTE type = PDF_CharType[ch]; + uint8_t type = PDF_CharType[ch]; while (1) { while (type == 'W') { if (!GetNextChar(ch)) { @@ -1864,13 +1864,13 @@ void CPDF_SyntaxParser::GetNextWord() } CFX_ByteString CPDF_SyntaxParser::ReadString() { - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return CFX_ByteString(); } CFX_ByteTextBuf buf; - FX_INT32 parlevel = 0; - FX_INT32 status = 0, iEscCode = 0; + int32_t parlevel = 0; + int32_t status = 0, iEscCode = 0; while (1) { switch (status) { case 0: @@ -1951,13 +1951,13 @@ CFX_ByteString CPDF_SyntaxParser::ReadString() } CFX_ByteString CPDF_SyntaxParser::ReadHexString() { - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return CFX_ByteString(); } CFX_BinaryBuf buf; FX_BOOL bFirst = TRUE; - FX_BYTE code = 0; + uint8_t code = 0; while (1) { if (ch == '>') { break; @@ -1967,7 +1967,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() code = (ch - '0') * 16; } else { code += ch - '0'; - buf.AppendByte((FX_BYTE)code); + buf.AppendByte((uint8_t)code); } bFirst = !bFirst; } else if (ch >= 'A' && ch <= 'F') { @@ -1975,7 +1975,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() code = (ch - 'A' + 10) * 16; } else { code += ch - 'A' + 10; - buf.AppendByte((FX_BYTE)code); + buf.AppendByte((uint8_t)code); } bFirst = !bFirst; } else if (ch >= 'a' && ch <= 'f') { @@ -1983,7 +1983,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() code = (ch - 'a' + 10) * 16; } else { code += ch - 'a' + 10; - buf.AppendByte((FX_BYTE)code); + buf.AppendByte((uint8_t)code); } bFirst = !bFirst; } @@ -1992,13 +1992,13 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() } } if (!bFirst) { - buf.AppendByte((FX_BYTE)code); + buf.AppendByte((uint8_t)code); } return buf.GetByteString(); } void CPDF_SyntaxParser::ToNextLine() { - FX_BYTE ch; + uint8_t ch; while (1) { if (!GetNextChar(ch)) { return; @@ -2019,11 +2019,11 @@ void CPDF_SyntaxParser::ToNextLine() } void CPDF_SyntaxParser::ToNextWord() { - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return; } - FX_BYTE type = PDF_CharType[ch]; + uint8_t type = PDF_CharType[ch]; while (1) { while (type == 'W') { m_dwWordPos = m_Pos; @@ -2168,7 +2168,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO pContext->m_DictStart = SavedPos; } CPDF_Dictionary* pDict = CPDF_Dictionary::Create(); - FX_INT32 nKeys = 0; + int32_t nKeys = 0; FX_FILESIZE dwSignValuePos = 0; while (1) { FX_BOOL bIsNumber; @@ -2377,7 +2377,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList if (pDict) { pDict->Release(); } - FX_BYTE ch; + uint8_t ch; while (1) { if (!GetNextChar(ch)) { break; @@ -2461,7 +2461,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT } else { m_Pos = curPos; } - FX_BYTE byte1, byte2; + uint8_t byte1, byte2; GetCharAt(StreamStartPos + offset - 1, byte1); GetCharAt(StreamStartPos + offset - 2, byte2); if (byte1 == 0x0a && byte2 == 0x0d) { @@ -2481,7 +2481,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT m_Pos = StreamStartPos; } CPDF_Stream* pStream; - FX_LPBYTE pData = FX_Alloc(FX_BYTE, len); + FX_LPBYTE pData = FX_Alloc(uint8_t, len); ReadBlock(pData, len); if (pCryptoHandler) { CFX_BinaryBuf dest_buf; @@ -2511,7 +2511,7 @@ void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOff FX_Free(m_pFileBuf); m_pFileBuf = NULL; } - m_pFileBuf = FX_Alloc(FX_BYTE, m_BufSize); + m_pFileBuf = FX_Alloc(uint8_t, m_BufSize); m_HeaderOffset = HeaderOffset; m_FileLen = pFileAccess->GetSize(); m_Pos = 0; @@ -2519,7 +2519,7 @@ void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOff m_BufOffset = 0; pFileAccess->ReadBlock(m_pFileBuf, 0, (size_t)((FX_FILESIZE)m_BufSize > m_FileLen ? m_FileLen : m_BufSize)); } -FX_INT32 CPDF_SyntaxParser::GetDirectNum() +int32_t CPDF_SyntaxParser::GetDirectNum() { GetNextWord(); if (!m_bIsNumber) { @@ -2530,19 +2530,19 @@ FX_INT32 CPDF_SyntaxParser::GetDirectNum() } FX_BOOL CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, FX_LPCBYTE tag, FX_DWORD taglen) { - FX_BYTE type = PDF_CharType[tag[0]]; + uint8_t type = PDF_CharType[tag[0]]; FX_BOOL bCheckLeft = type != 'D' && type != 'W'; type = PDF_CharType[tag[taglen - 1]]; FX_BOOL bCheckRight = type != 'D' && type != 'W'; - FX_BYTE ch; - if (bCheckRight && startpos + (FX_INT32)taglen <= limit && GetCharAt(startpos + (FX_INT32)taglen, ch)) { - FX_BYTE type = PDF_CharType[ch]; + uint8_t ch; + if (bCheckRight && startpos + (int32_t)taglen <= limit && GetCharAt(startpos + (int32_t)taglen, ch)) { + uint8_t type = PDF_CharType[ch]; if (type == 'N' || type == 'R') { return FALSE; } } if (bCheckLeft && startpos > 0 && GetCharAt(startpos - 1, ch)) { - FX_BYTE type = PDF_CharType[ch]; + uint8_t type = PDF_CharType[ch]; if (type == 'N' || type == 'R') { return FALSE; } @@ -2551,17 +2551,17 @@ FX_BOOL CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, } FX_BOOL CPDF_SyntaxParser::SearchWord(FX_BSTR tag, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit) { - FX_INT32 taglen = tag.GetLength(); + int32_t taglen = tag.GetLength(); if (taglen == 0) { return FALSE; } FX_FILESIZE pos = m_Pos; - FX_INT32 offset = 0; + int32_t offset = 0; if (!bForward) { offset = taglen - 1; } FX_LPCBYTE tag_data = tag.GetPtr(); - FX_BYTE byte; + uint8_t byte; while (1) { if (bForward) { if (limit) { @@ -2620,9 +2620,9 @@ struct _SearchTagRecord { FX_DWORD m_Len; FX_DWORD m_Offset; }; -FX_INT32 CPDF_SyntaxParser::SearchMultiWord(FX_BSTR tags, FX_BOOL bWholeWord, FX_FILESIZE limit) +int32_t CPDF_SyntaxParser::SearchMultiWord(FX_BSTR tags, FX_BOOL bWholeWord, FX_FILESIZE limit) { - FX_INT32 ntags = 1, i; + int32_t ntags = 1, i; for (i = 0; i < tags.GetLength(); i ++) if (tags[i] == 0) { ntags ++; @@ -2643,9 +2643,9 @@ FX_INT32 CPDF_SyntaxParser::SearchMultiWord(FX_BSTR tags, FX_BOOL bWholeWord, FX } } FX_FILESIZE pos = m_Pos; - FX_BYTE byte; + uint8_t byte; GetCharAt(pos++, byte); - FX_INT32 found = -1; + int32_t found = -1; while (1) { for (i = 0; i < ntags; i ++) { if (pPatterns[i].m_pTag[pPatterns[i].m_Offset] == byte) { @@ -2684,12 +2684,12 @@ end: } FX_FILESIZE CPDF_SyntaxParser::FindTag(FX_BSTR tag, FX_FILESIZE limit) { - FX_INT32 taglen = tag.GetLength(); - FX_INT32 match = 0; + int32_t taglen = tag.GetLength(); + int32_t match = 0; limit += m_Pos; FX_FILESIZE startpos = m_Pos; while (1) { - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return -1; } @@ -2707,10 +2707,10 @@ FX_FILESIZE CPDF_SyntaxParser::FindTag(FX_BSTR tag, FX_FILESIZE limit) } return -1; } -void CPDF_SyntaxParser::GetBinary(FX_BYTE* buffer, FX_DWORD size) +void CPDF_SyntaxParser::GetBinary(uint8_t* buffer, FX_DWORD size) { FX_DWORD offset = 0; - FX_BYTE ch; + uint8_t ch; while (1) { if (!GetNextChar(ch)) { return; @@ -2734,9 +2734,9 @@ public: virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) override; - virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) override; + virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) override; - virtual FX_INT32 IsLinearizedPDF() override; + virtual int32_t IsLinearizedPDF() override; virtual FX_BOOL IsLinearized() override { @@ -2770,11 +2770,11 @@ protected: FX_BOOL CheckPageStatus(IFX_DownloadHints* pHints); FX_BOOL CheckAllCrossRefStream(IFX_DownloadHints *pHints); - FX_INT32 CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset); + int32_t CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset); FX_BOOL IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen); void SetStartOffset(FX_FILESIZE dwOffset); FX_BOOL GetNextToken(CFX_ByteString &token); - FX_BOOL GetNextChar(FX_BYTE &ch); + FX_BOOL GetNextChar(uint8_t &ch); CPDF_Object * ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum); CPDF_Object * GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile); FX_BOOL GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages); @@ -2788,10 +2788,10 @@ protected: FX_BOOL CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints); FX_BOOL HaveResourceAncestor(CPDF_Dictionary *pDict); - FX_BOOL CheckPage(FX_INT32 iPage, IFX_DownloadHints* pHints); + FX_BOOL CheckPage(int32_t iPage, IFX_DownloadHints* pHints); FX_BOOL LoadDocPages(IFX_DownloadHints* pHints); - FX_BOOL LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints); - FX_BOOL CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, FX_INT32 &iCount, IFX_DownloadHints* pHints); + FX_BOOL LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints); + FX_BOOL CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints); FX_BOOL CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints); FX_BOOL CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints); FX_BOOL CheckPageCount(IFX_DownloadHints* pHints); @@ -2842,11 +2842,11 @@ protected: CFX_ByteString m_WordBuf; - FX_BYTE m_WordBuffer[257]; + uint8_t m_WordBuffer[257]; FX_DWORD m_WordSize; - FX_BYTE m_bufferData[512]; + uint8_t m_bufferData[512]; CFX_FileSizeArray m_CrossOffset; @@ -2994,8 +2994,8 @@ CPDF_DataAvail::~CPDF_DataAvail() if (m_pagesLoadState) { delete m_pagesLoadState; } - FX_INT32 i = 0; - FX_INT32 iSize = m_arrayAcroforms.GetSize(); + int32_t i = 0; + int32_t iSize = m_arrayAcroforms.GetSize(); for (i = 0; i < iSize; ++i) { ((CPDF_Object *)m_arrayAcroforms.GetAt(i))->Release(); } @@ -3039,13 +3039,13 @@ FX_BOOL CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePa } FX_DWORD count = 0; CFX_PtrArray new_obj_array; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < obj_array.GetSize(); i++) { CPDF_Object *pObj = (CPDF_Object *)obj_array[i]; if (!pObj) { continue; } - FX_INT32 type = pObj->GetType(); + int32_t type = pObj->GetType(); switch (type) { case PDFOBJ_ARRAY: { CPDF_Array *pArray = pObj->GetArray(); @@ -3111,10 +3111,10 @@ FX_BOOL CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePa } } if (count > 0) { - FX_INT32 iSize = new_obj_array.GetSize(); + int32_t iSize = new_obj_array.GetSize(); for (i = 0; i < iSize; ++i) { CPDF_Object *pObj = (CPDF_Object *)new_obj_array[i]; - FX_INT32 type = pObj->GetType(); + int32_t type = pObj->GetType(); if (type == PDFOBJ_REFERENCE) { CPDF_Reference *pRef = (CPDF_Reference *)pObj; FX_DWORD dwNum = pRef->GetRefObjNum(); @@ -3162,8 +3162,8 @@ FX_BOOL CPDF_DataAvail::CheckAcroFormSubObject(IFX_DownloadHints* pHints) CFX_PtrArray new_objs_array; FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array); if (bRet) { - FX_INT32 iSize = m_arrayAcroforms.GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = m_arrayAcroforms.GetSize(); + for (int32_t i = 0; i < iSize; ++i) { ((CPDF_Object *)m_arrayAcroforms.GetAt(i))->Release(); } m_arrayAcroforms.RemoveAll(); @@ -3475,9 +3475,9 @@ FX_BOOL CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints) if (pObj->GetType() == PDFOBJ_ARRAY) { CPDF_Array *pArray = pObj->GetArray(); if (pArray) { - FX_INT32 iSize = pArray->GetCount(); + int32_t iSize = pArray->GetCount(); CPDF_Object *pItem = NULL; - for (FX_INT32 j = 0; j < iSize; ++j) { + for (int32_t j = 0; j < iSize; ++j) { pItem = pArray->GetElement(j); if (pItem && pItem->GetType() == PDFOBJ_REFERENCE) { UnavailObjList.Add(((CPDF_Reference *)pItem)->GetRefObjNum()); @@ -3589,7 +3589,7 @@ FX_BOOL CPDF_DataAvail::CheckHeader(IFX_DownloadHints* pHints) req_size = (FX_DWORD)m_dwFileLen; } if (m_pFileAvail->IsDataAvail(0, req_size)) { - FX_BYTE buffer[1024]; + uint8_t buffer[1024]; m_pFileRead->ReadBlock(buffer, 0, req_size); if (IsLinearizedFile(buffer, req_size)) { m_docStatus = PDF_DATAAVAIL_FIRSTPAGE; @@ -3629,8 +3629,8 @@ FX_BOOL CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints) if ((FX_FILESIZE)dwEnd > m_dwFileLen) { dwEnd = (FX_DWORD)m_dwFileLen; } - FX_INT32 iStartPos = (FX_INT32)(m_dwFileLen > 1024 ? 1024 : m_dwFileLen); - FX_INT32 iSize = dwEnd > 1024 ? dwEnd - 1024 : 0; + int32_t iStartPos = (int32_t)(m_dwFileLen > 1024 ? 1024 : m_dwFileLen); + int32_t iSize = dwEnd > 1024 ? dwEnd - 1024 : 0; if (!m_pFileAvail->IsDataAvail(iStartPos, iSize)) { pHints->AddSegment(iStartPos, iSize); bNeedDownLoad = TRUE; @@ -3690,7 +3690,7 @@ CPDF_Object * CPDF_DataAvail::ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD ob m_syntaxParser.RestorePos(SavedPos); return pObj; } -FX_INT32 CPDF_DataAvail::IsLinearizedPDF() +int32_t CPDF_DataAvail::IsLinearizedPDF() { FX_DWORD req_size = 1024; if (!m_pFileAvail->IsDataAvail(0, req_size)) { @@ -3703,7 +3703,7 @@ FX_INT32 CPDF_DataAvail::IsLinearizedPDF() if (dwSize < (FX_FILESIZE)req_size) { return PDF_UNKNOW_LINEARIZED; } - FX_BYTE buffer[1024]; + uint8_t buffer[1024]; m_pFileRead->ReadBlock(buffer, 0, req_size); if (IsLinearizedFile(buffer, req_size)) { return PDF_IS_LINEARIZED; @@ -3713,7 +3713,7 @@ FX_INT32 CPDF_DataAvail::IsLinearizedPDF() FX_BOOL CPDF_DataAvail::IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen) { CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pData, (size_t)dwLen, FALSE)); - FX_INT32 offset = GetHeaderOffset(file.Get()); + int32_t offset = GetHeaderOffset(file.Get()); if (offset == -1) { m_docStatus = PDF_DATAAVAIL_ERROR; return FALSE; @@ -3757,7 +3757,7 @@ FX_BOOL CPDF_DataAvail::CheckEnd(IFX_DownloadHints* pHints) FX_DWORD req_pos = (FX_DWORD)(m_dwFileLen > 1024 ? m_dwFileLen - 1024 : 0); FX_DWORD dwSize = (FX_DWORD)(m_dwFileLen - req_pos); if (m_pFileAvail->IsDataAvail(req_pos, dwSize)) { - FX_BYTE buffer[1024]; + uint8_t buffer[1024]; m_pFileRead->ReadBlock(buffer, req_pos, dwSize); CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(buffer, (size_t)dwSize, FALSE)); m_syntaxParser.InitParser(file.Get(), 0); @@ -3787,12 +3787,12 @@ FX_BOOL CPDF_DataAvail::CheckEnd(IFX_DownloadHints* pHints) pHints->AddSegment(req_pos, dwSize); return FALSE; } -FX_INT32 CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints, FX_FILESIZE &xref_offset) +int32_t CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints, FX_FILESIZE &xref_offset) { xref_offset = 0; FX_DWORD req_size = (FX_DWORD)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); if (m_pFileAvail->IsDataAvail(m_Pos, req_size)) { - FX_INT32 iSize = (FX_INT32)(m_Pos + req_size - m_dwCurrentXRefSteam); + int32_t iSize = (int32_t)(m_Pos + req_size - m_dwCurrentXRefSteam); CFX_BinaryBuf buf(iSize); FX_LPBYTE pBuf = buf.GetBuffer(); m_pFileRead->ReadBlock(pBuf, m_dwCurrentXRefSteam, iSize); @@ -3836,11 +3836,11 @@ inline void CPDF_DataAvail::SetStartOffset(FX_FILESIZE dwOffset) FX_BOOL CPDF_DataAvail::GetNextToken(CFX_ByteString &token) { m_WordSize = 0; - FX_BYTE ch; + uint8_t ch; if (!GetNextChar(ch)) { return FALSE; } - FX_BYTE type = PDF_CharType[ch]; + uint8_t type = PDF_CharType[ch]; while (1) { while (type == 'W') { if (!GetNextChar(ch)) { @@ -3919,7 +3919,7 @@ FX_BOOL CPDF_DataAvail::GetNextToken(CFX_ByteString &token) token = ret; return TRUE; } -FX_BOOL CPDF_DataAvail::GetNextChar(FX_BYTE &ch) +FX_BOOL CPDF_DataAvail::GetNextChar(uint8_t &ch) { FX_FILESIZE pos = m_Pos; if (pos >= m_dwFileLen) { @@ -3946,11 +3946,11 @@ FX_BOOL CPDF_DataAvail::GetNextChar(FX_BYTE &ch) } FX_BOOL CPDF_DataAvail::CheckCrossRefItem(IFX_DownloadHints *pHints) { - FX_INT32 iSize = 0; + int32_t iSize = 0; CFX_ByteString token; while (1) { if (!GetNextToken(token)) { - iSize = (FX_INT32)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); + iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); pHints->AddSegment(m_Pos, iSize); return FALSE; } @@ -3964,7 +3964,7 @@ FX_BOOL CPDF_DataAvail::CheckCrossRefItem(IFX_DownloadHints *pHints) FX_BOOL CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints) { FX_FILESIZE xref_offset = 0; - FX_INT32 nRet = CheckCrossRefStream(pHints, xref_offset); + int32_t nRet = CheckCrossRefStream(pHints, xref_offset); if (nRet == 1) { if (!xref_offset) { m_docStatus = PDF_DATAAVAIL_LOADALLCRSOSSREF; @@ -3980,10 +3980,10 @@ FX_BOOL CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints) } FX_BOOL CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints) { - FX_INT32 iSize = 0; + int32_t iSize = 0; CFX_ByteString token; if (!GetNextToken(token)) { - iSize = (FX_INT32)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); + iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); pHints->AddSegment(m_Pos, iSize); return FALSE; } @@ -3991,7 +3991,7 @@ FX_BOOL CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints) m_CrossOffset.InsertAt(0, m_dwXRefOffset); while (1) { if (!GetNextToken(token)) { - iSize = (FX_INT32)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); + iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); pHints->AddSegment(m_Pos, iSize); m_docStatus = PDF_DATAAVAIL_CROSSREF_ITEM; return FALSE; @@ -4012,7 +4012,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints) { if (m_Pos < m_dwFileLen) { FX_FILESIZE dwAppendPos = m_Pos + m_syntaxParser.SavePos(); - FX_INT32 iSize = (FX_INT32)(dwAppendPos + 512 > m_dwFileLen ? m_dwFileLen - dwAppendPos : 512); + int32_t iSize = (int32_t)(dwAppendPos + 512 > m_dwFileLen ? m_dwFileLen - dwAppendPos : 512); if (!m_pFileAvail->IsDataAvail(dwAppendPos, iSize)) { pHints->AddSegment(dwAppendPos, iSize); return FALSE; @@ -4028,9 +4028,9 @@ FX_BOOL CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints) } FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) { - FX_INT32 iTrailerSize = (FX_INT32)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); + int32_t iTrailerSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); if (m_pFileAvail->IsDataAvail(m_Pos, iTrailerSize)) { - FX_INT32 iSize = (FX_INT32)(m_Pos + iTrailerSize - m_dwTrailerOffset); + int32_t iSize = (int32_t)(m_Pos + iTrailerSize - m_dwTrailerOffset); CFX_BinaryBuf buf(iSize); FX_LPBYTE pBuf = buf.GetBuffer(); if (!pBuf) { @@ -4086,7 +4086,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) pHints->AddSegment(m_Pos, iTrailerSize); return FALSE; } -FX_BOOL CPDF_DataAvail::CheckPage(FX_INT32 iPage, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::CheckPage(int32_t iPage, IFX_DownloadHints* pHints) { while (TRUE) { switch (m_docStatus) { @@ -4215,14 +4215,14 @@ FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pP pPage->Release(); return TRUE; } -FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, FX_INT32 &iCount, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints) { - FX_INT32 iSize = pageNodes.m_childNode.GetSize(); + int32_t iSize = pageNodes.m_childNode.GetSize(); if (iSize <= 0 || iPage >= iSize) { m_docStatus = PDF_DATAAVAIL_ERROR; return FALSE; } - for (FX_INT32 i = 0; i < iSize; ++i) { + for (int32_t i = 0; i < iSize; ++i) { CPDF_PageNode *pNode = (CPDF_PageNode*)pageNodes.m_childNode.GetAt(i); if (!pNode) { continue; @@ -4259,7 +4259,7 @@ FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, } return TRUE; } -FX_BOOL CPDF_DataAvail::LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints) { if (m_pDocument->GetPageCount() <= iPage || m_pDocument->m_PageList.GetAt(iPage)) { m_docStatus = PDF_DATAAVAIL_DONE; @@ -4273,7 +4273,7 @@ FX_BOOL CPDF_DataAvail::LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints) m_docStatus = PDF_DATAAVAIL_ERROR; return TRUE; } - FX_INT32 iCount = -1; + int32_t iCount = -1; return CheckPageNode(m_pageNodes, iPage, iCount, pHints); } FX_BOOL CPDF_DataAvail::CheckPageCount(IFX_DownloadHints* pHints) @@ -4361,7 +4361,7 @@ FX_BOOL CPDF_DataAvail::CheckLinearizedData(IFX_DownloadHints* pHints) return m_bLinearedDataOK; } -FX_BOOL CPDF_DataAvail::CheckPageAnnots(FX_INT32 iPage, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::CheckPageAnnots(int32_t iPage, IFX_DownloadHints* pHints) { if (!m_objs_array.GetSize()) { m_objs_array.RemoveAll(); @@ -4391,7 +4391,7 @@ FX_BOOL CPDF_DataAvail::CheckPageAnnots(FX_INT32 iPage, IFX_DownloadHints* pHint return bRet; } } -FX_BOOL CPDF_DataAvail::CheckLinearizedFirstPage(FX_INT32 iPage, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::CheckLinearizedFirstPage(int32_t iPage, IFX_DownloadHints* pHints) { if (!m_bAnnotsLoad) { if (!CheckPageAnnots(iPage, pHints)) { @@ -4427,7 +4427,7 @@ FX_BOOL CPDF_DataAvail::HaveResourceAncestor(CPDF_Dictionary *pDict) } return HaveResourceAncestor(pParentDict); } -FX_BOOL CPDF_DataAvail::IsPageAvail(FX_INT32 iPage, IFX_DownloadHints* pHints) +FX_BOOL CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) { if (!m_pDocument) { return FALSE; @@ -4576,7 +4576,7 @@ void CPDF_DataAvail::GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSiz *pSize = (FX_DWORD)(m_dwFileLen - m_dwLastXRefOffset); } } -FX_INT32 CPDF_DataAvail::IsFormAvail(IFX_DownloadHints *pHints) +int32_t CPDF_DataAvail::IsFormAvail(IFX_DownloadHints *pHints) { if (!m_pDocument) { return PDFFORM_AVAIL; @@ -4609,7 +4609,7 @@ FX_INT32 CPDF_DataAvail::IsFormAvail(IFX_DownloadHints *pHints) } void CPDF_SortObjNumArray::AddObjNum(FX_DWORD dwObjNum) { - FX_INT32 iNext = 0; + int32_t iNext = 0; if (BinarySearch(dwObjNum, iNext)) { return; } @@ -4617,15 +4617,15 @@ void CPDF_SortObjNumArray::AddObjNum(FX_DWORD dwObjNum) } FX_BOOL CPDF_SortObjNumArray::Find(FX_DWORD dwObjNum) { - FX_INT32 iNext = 0; + int32_t iNext = 0; return BinarySearch(dwObjNum, iNext); } -FX_BOOL CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, FX_INT32 &iNext) +FX_BOOL CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, int32_t &iNext) { - FX_INT32 iLen = m_number_array.GetSize(); - FX_INT32 iLow = 0; - FX_INT32 iHigh = iLen - 1; - FX_INT32 iMid = 0; + int32_t iLen = m_number_array.GetSize(); + int32_t iLow = 0; + int32_t iHigh = iLen - 1; + int32_t iMid = 0; while (iLow <= iHigh) { iMid = (iLow + iHigh) / 2; if (m_number_array.GetAt(iMid) == value) { @@ -4642,8 +4642,8 @@ FX_BOOL CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, FX_INT32 &iNext) } CPDF_PageNode::~CPDF_PageNode() { - FX_INT32 iSize = m_childNode.GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = m_childNode.GetSize(); + for (int32_t i = 0; i < iSize; ++i) { CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; if (pNode) { delete pNode; diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp index df154eae90..b02139db0f 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp @@ -60,7 +60,7 @@ void CPDF_SimpleParser::ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& typ pStart = NULL; dwSize = 0; type = PDFWORD_EOF; - FX_BYTE ch; + uint8_t ch; char chartype; while (1) { if (m_dwSize <= m_dwCurPos) { @@ -322,7 +322,7 @@ CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) int dest_len = 0; int i; for (i = 0; i < src_len; i ++) { - FX_BYTE ch = src_buf[i]; + uint8_t ch = src_buf[i]; if (ch >= 0x80 || PDF_CharType[ch] == 'W' || ch == '#' || PDF_CharType[ch] == 'D') { dest_len += 3; @@ -337,7 +337,7 @@ CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) FX_LPSTR dest_buf = res.GetBuffer(dest_len); dest_len = 0; for (i = 0; i < src_len; i ++) { - FX_BYTE ch = src_buf[i]; + uint8_t ch = src_buf[i]; if (ch >= 0x80 || PDF_CharType[ch] == 'W' || ch == '#' || PDF_CharType[ch] == 'D') { dest_buf[dest_len++] = '#'; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index a9212522b8..a98c57d86c 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -361,10 +361,10 @@ FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, con FX_FLOAT a = FXSYS_fabs(dCTM.a); FX_FLOAT d = FXSYS_fabs(dCTM.d); if (a != 1.0f || d != 1.0f) { - rect.right = rect.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Width() * a); - rect.bottom = rect.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Height() * d); - rtClip.right = rtClip.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Width() * a); - rtClip.bottom = rtClip.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Height() * d); + rect.right = rect.left + (int32_t)FXSYS_ceil((FX_FLOAT)rect.Width() * a); + rect.bottom = rect.top + (int32_t)FXSYS_ceil((FX_FLOAT)rect.Height() * d); + rtClip.right = rtClip.left + (int32_t)FXSYS_ceil((FX_FLOAT)rtClip.Width() * a); + rtClip.bottom = rtClip.top + (int32_t)FXSYS_ceil((FX_FLOAT)rtClip.Height() * d); } } rect.Intersect(rtClip); @@ -568,7 +568,7 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bTyp const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState; int alpha; if (pGeneralData) { - alpha = (FX_INT32)(pGeneralData->m_FillAlpha * 255); + alpha = (int32_t)(pGeneralData->m_FillAlpha * 255); if (pGeneralData->m_pTR) { if (!pGeneralData->m_pTransferFunc) { ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR); @@ -597,7 +597,7 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState; int alpha; if (pGeneralData) { - alpha = (FX_INT32)(pGeneralData->m_StrokeAlpha * 255); + alpha = (int32_t)(pGeneralData->m_StrokeAlpha * 255); if (pGeneralData->m_pTR) { if (!pGeneralData->m_pTransferFunc) { ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR); @@ -857,7 +857,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, pTextMask = NULL; } if (Transparency & PDFTRANS_GROUP && group_alpha != 1.0f) { - bitmap->MultiplyAlpha((FX_INT32)(group_alpha * 255)); + bitmap->MultiplyAlpha((int32_t)(group_alpha * 255)); } Transparency = m_Transparency; if (pPageObj->m_Type == PDFPAGE_FORM) { @@ -1371,13 +1371,13 @@ FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Re } m_pBitmapDevice = new CFX_FxgeDevice; FXDIB_Format dibFormat = FXDIB_Rgb; - FX_INT32 bpp = 24; + int32_t bpp = 24; if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT) { dibFormat = FXDIB_Argb; bpp = 32; } CFX_FloatRect rect; - FX_INT32 iWidth, iHeight, iPitch; + int32_t iWidth, iHeight, iPitch; while (1) { rect = *pRect; m_Matrix.TransformRect(rect); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp index 83d5f0a4c1..d22bd4b760 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -37,13 +37,13 @@ void CPDF_PageRenderCache::ClearAll() m_nCacheSize = 0; m_nTimeCount = 0; } -void CPDF_PageRenderCache::CacheOptimization(FX_INT32 dwLimitCacheSize) +void CPDF_PageRenderCache::CacheOptimization(int32_t dwLimitCacheSize) { if (m_nCacheSize <= (FX_DWORD)dwLimitCacheSize) { return; } int nCount = m_ImageCaches.GetCount(); - CACHEINFO* pCACHEINFO = (CACHEINFO*)FX_Alloc2D(FX_BYTE, sizeof(CACHEINFO), nCount); + CACHEINFO* pCACHEINFO = (CACHEINFO*)FX_Alloc2D(uint8_t, sizeof(CACHEINFO), nCount); FX_POSITION pos = m_ImageCaches.GetStartPosition(); int i = 0; while (pos) { @@ -106,7 +106,7 @@ FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const } void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, - FX_INT32 downsampleWidth, FX_INT32 downsampleHeight) + int32_t downsampleWidth, int32_t downsampleHeight) { CPDF_ImageCache* pImageCache; FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache); @@ -122,7 +122,7 @@ void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& m_nCacheSize += pImageCache->EstimateSize(); } } -FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight) +FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) { m_bCurFindCache = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)m_pCurImageCache); if (!m_bCurFindCache) { @@ -226,7 +226,7 @@ static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB) } FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, - FX_INT32 downsampleWidth, FX_INT32 downsampleHeight) + int32_t downsampleWidth, int32_t downsampleHeight) { if (m_pCachedBitmap) { pBitmap = m_pCachedBitmap; @@ -278,7 +278,7 @@ CFX_DIBSource* CPDF_ImageCache::DetachMask() } int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, - FX_INT32 downsampleWidth, FX_INT32 downsampleHeight) + int32_t downsampleWidth, int32_t downsampleHeight) { if (m_pCachedBitmap) { m_pCurBitmap = m_pCachedBitmap; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index 214e4314da..699f84830f 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -40,7 +40,7 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int } else { FX_DWORD fill_argb = m_Options.TranslateColor(mask_argb); if (bitmap_alpha < 255) { - ((FX_BYTE*)&fill_argb)[3] = ((FX_BYTE*)&fill_argb)[3] * bitmap_alpha / 255; + ((uint8_t*)&fill_argb)[3] = ((uint8_t*)&fill_argb)[3] * bitmap_alpha / 255; } if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) { return; @@ -1010,7 +1010,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, if (pCS) { FX_FLOAT R, G, B; FX_DWORD comps = 8; - if (pCS->CountComponents() > static_cast<FX_INT32>(comps)) { + if (pCS->CountComponents() > static_cast<int32_t>(comps)) { comps = (FX_DWORD)pCS->CountComponents(); } CFX_FixedBufGrow<FX_FLOAT, 8> float_array(comps); @@ -1026,7 +1026,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, pFloats[i] = pBC->GetNumber(i); } pCS->GetRGB(pFloats, R, G, B); - back_color = 0xff000000 | ((FX_INT32)(R * 255) << 16) | ((FX_INT32)(G * 255) << 8) | (FX_INT32)(B * 255); + back_color = 0xff000000 | ((int32_t)(R * 255) << 16) | ((int32_t)(G * 255) << 8) | (int32_t)(B * 255); m_pContext->m_pDocument->GetPageData()->ReleaseColorSpace(pCSObj); } } @@ -1053,7 +1053,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, int dest_pitch = pMask->GetPitch(); FX_LPBYTE src_buf = bitmap.GetBuffer(); int src_pitch = bitmap.GetPitch(); - FX_LPBYTE pTransfer = FX_Alloc(FX_BYTE, 256); + FX_LPBYTE pTransfer = FX_Alloc(uint8_t, 256); if (pFunc) { CFX_FixedBufGrow<FX_FLOAT, 16> results(pFunc->CountOutputs()); for (int i = 0; i < 256; i ++) { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index b1fd51ebe9..d45cc1151f 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -270,7 +270,7 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CP if (!pitch.IsValid()) { return FALSE; } - m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); + m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie()); if (m_pColorSpace && bStdCS) { m_pColorSpace->EnableStdConversion(TRUE); } @@ -282,7 +282,7 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CP if (!pitch.IsValid()) { return FALSE; } - m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); + m_pMaskedLine = FX_Alloc(uint8_t, pitch.ValueOrDie()); } m_Pitch = pitch.ValueOrDie(); if (ppMask) { @@ -314,7 +314,7 @@ int CPDF_DIBSource::ContinueToLoadMask() if (!pitch.IsValid()) { return 0; } - m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); + m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie()); if (m_pColorSpace && m_bStdCS) { m_pColorSpace->EnableStdConversion(TRUE); } @@ -326,7 +326,7 @@ int CPDF_DIBSource::ContinueToLoadMask() if (!pitch.IsValid()) { return 0; } - m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); + m_pMaskedLine = FX_Alloc(uint8_t, pitch.ValueOrDie()); } m_Pitch = pitch.ValueOrDie(); return 1; @@ -730,7 +730,7 @@ void CPDF_DIBSource::LoadJpxBitmap() return; } m_pCachedBitmap->Clear(0xFFFFFFFF); - context->set_output_offsets(FX_Alloc(unsigned char, output_nComps)); + context->set_output_offsets(FX_Alloc(uint8_t, output_nComps)); for (int i = 0; i < output_nComps; ++i) context->output_offsets()[i] = i; if (bSwapRGB) { @@ -1037,9 +1037,9 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_ R = NORMALCOLOR_MAX(R, 1); G = NORMALCOLOR_MAX(G, 1); B = NORMALCOLOR_MAX(B, 1); - dest_scan[dest_byte_pos] = (FX_INT32)(B * 255); - dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255); - dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255); + dest_scan[dest_byte_pos] = (int32_t)(B * 255); + dest_scan[dest_byte_pos + 1] = (int32_t)(G * 255); + dest_scan[dest_byte_pos + 2] = (int32_t)(R * 255); dest_byte_pos += 3; } } else { @@ -1063,9 +1063,9 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_ R = NORMALCOLOR_MAX(R, 1); G = NORMALCOLOR_MAX(G, 1); B = NORMALCOLOR_MAX(B, 1); - dest_scan[dest_byte_pos] = (FX_INT32)(B * 255); - dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255); - dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255); + dest_scan[dest_byte_pos] = (int32_t)(B * 255); + dest_scan[dest_byte_pos + 1] = (int32_t)(G * 255); + dest_scan[dest_byte_pos + 2] = (int32_t)(R * 255); dest_byte_pos += 3; } } @@ -1155,7 +1155,7 @@ FX_LPCBYTE CPDF_DIBSource::GetScanline(int line) const FX_LPBYTE pDestPixel = m_pMaskedLine; FX_LPCBYTE pSrcPixel = m_pLineBuf; for (int col = 0; col < m_Width; col ++) { - FX_BYTE index = *pSrcPixel++; + uint8_t index = *pSrcPixel++; if (m_pPalette) { *pDestPixel++ = FXARGB_B(m_pPalette[index]); *pDestPixel++ = FXARGB_G(m_pPalette[index]); @@ -1254,7 +1254,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ return; } - CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp); + CFX_FixedBufGrow<uint8_t, 128> temp(orig_Bpp); if (m_bpc * m_nComponents == 1) { FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0; if (m_bImageMask) { @@ -1302,7 +1302,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ int dest_pos = i * dest_Bpp; if (pSrcLine[src_x / 8] & (1 << (7 - src_x % 8))) { if (dest_Bpp == 1) { - dest_scan[dest_pos] = (FX_BYTE)set_argb; + dest_scan[dest_pos] = (uint8_t)set_argb; } else if (dest_Bpp == 3) { dest_scan[dest_pos] = FXARGB_B(set_argb); dest_scan[dest_pos + 1] = FXARGB_G(set_argb); @@ -1312,7 +1312,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ } } else { if (dest_Bpp == 1) { - dest_scan[dest_pos] = (FX_BYTE)reset_argb; + dest_scan[dest_pos] = (uint8_t)reset_argb; } else if (dest_Bpp == 3) { dest_scan[dest_pos] = FXARGB_B(reset_argb); dest_scan[dest_pos + 1] = FXARGB_G(reset_argb); @@ -1345,7 +1345,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ } src_x %= src_width; FX_LPBYTE pDestPixel = dest_scan + i * 4; - FX_BYTE index = pSrcLine[src_x]; + uint8_t index = pSrcLine[src_x]; if (m_pPalette) { *pDestPixel++ = FXARGB_B(m_pPalette[index]); *pDestPixel++ = FXARGB_G(m_pPalette[index]); @@ -1365,7 +1365,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ src_x = src_width - src_x - 1; } src_x %= src_width; - FX_BYTE index = pSrcLine[src_x]; + uint8_t index = pSrcLine[src_x]; if (dest_Bpp == 1) { dest_scan[i] = index; } else { @@ -1384,7 +1384,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1); for (int i = 0; i < clip_width; i ++) { int dest_x = clip_left + i; - FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * (FX_INT64)src_width / dest_width; + FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * (int64_t)src_width / dest_width; src_x %= src_width; FX_LPCBYTE pSrcPixel = NULL; if (m_bpc % 8 == 0) { @@ -1398,7 +1398,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ argb = last_argb; } else { if (m_pColorSpace) { - FX_BYTE color[4]; + uint8_t color[4]; if (!m_bDefaultDecode) { for (int i = 0; i < m_nComponents; i ++) { int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f); @@ -1412,7 +1412,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ src_bit_pos = 4; } for (FX_DWORD i = 0; i < m_nComponents; i ++) { - temp[i] = (FX_BYTE)(_GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc); + temp[i] = (uint8_t)(_GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc); src_bit_pos += m_bpc; } m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK); @@ -1473,7 +1473,7 @@ CPDF_ProgressiveImageLoaderHandle::CPDF_ProgressiveImageLoaderHandle() CPDF_ProgressiveImageLoaderHandle::~CPDF_ProgressiveImageLoaderHandle() { } -FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight) +FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) { m_pImageLoader = pImageLoader; m_pCache = pCache; @@ -1536,7 +1536,7 @@ FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCa } return FALSE; } -FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight) +FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) { m_nDownsampleWidth = nDownsampleWidth; m_nDownsampleHeight = nDownsampleHeight; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index f9eec23f7a..e02cd421ff 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -77,7 +77,7 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row; matrix.Transform(x, y); FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span), axis_len_square); - int index = (FX_INT32)(scale * (SHADING_STEPS - 1)); + int index = (int32_t)(scale * (SHADING_STEPS - 1)); if (index < 0) { if (!bStartExtend) { continue; @@ -205,7 +205,7 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2 continue; } } - int index = (FX_INT32)(s * (SHADING_STEPS - 1)); + int index = (int32_t)(s * (SHADING_STEPS - 1)); if (index < 0) { if (!bStartExtend) { continue; @@ -277,7 +277,7 @@ static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bi } FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; pCS->GetRGB(pResults, R, G, B); - dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255))); + dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE(alpha, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255))); } } } @@ -368,7 +368,7 @@ static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex trian R += r_unit; G += g_unit; B += b_unit; - FXARGB_SETDIB(dib_buf, FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255))); + FXARGB_SETDIB(dib_buf, FXARGB_MAKE(alpha, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255))); dib_buf += 4; } } @@ -746,9 +746,9 @@ static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_Aff for (i = iStartColor; i < 4; i ++) { FX_FLOAT r=0.0f, g=0.0f, b=0.0f; stream.GetColor(r, g, b); - patch.patch_colors[i].comp[0] = (FX_INT32)(r * 255); - patch.patch_colors[i].comp[1] = (FX_INT32)(g * 255); - patch.patch_colors[i].comp[2] = (FX_INT32)(b * 255); + patch.patch_colors[i].comp[0] = (int32_t)(r * 255); + patch.patch_colors[i].comp[1] = (int32_t)(g * 255); + patch.patch_colors[i].comp[2] = (int32_t)(b * 255); } CFX_FloatRect bbox = CFX_FloatRect::GetBBox(coords, point_count); if (bbox.right <= 0 || bbox.left >= (FX_FLOAT)pBitmap->GetWidth() || bbox.top <= 0 || @@ -787,7 +787,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMat } FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; pColorSpace->GetRGB(comps, R, G, B); - background = ArgbEncode(255, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255)); + background = ArgbEncode(255, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255)); } } if (pDict->KeyExist(FX_BSTRC("BBox"))) { @@ -939,8 +939,8 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag CFX_Matrix dCTM = m_pDevice->GetCTM(); FX_FLOAT sa = FXSYS_fabs(dCTM.a); FX_FLOAT sd = FXSYS_fabs(dCTM.d); - clip_box.right = clip_box.left + (FX_INT32)FXSYS_ceil(clip_box.Width() * sa); - clip_box.bottom = clip_box.top + (FX_INT32)FXSYS_ceil(clip_box.Height() * sd); + clip_box.right = clip_box.left + (int32_t)FXSYS_ceil(clip_box.Width() * sa); + clip_box.bottom = clip_box.top + (int32_t)FXSYS_ceil(clip_box.Height() * sd); CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form; mtPattern2Device.Concat(*pObj2Device); GetScaledMatrix(mtPattern2Device); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index 09843c9c62..410e78a67b 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -33,11 +33,11 @@ CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(FX_DWORD charcode, const CFX_AffineM m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache); } CFX_GlyphBitmap* pGlyphBitmap; - if(pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (void*&)pGlyphBitmap)) { + if(pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)charcode, (void*&)pGlyphBitmap)) { return pGlyphBitmap; } pGlyphBitmap = RenderGlyph(pSizeCache, charcode, pMatrix, retinaScaleX, retinaScaleY); - pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pGlyphBitmap); + pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)charcode, pGlyphBitmap); return pGlyphBitmap; } CPDF_Type3Glyphs::~CPDF_Type3Glyphs() @@ -512,7 +512,7 @@ public: FXTEXT_CHARPOS* m_pCharPos; FX_DWORD m_nChars; }; -FX_FLOAT _CIDTransformToFloat(FX_BYTE ch); +FX_FLOAT _CIDTransformToFloat(uint8_t ch); CPDF_CharPosList::CPDF_CharPosList() { m_pCharPos = NULL; @@ -531,7 +531,7 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting(); for (int iChar = 0; iChar < nChars; iChar ++) { - FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pCharCodes : pCharCodes[iChar]; + FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(uintptr_t)pCharCodes : pCharCodes[iChar]; if (CharCode == (FX_DWORD) - 1) { continue; } @@ -614,7 +614,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origi FX_FLOAT* pCharPos; if (nChars == 1) { charcode = pFont->GetNextChar(str, str.GetLength(), offset); - pCharCodes = (FX_DWORD*)(FX_UINTPTR)charcode; + pCharCodes = (FX_DWORD*)(uintptr_t)charcode; pCharPos = NULL; } else { pCharCodes = FX_Alloc(FX_DWORD, nChars); diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h index 529128e8f9..0b6873409b 100644 --- a/core/src/fpdfapi/fpdf_render/render_int.h +++ b/core/src/fpdfapi/fpdf_render/render_int.h @@ -46,7 +46,7 @@ class CPDF_TransferFunc { public: CPDF_Document* m_pPDFDoc; - FX_BYTE m_Samples[256 * 3]; + uint8_t m_Samples[256 * 3]; FX_BOOL m_bIdentity; CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc); @@ -197,7 +197,7 @@ public: FX_BOOL Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL); - FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0); + FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); FX_BOOL Continue(FX_LPVOID LoadHandle, IFX_Pause* pPause); ~CPDF_ImageLoader(); CFX_DIBSource* m_pBitmap; @@ -205,8 +205,8 @@ public: FX_DWORD m_MatteColor; FX_BOOL m_bCached; protected: - FX_INT32 m_nDownsampleWidth; - FX_INT32 m_nDownsampleHeight; + int32_t m_nDownsampleWidth; + int32_t m_nDownsampleHeight; }; class CPDF_ProgressiveImageLoaderHandle { @@ -214,14 +214,14 @@ public: CPDF_ProgressiveImageLoaderHandle(); ~CPDF_ProgressiveImageLoaderHandle(); - FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0); + FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); FX_BOOL Continue(IFX_Pause* pPause); protected: CPDF_ImageLoader* m_pImageLoader; CPDF_PageRenderCache* m_pCache; CPDF_ImageObject* m_pImage; - FX_INT32 m_nDownsampleWidth; - FX_INT32 m_nDownsampleHeight; + int32_t m_nDownsampleWidth; + int32_t m_nDownsampleHeight; }; class CFX_ImageTransformer; class CPDF_ImageRenderer : public IPDF_ObjectRenderer @@ -336,7 +336,7 @@ public: void Reset(const CFX_DIBitmap* pBitmap); FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, - CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); FX_DWORD EstimateSize() const { return m_dwCacheSize; @@ -357,7 +357,7 @@ public: public: int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, - FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); int Continue(IFX_Pause* pPause); int ContinueGetCachedBitmap(); CFX_DIBSource* DetachBitmap(); diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp index ac40335a4c..e98d3af9e7 100644 --- a/core/src/fpdfdoc/doc_action.cpp +++ b/core/src/fpdfdoc/doc_action.cpp @@ -218,7 +218,7 @@ CPDF_Dictionary* CPDF_Action::GetAnnot() const } return NULL; } -FX_INT32 CPDF_Action::GetOperationType() const +int32_t CPDF_Action::GetOperationType() const { if (m_pDict == NULL) { return 0; diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp index 908333c0f6..ef6c34701b 100644 --- a/core/src/fpdfdoc/doc_annot.cpp +++ b/core/src/fpdfdoc/doc_annot.cpp @@ -332,9 +332,9 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* p CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); FX_DWORD argb = 0xff000000; if (pColor != NULL) { - int R = (FX_INT32)(pColor->GetNumber(0) * 255); - int G = (FX_INT32)(pColor->GetNumber(1) * 255); - int B = (FX_INT32)(pColor->GetNumber(2) * 255); + int R = (int32_t)(pColor->GetNumber(0) * 255); + int G = (int32_t)(pColor->GetNumber(1) * 255); + int B = (int32_t)(pColor->GetNumber(2) * 255); argb = ArgbEncode(0xff, R, G, B); } CPDF_GraphStateData graph_state; diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index 8a195a747d..d11b78b399 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -42,8 +42,8 @@ public: CPVT_FontMap(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * pDefFont, const CFX_ByteString & sDefFontAlias); virtual ~CPVT_FontMap(); - CPDF_Font* GetPDFFont(FX_INT32 nFontIndex); - CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex); + CPDF_Font* GetPDFFont(int32_t nFontIndex); + CFX_ByteString GetPDFFontAlias(int32_t nFontIndex); static void GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * & pSysFont, CFX_ByteString & sSysFontAlias); private: @@ -84,7 +84,7 @@ void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pR } } } -CPDF_Font* CPVT_FontMap::GetPDFFont(FX_INT32 nFontIndex) +CPDF_Font* CPVT_FontMap::GetPDFFont(int32_t nFontIndex) { switch (nFontIndex) { case 0: @@ -97,7 +97,7 @@ CPDF_Font* CPVT_FontMap::GetPDFFont(FX_INT32 nFontIndex) } return NULL; } -CFX_ByteString CPVT_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex) +CFX_ByteString CPVT_FontMap::GetPDFFontAlias(int32_t nFontIndex) { switch (nFontIndex) { case 0: @@ -117,7 +117,7 @@ CPVT_Provider::CPVT_Provider(IPVT_FontMap * pFontMap) : m_pFontMap(pFontMap) CPVT_Provider::~CPVT_Provider() { } -FX_INT32 CPVT_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) +int32_t CPVT_Provider::GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word); @@ -127,21 +127,21 @@ FX_INT32 CPVT_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 } return 0; } -FX_INT32 CPVT_Provider::GetTypeAscent(FX_INT32 nFontIndex) +int32_t CPVT_Provider::GetTypeAscent(int32_t nFontIndex) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { return pPDFFont->GetTypeAscent(); } return 0; } -FX_INT32 CPVT_Provider::GetTypeDescent(FX_INT32 nFontIndex) +int32_t CPVT_Provider::GetTypeDescent(int32_t nFontIndex) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { return pPDFFont->GetTypeDescent(); } return 0; } -FX_INT32 CPVT_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) +int32_t CPVT_Provider::GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) { if (CPDF_Font* pDefFont = m_pFontMap->GetPDFFont(0)) { if (pDefFont->CharCodeFromUnicode(word) != -1) { @@ -161,11 +161,11 @@ FX_BOOL CPVT_Provider::IsLatinWord(FX_WORD word) } return FALSE; } -FX_INT32 CPVT_Provider::GetDefaultFontIndex() +int32_t CPVT_Provider::GetDefaultFontIndex() { return 0; } -static CFX_ByteString GetPDFWordString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord) +static CFX_ByteString GetPDFWordString(IPVT_FontMap * pFontMap, int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord) { CFX_ByteString sWord; if (SubWord > 0) { @@ -193,7 +193,7 @@ static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords) } return ""; } -static CFX_ByteString GetFontSetString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize) +static CFX_ByteString GetFontSetString(IPVT_FontMap * pFontMap, int32_t nFontIndex, FX_FLOAT fFontSize) { CFX_ByteTextBuf sRet; if (pFontMap) { @@ -244,7 +244,7 @@ static CPVT_Color ParseColor(const CPDF_Array & array) } return rt; } -static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const FX_INT32 & nWidgetType) +static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t & nWidgetType) { CPDF_Dictionary* pFormDict = NULL; if (CPDF_Dictionary * pRootDict = pDoc->GetRoot()) { @@ -310,7 +310,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict return FALSE; } CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect"); - FX_INT32 nRotate = 0; + int32_t nRotate = 0; if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) { nRotate = pMKDict->GetInteger("R"); } @@ -333,7 +333,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, rcAnnot.right - rcAnnot.left); break; } - FX_INT32 nBorderStyle = PBS_SOLID; + int32_t nBorderStyle = PBS_SOLID; FX_FLOAT fBorderWidth = 1; CPVT_Dash dsBorder(3, 0, 0); CPVT_Color crLeftTop, crRightBottom; @@ -405,7 +405,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict if (pNormalStream == NULL) { return FALSE; } - FX_INT32 objnum = pDoc->AddIndirectObject(pNormalStream); + int32_t objnum = pDoc->AddIndirectObject(pNormalStream); pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum); } CPDF_Dictionary * pStreamDict = pNormalStream->GetDict(); @@ -433,7 +433,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict switch (nWidgetType) { case 0: { CFX_WideString swValue = FPDF_GetFieldAttr(pAnnotDict, "V")? FPDF_GetFieldAttr(pAnnotDict, "V")->GetUnicodeText() : CFX_WideString(); - FX_INT32 nAlign = FPDF_GetFieldAttr(pAnnotDict, "Q")? FPDF_GetFieldAttr(pAnnotDict, "Q")->GetInteger() : 0; + int32_t nAlign = FPDF_GetFieldAttr(pAnnotDict, "Q")? FPDF_GetFieldAttr(pAnnotDict, "Q")->GetInteger() : 0; FX_DWORD dwFlags = FPDF_GetFieldAttr(pAnnotDict, "Ff")? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() : 0; FX_DWORD dwMaxLen = FPDF_GetFieldAttr(pAnnotDict, "MaxLen") ? FPDF_GetFieldAttr(pAnnotDict, "MaxLen")->GetInteger() : 0; CPVT_FontMap map(pDoc, pStreamDict ? pStreamDict->GetDict("Resources") : NULL , pDefFont, sFontName.Right(sFontName.GetLength() - 1)); @@ -540,11 +540,11 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict CPVT_Provider prd(&map); CPDF_Array * pOpts = FPDF_GetFieldAttr(pAnnotDict, "Opt") ? FPDF_GetFieldAttr(pAnnotDict, "Opt")->GetArray() : NULL; CPDF_Array * pSels = FPDF_GetFieldAttr(pAnnotDict, "I") ? FPDF_GetFieldAttr(pAnnotDict, "I")->GetArray() : NULL; - FX_INT32 nTop = FPDF_GetFieldAttr(pAnnotDict, "TI") ? FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger() : 0; + int32_t nTop = FPDF_GetFieldAttr(pAnnotDict, "TI") ? FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger() : 0; CFX_ByteTextBuf sBody; if (pOpts) { FX_FLOAT fy = rcBody.top; - for (FX_INT32 i = nTop, sz = pOpts->GetCount(); i < sz; i++) { + for (int32_t i = nTop, sz = pOpts->GetCount(); i < sz; i++) { if (IsFloatSmaller(fy, rcBody.bottom)) { break; } @@ -598,7 +598,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict break; } if (pNormalStream) { - pNormalStream->SetData((FX_BYTE*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE); + pNormalStream->SetData((uint8_t*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE); pStreamDict = pNormalStream->GetDict(); if (pStreamDict) { pStreamDict->SetAtMatrix("Matrix", matrix); @@ -640,7 +640,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_Var { CFX_ByteTextBuf sEditStream, sLineStream, sWords; CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); - FX_INT32 nCurFontIndex = -1; + int32_t nCurFontIndex = -1; if (pIterator) { if (pVisible) { pIterator->SetAt(pVisible->BeginPos); @@ -713,7 +713,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_Var } CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth, const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom, - FX_INT32 nStyle, const CPVT_Dash & dash) + int32_t nStyle, const CPVT_Dash & dash) { CFX_ByteTextBuf sAppStream; CFX_ByteString sColor; diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp index 48f3ccae98..dfa2e6718a 100644 --- a/core/src/fpdfdoc/doc_basic.cpp +++ b/core/src/fpdfdoc/doc_basic.cpp @@ -103,7 +103,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, const CFX_ByteString& FX_DWORD dwCount = pNames->GetCount() / 2; for (FX_DWORD i = 0; i < dwCount; i ++) { CFX_ByteString csValue = pNames->GetString(i * 2); - FX_INT32 iCompare = csValue.Compare(csName); + int32_t iCompare = csValue.Compare(csName); if (iCompare <= 0) { if (ppFind != NULL) { *ppFind = pNames; @@ -405,7 +405,7 @@ CPDF_Stream* CPDF_FileSpec::GetFileStream() const if (m_pObj == NULL) { return NULL; } - FX_INT32 iType = m_pObj->GetType(); + int32_t iType = m_pObj->GetType(); if (iType == PDFOBJ_STREAM) { return (CPDF_Stream*)m_pObj; } else if (iType == PDFOBJ_DICTIONARY) { @@ -426,7 +426,7 @@ static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, FX_WSTR wsFileName, } else { wsStr = FILESPEC_EncodeFileName(wsFileName); } - FX_INT32 iType = pObj->GetType(); + int32_t iType = pObj->GetType(); if (iType == PDFOBJ_STRING) { pObj->SetString(CFX_ByteString::FromUnicode(wsStr)); } else if (iType == PDFOBJ_DICTIONARY) { @@ -540,7 +540,7 @@ CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const wsLabel.Format(L"%d", nPage + 1); return wsLabel; } -FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const +int32_t CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const { if (m_pDocument == NULL) { return -1; @@ -565,7 +565,7 @@ FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const } return -1; } -FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_WSTR wsLabel) const +int32_t CPDF_PageLabel::GetPageByLabel(FX_WSTR wsLabel) const { CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); return GetPageByLabel(bsLabel); diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp index dff6039bc8..0fbbd1d38f 100644 --- a/core/src/fpdfdoc/doc_form.cpp +++ b/core/src/fpdfdoc/doc_form.cpp @@ -376,7 +376,7 @@ static FX_BOOL RetrieveSpecificFont(LOGFONTA& lf) } return fd.bFind; } -static FX_BOOL RetrieveSpecificFont(FX_BYTE charSet, FX_BYTE pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf) +static FX_BOOL RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf) { memset(&lf, 0, sizeof(LOGFONTA)); lf.lfCharSet = charSet; @@ -386,7 +386,7 @@ static FX_BOOL RetrieveSpecificFont(FX_BYTE charSet, FX_BYTE pitchAndFamily, LPC } return RetrieveSpecificFont(lf); } -static FX_BOOL RetrieveStockFont(int iFontObject, FX_BYTE charSet, LOGFONTA& lf) +static FX_BOOL RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf) { HFONT hFont = (HFONT)::GetStockObject(iFontObject); if (hFont != NULL) { @@ -418,7 +418,7 @@ CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument) #endif return pFont; } -CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet) +CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, uint8_t iCharSet) { if (pDocument == NULL || csFontName.IsEmpty()) { return NULL; @@ -440,7 +440,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Byt #endif return NULL; } -CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet) +CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, uint8_t iCharSet) { if (pDocument == NULL || csFontName.IsEmpty()) { return NULL; @@ -476,7 +476,7 @@ CPDF_Font* CPDF_InterForm::AddStandardFont(const CPDF_Document* pDocument, CFX_B } return pFont; } -CFX_ByteString CPDF_InterForm::GetNativeFont(FX_BYTE charSet, FX_LPVOID pLogFont) +CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, FX_LPVOID pLogFont) { CFX_ByteString csFontName; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ @@ -516,16 +516,16 @@ CFX_ByteString CPDF_InterForm::GetNativeFont(FX_BYTE charSet, FX_LPVOID pLogFont CFX_ByteString CPDF_InterForm::GetNativeFont(FX_LPVOID pLogFont) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - FX_BYTE charSet = GetNativeCharSet(); + uint8_t charSet = GetNativeCharSet(); return GetNativeFont(charSet, pLogFont); #else return CFX_ByteString(); #endif } -FX_BYTE CPDF_InterForm::GetNativeCharSet() +uint8_t CPDF_InterForm::GetNativeCharSet() { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - FX_BYTE charSet = ANSI_CHARSET; + uint8_t charSet = ANSI_CHARSET; UINT iCodePage = ::GetACP(); switch (iCodePage) { case 932: @@ -582,7 +582,7 @@ FX_BYTE CPDF_InterForm::GetNativeCharSet() return 0; #endif } -CPDF_Font* CPDF_InterForm::AddNativeFont(FX_BYTE charSet, const CPDF_Document* pDocument) +CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, const CPDF_Document* pDocument) { if (pDocument == NULL) { return NULL; @@ -607,7 +607,7 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument) return NULL; } CPDF_Font* pFont = NULL; - FX_BYTE charSet = GetNativeCharSet(); + uint8_t charSet = GetNativeCharSet(); pFont = AddNativeFont(charSet, pDocument); return pFont; } @@ -1086,7 +1086,7 @@ CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csFontName, CFX_ByteString { return GetInterFormFont(m_pFormDict, m_pDocument, csFontName, csNameTag); } -CPDF_Font* CPDF_InterForm::GetNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag) +CPDF_Font* CPDF_InterForm::GetNativeFormFont(uint8_t charSet, CFX_ByteString& csNameTag) { return GetNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag); } @@ -1107,7 +1107,7 @@ void CPDF_InterForm::AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameT AddInterFormFont(m_pFormDict, m_pDocument, pFont, csNameTag); m_bUpdated = TRUE; } -CPDF_Font* CPDF_InterForm::AddNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag) +CPDF_Font* CPDF_InterForm::AddNativeFormFont(uint8_t charSet, CFX_ByteString& csNameTag) { m_bUpdated = TRUE; return AddNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag); @@ -1369,7 +1369,7 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, if (pField == NULL) { continue; } - FX_INT32 iType = pField->GetType(); + int32_t iType = pField->GetType(); if (iType == CPDF_FormField::PushButton || iType == CPDF_FormField::CheckBox || iType == CPDF_FormField::ListBox) { continue; } @@ -1472,7 +1472,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& field } const struct _SupportFieldEncoding { FX_LPCSTR m_name; - FX_INT32 m_codePage; + int32_t m_codePage; } g_fieldEncoding[] = { { "BigFive", 950 }, { "GBK", 936 }, @@ -1483,8 +1483,8 @@ static void FPDFDOC_FDF_GetFieldValue(CPDF_Dictionary *pFieldDict, CFX_WideStrin { ASSERT(pFieldDict != NULL); CFX_ByteString csBValue = pFieldDict->GetString("V"); - FX_INT32 iCount = sizeof(g_fieldEncoding) / sizeof(g_fieldEncoding[0]); - FX_INT32 i = 0; + int32_t iCount = sizeof(g_fieldEncoding) / sizeof(g_fieldEncoding[0]); + int32_t i = 0; for (; i < iCount; ++i) if (bsEncoding == g_fieldEncoding[i].m_name) { break; diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp index 2f770d7d00..71be0c36ab 100644 --- a/core/src/fpdfdoc/doc_link.cpp +++ b/core/src/fpdfdoc/doc_link.cpp @@ -23,12 +23,12 @@ CFX_PtrArray* CPDF_LinkList::GetPageLinks(CPDF_Page* pPage) return NULL; } CFX_PtrArray* pPageLinkList = NULL; - if (!m_PageMap.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pPageLinkList)) { + if (!m_PageMap.Lookup((FX_LPVOID)(uintptr_t)objnum, (FX_LPVOID&)pPageLinkList)) { pPageLinkList = FX_NEW CFX_PtrArray; if (pPageLinkList == NULL) { return NULL; } - m_PageMap.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pPageLinkList); + m_PageMap.SetAt((FX_LPVOID)(uintptr_t)objnum, pPageLinkList); LoadPageLinks(pPage, pPageLinkList); } return pPageLinkList; diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp index 232f6eea21..677d0e91af 100644 --- a/core/src/fpdfdoc/doc_metadata.cpp +++ b/core/src/fpdfdoc/doc_metadata.cpp @@ -74,7 +74,7 @@ void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc) pElmntRdf = pXmlElmnt->GetElement(NULL, FX_BSTRC("RDF")); } } -FX_INT32 CPDF_Metadata::GetString(FX_BSTR bsItem, CFX_WideString &wsStr) +int32_t CPDF_Metadata::GetString(FX_BSTR bsItem, CFX_WideString &wsStr) { if (!((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt) { return -1; diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp index 0ca9fc0313..c2f77a58fa 100644 --- a/core/src/fpdfdoc/doc_ocg.cpp +++ b/core/src/fpdfdoc/doc_ocg.cpp @@ -5,12 +5,12 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fpdfdoc/fpdf_doc.h" -static FX_INT32 FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dictionary *pGroupDict) +static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dictionary *pGroupDict) { if (pObject == NULL || pGroupDict == NULL) { return -1; } - FX_INT32 iType = pObject->GetType(); + int32_t iType = pObject->GetType(); if (iType == PDFOBJ_ARRAY) { FX_DWORD dwCount = ((CPDF_Array*)pObject)->GetCount(); for (FX_DWORD i = 0; i < dwCount; i++) { @@ -64,8 +64,8 @@ static CPDF_Dictionary* FPDFDOC_OCG_GetConfig(CPDF_Document *pDoc, const CPDF_Di CPDF_Array *pConfigs = pOCProperties->GetArray(FX_BSTRC("Configs")); if (pConfigs) { CPDF_Dictionary *pFind; - FX_INT32 iCount = pConfigs->GetCount(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pConfigs->GetCount(); + for (int32_t i = 0; i < iCount; i ++) { pFind = pConfigs->GetDict(i); if (!pFind) { continue; @@ -124,8 +124,8 @@ FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(FX_BSTR csConfig, const CPDF_Dict pArray = pConfig->GetArray(FX_BSTRC("AS")); if (pArray) { CFX_ByteString csFind = csConfig + FX_BSTRC("State"); - FX_INT32 iCount = pArray->GetCount(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pArray->GetCount(); + for (int32_t i = 0; i < iCount; i ++) { CPDF_Dictionary *pUsage = pArray->GetDict(i); if (!pUsage) { continue; @@ -181,11 +181,11 @@ FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict) } FX_LPVOID bState = NULL; if (m_OCGStates.Lookup(pOCGDict, bState)) { - return (FX_UINTPTR)bState != 0; + return (uintptr_t)bState != 0; } - bState = (FX_LPVOID)(FX_UINTPTR)LoadOCGState(pOCGDict); + bState = (FX_LPVOID)(uintptr_t)LoadOCGState(pOCGDict); m_OCGStates.SetAt(pOCGDict, bState); - return (FX_UINTPTR)bState != 0; + return (uintptr_t)bState != 0; } FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel) { @@ -195,7 +195,7 @@ FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, i if (pExpression == NULL) { return FALSE; } - FX_INT32 iCount = pExpression->GetCount(); + int32_t iCount = pExpression->GetCount(); CPDF_Object *pOCGObj; CFX_ByteString csOperator = pExpression->GetString(0); if (csOperator == FX_BSTRC("Not")) { @@ -213,7 +213,7 @@ FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, i } if (csOperator == FX_BSTRC("Or") || csOperator == FX_BSTRC("And")) { FX_BOOL bValue = FALSE; - for (FX_INT32 i = 1; i < iCount; i ++) { + for (int32_t i = 1; i < iCount; i ++) { pOCGObj = pExpression->GetElementValue(1); if (pOCGObj == NULL) { continue; @@ -260,8 +260,8 @@ FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL if (csP == FX_BSTRC("AllOn") || csP == FX_BSTRC("AllOff")) { bState = TRUE; } - FX_INT32 iCount = ((CPDF_Array*)pOCGObj)->GetCount(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = ((CPDF_Array*)pOCGObj)->GetCount(); + for (int32_t i = 0; i < iCount; i ++) { FX_BOOL bItem = TRUE; CPDF_Dictionary* pItemDict = ((CPDF_Array*)pOCGObj)->GetDict(i); if (pItemDict) { diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp index 35e001ea69..df393b2f77 100644 --- a/core/src/fpdfdoc/doc_utils.cpp +++ b/core/src/fpdfdoc/doc_utils.cpp @@ -245,7 +245,7 @@ void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) if (!pFormDict->KeyExist("DR")) { CPDF_Font* pFont = NULL; CFX_ByteString csBaseName, csDefault; - FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet(); + uint8_t charSet = CPDF_InterForm::GetNativeCharSet(); pFont = CPDF_InterForm::AddStandardFont(pDocument, "Helvetica"); if (pFont != NULL) { AddInterFormFont(pFormDict, pDocument, pFont, csBaseName); @@ -409,7 +409,7 @@ CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument } return NULL; } -CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag) +CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag) { if (pFormDict == NULL) { return NULL; @@ -456,7 +456,7 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDo CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag) { csNameTag = ""; - FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet(); + uint8_t charSet = CPDF_InterForm::GetNativeCharSet(); CFX_SubstFont* pSubst; CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument); if (pFont != NULL) { @@ -586,7 +586,7 @@ void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, con csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag); pFonts->SetAtReference(csNameTag, pDocument, pFont->GetFontDict()); } -CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag) +CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag) { if (pFormDict == NULL) { InitInterFormDict(pFormDict, pDocument); @@ -611,7 +611,7 @@ CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pD } CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag) { - FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet(); + uint8_t charSet = CPDF_InterForm::GetNativeCharSet(); return AddNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag); } void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont) diff --git a/core/src/fpdfdoc/doc_utils.h b/core/src/fpdfdoc/doc_utils.h index 08c4e7e552..6bb1d30dbb 100644 --- a/core/src/fpdfdoc/doc_utils.h +++ b/core/src/fpdfdoc/doc_utils.h @@ -13,12 +13,12 @@ FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict); CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag); CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag); CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag); -CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag); +CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag); CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag); FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag); FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag); -CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag); +CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag); CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag); void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont); void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag); diff --git a/core/src/fpdfdoc/doc_viewerPreferences.cpp b/core/src/fpdfdoc/doc_viewerPreferences.cpp index f68d3fbdc7..7ec325cfb4 100644 --- a/core/src/fpdfdoc/doc_viewerPreferences.cpp +++ b/core/src/fpdfdoc/doc_viewerPreferences.cpp @@ -29,7 +29,7 @@ FX_BOOL CPDF_ViewerPreferences::PrintScaling() const } return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); } -FX_INT32 CPDF_ViewerPreferences::NumCopies() const +int32_t CPDF_ViewerPreferences::NumCopies() const { CPDF_Dictionary *pDict = m_pDoc->GetRoot(); pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp index fd3f5bafd1..7ed5b4ad3c 100644 --- a/core/src/fpdfdoc/doc_vt.cpp +++ b/core/src/fpdfdoc/doc_vt.cpp @@ -7,7 +7,7 @@ #include "../../include/fpdfdoc/fpdf_doc.h" #include "../../include/fpdfdoc/fpdf_vt.h" #include "pdf_vt.h" -const FX_BYTE gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144}; +const uint8_t gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144}; #define PVT_RETURN_LENGTH 1 #define PVT_DEFAULT_FONTSIZE 18.0f #define PVTWORD_SCRIPT_NORMAL 0 @@ -62,14 +62,14 @@ void CSection::ResetLineArray() } void CSection::ResetWordArray() { - for (FX_INT32 i = 0, sz = m_WordArray.GetSize(); i < sz; i++) { + for (int32_t i = 0, sz = m_WordArray.GetSize(); i < sz; i++) { delete m_WordArray.GetAt(i); } m_WordArray.RemoveAll(); } void CSection::ResetLinePlace() { - for (FX_INT32 i = 0, sz = m_LineArray.GetSize(); i < sz; i++) { + for (int32_t i = 0, sz = m_LineArray.GetSize(); i < sz; i++) { if (CLine * pLine = m_LineArray.GetAt(i)) { pLine->LinePlace = CPVT_WordPlace(SecPlace.nSecIndex, i, -1); } @@ -78,7 +78,7 @@ void CSection::ResetLinePlace() CPVT_WordPlace CSection::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo) { if (CPVT_WordInfo * pWord = FX_NEW CPVT_WordInfo(wordinfo)) { - FX_INT32 nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, this->m_WordArray.GetSize()), 0); + int32_t nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, this->m_WordArray.GetSize()), 0); if (nWordIndex == m_WordArray.GetSize()) { m_WordArray.Add(pWord); } else { @@ -162,9 +162,9 @@ CPVT_WordPlace CSection::GetNextWordPlace(const CPVT_WordPlace & place) const } void CSection::UpdateWordPlace(CPVT_WordPlace & place) const { - FX_INT32 nLeft = 0; - FX_INT32 nRight = m_LineArray.GetSize() - 1; - FX_INT32 nMid = (nLeft + nRight) / 2; + int32_t nLeft = 0; + int32_t nRight = m_LineArray.GetSize() - 1; + int32_t nMid = (nLeft + nRight) / 2; while (nLeft <= nRight) { if (CLine * pLine = m_LineArray.GetAt(nMid)) { if (place.nWordIndex < pLine->m_LineInfo.nBeginWordIndex) { @@ -188,9 +188,9 @@ CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const CPVT_WordPlace place = GetBeginWordPlace(); FX_BOOL bUp = TRUE; FX_BOOL bDown = TRUE; - FX_INT32 nLeft = 0; - FX_INT32 nRight = m_LineArray.GetSize() - 1; - FX_INT32 nMid = m_LineArray.GetSize() / 2; + int32_t nLeft = 0; + int32_t nRight = m_LineArray.GetSize() - 1; + int32_t nMid = m_LineArray.GetSize() / 2; FX_FLOAT fTop = 0; FX_FLOAT fBottom = 0; while (nLeft <= nRight) { @@ -243,9 +243,9 @@ CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & ran if (!m_pVT) { return wordplace; } - FX_INT32 nLeft = range.BeginPos.nWordIndex; - FX_INT32 nRight = range.EndPos.nWordIndex + 1; - FX_INT32 nMid = (nLeft + nRight) / 2; + int32_t nLeft = range.BeginPos.nWordIndex; + int32_t nRight = range.EndPos.nWordIndex + 1; + int32_t nMid = (nLeft + nRight) / 2; while (nLeft < nRight) { if (nMid == nLeft) { break; @@ -275,23 +275,23 @@ CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & ran } return wordplace; } -void CSection::ClearLeftWords(FX_INT32 nWordIndex) +void CSection::ClearLeftWords(int32_t nWordIndex) { - for (FX_INT32 i = nWordIndex; i >= 0; i--) { + for (int32_t i = nWordIndex; i >= 0; i--) { delete m_WordArray.GetAt(i); m_WordArray.RemoveAt(i); } } -void CSection::ClearRightWords(FX_INT32 nWordIndex) +void CSection::ClearRightWords(int32_t nWordIndex) { - for (FX_INT32 i = m_WordArray.GetSize() - 1; i > nWordIndex; i--) { + for (int32_t i = m_WordArray.GetSize() - 1; i > nWordIndex; i--) { delete m_WordArray.GetAt(i); m_WordArray.RemoveAt(i); } } -void CSection::ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex) +void CSection::ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex) { - for (FX_INT32 i = nEndIndex; i > nBeginIndex; i--) { + for (int32_t i = nEndIndex; i > nBeginIndex; i--) { delete m_WordArray.GetAt(i); m_WordArray.RemoveAt(i); } @@ -332,7 +332,7 @@ CPVT_FloatRect CTypeset::CharArray() m_rcRet.Default(); FX_FLOAT x = 0.0f, y = 0.0f; FX_FLOAT fNextWidth; - FX_INT32 nStart = 0; + int32_t nStart = 0; FX_FLOAT fNodeWidth = m_pVT->GetPlateWidth() / (m_pVT->m_nCharArray <= 0 ? 1 : m_pVT->m_nCharArray); if (CLine * pLine = m_pSection->m_LineArray.GetAt(0)) { x = 0.0f; @@ -352,7 +352,7 @@ CPVT_FloatRect CTypeset::CharArray() pLine->m_LineInfo.fLineX = fNodeWidth * nStart - fNodeWidth * PVT_HALF; break; } - for (FX_INT32 w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) { + for (int32_t w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) { if (w >= m_pVT->m_nCharArray) { break; } @@ -591,23 +591,23 @@ void CTypeset::SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize) { ASSERT(m_pVT != NULL); ASSERT(m_pSection != NULL); - FX_INT32 nLineHead = 0; - FX_INT32 nLineTail = 0; + int32_t nLineHead = 0; + int32_t nLineTail = 0; FX_FLOAT fMaxX = 0.0f, fMaxY = 0.0f; FX_FLOAT fLineWidth = 0.0f, fBackupLineWidth = 0.0f; FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f; FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f; - FX_INT32 nWordStartPos = 0; + int32_t nWordStartPos = 0; FX_BOOL bFullWord = FALSE; - FX_INT32 nLineFullWordIndex = 0; - FX_INT32 nCharIndex = 0; + int32_t nLineFullWordIndex = 0; + int32_t nCharIndex = 0; CPVT_LineInfo line; FX_FLOAT fWordWidth = 0; FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f); - FX_INT32 nTotalWords = m_pSection->m_WordArray.GetSize(); + int32_t nTotalWords = m_pSection->m_WordArray.GetSize(); FX_BOOL bOpened = FALSE; if (nTotalWords > 0) { - FX_INT32 i = 0; + int32_t i = 0; while (i < nTotalWords) { CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(i); CPVT_WordInfo* pOldWord = pWord; @@ -753,10 +753,10 @@ void CTypeset::OutputLines() fMaxX = fMinX + m_rcRet.Width(); fMinY = 0.0f; fMaxY = m_rcRet.Height(); - FX_INT32 nTotalLines = m_pSection->m_LineArray.GetSize(); + int32_t nTotalLines = m_pSection->m_LineArray.GetSize(); if (nTotalLines > 0) { m_pSection->m_SecInfo.nTotalLine = nTotalLines; - for (FX_INT32 l = 0; l < nTotalLines; l++) { + for (int32_t l = 0; l < nTotalLines; l++) { if (CLine * pLine = m_pSection->m_LineArray.GetAt(l)) { switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) { default: @@ -775,7 +775,7 @@ void CTypeset::OutputLines() fPosY += pLine->m_LineInfo.fLineAscent; pLine->m_LineInfo.fLineX = fPosX - fMinX; pLine->m_LineInfo.fLineY = fPosY - fMinY; - for (FX_INT32 w = pLine->m_LineInfo.nBeginWordIndex; w <= pLine->m_LineInfo.nEndWordIndex; w++) { + for (int32_t w = pLine->m_LineInfo.nBeginWordIndex; w <= pLine->m_LineInfo.nEndWordIndex; w++) { if (CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(w)) { pWord->fWordX = fPosX - fMinX; if (pWord->pWordProps) { @@ -855,10 +855,10 @@ void CPDF_VariableText::ResetAll() m_bInitial = FALSE; ResetSectionArray(); } -CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset, +CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps) { - FX_INT32 nTotlaWords = this->GetTotalWords(); + int32_t nTotlaWords = this->GetTotalWords(); if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) { return place; } @@ -874,7 +874,7 @@ CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WO return AddWord(newplace, CPVT_WordInfo(word, charset, -1, pNewProps)); } } else { - FX_INT32 nFontIndex = GetSubWord() > 0 ? GetDefaultFontIndex() : GetWordFontIndex(word, charset, GetDefaultFontIndex()); + int32_t nFontIndex = GetSubWord() > 0 ? GetDefaultFontIndex() : GetWordFontIndex(word, charset, GetDefaultFontIndex()); return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, NULL)); } return place; @@ -882,7 +882,7 @@ CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WO CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) { - FX_INT32 nTotlaWords = this->GetTotalWords(); + int32_t nTotlaWords = this->GetTotalWords(); if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) { return place; } @@ -909,7 +909,7 @@ CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, co AddSection(NewPlace, secinfo); newplace = NewPlace; if (CSection * pNewSection = m_SectionArray.GetAt(NewPlace.nSecIndex)) { - for (FX_INT32 w = wordplace.nWordIndex + 1, sz = pSection->m_WordArray.GetSize(); w < sz; w++) { + for (int32_t w = wordplace.nWordIndex + 1, sz = pSection->m_WordArray.GetSize(); w < sz; w++) { if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(w)) { NewPlace.nWordIndex++; pNewSection->AddWord(NewPlace, *pWord); @@ -920,12 +920,12 @@ CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, co } return newplace; } -CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset, +CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pProps) { CFX_WideString swText = text; CPVT_WordPlace wp = place; - for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) { + for (int32_t i = 0, sz = swText.GetLength(); i < sz; i++) { CPVT_WordPlace oldwp = wp; FX_WORD word = swText.GetAt(i); switch (word) { @@ -980,7 +980,7 @@ CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place) { return ClearLeftWord(AjustLineHeader(place, TRUE)); } -void CPDF_VariableText::SetText(FX_LPCWSTR text, FX_INT32 charset, const CPVT_SecProps * pSecProps, +void CPDF_VariableText::SetText(FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) { DeleteWords(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace())); @@ -998,8 +998,8 @@ void CPDF_VariableText::SetText(FX_LPCWSTR text, FX_INT32 charset, const CPVT_Se if (CSection * pSection = m_SectionArray.GetAt(0)) { pSection->m_SecInfo = secinfo; } - FX_INT32 nCharCount = 0; - for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) { + int32_t nCharCount = 0; + for (int32_t i = 0, sz = swText.GetLength(); i < sz; i++) { if (m_nLimitChar > 0 && nCharCount >= m_nLimitChar) { break; } @@ -1052,13 +1052,13 @@ void CPDF_VariableText::UpdateWordPlace(CPVT_WordPlace & place) const pSection->UpdateWordPlace(place); } } -FX_INT32 CPDF_VariableText::WordPlaceToWordIndex(const CPVT_WordPlace & place) const +int32_t CPDF_VariableText::WordPlaceToWordIndex(const CPVT_WordPlace & place) const { CPVT_WordPlace newplace = place; UpdateWordPlace(newplace); - FX_INT32 nIndex = 0; - FX_INT32 i = 0; - FX_INT32 sz = 0; + int32_t nIndex = 0; + int32_t i = 0; + int32_t sz = 0; for (i = 0, sz = m_SectionArray.GetSize(); i < sz && i < newplace.nSecIndex; i++) { if (CSection * pSection = m_SectionArray.GetAt(i)) { nIndex += pSection->m_WordArray.GetSize(); @@ -1072,12 +1072,12 @@ FX_INT32 CPDF_VariableText::WordPlaceToWordIndex(const CPVT_WordPlace & place) c } return nIndex; } -CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(FX_INT32 index) const +CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(int32_t index) const { CPVT_WordPlace place = GetBeginWordPlace(); - FX_INT32 nOldIndex = 0 , nIndex = 0; + int32_t nOldIndex = 0 , nIndex = 0; FX_BOOL bFind = FALSE; - for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) { + for (int32_t i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) { if (CSection * pSection = m_SectionArray.GetAt(i)) { nIndex += pSection->m_WordArray.GetSize(); if (nIndex == index) { @@ -1159,9 +1159,9 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace(const CPDF_Point & point) cons { CPDF_Point pt = OutToIn(point); CPVT_WordPlace place = GetBeginWordPlace(); - FX_INT32 nLeft = 0; - FX_INT32 nRight = m_SectionArray.GetSize() - 1; - FX_INT32 nMid = m_SectionArray.GetSize() / 2; + int32_t nLeft = 0; + int32_t nRight = m_SectionArray.GetSize() - 1; + int32_t nMid = m_SectionArray.GetSize() / 2; FX_BOOL bUp = TRUE; FX_BOOL bDown = TRUE; while (nLeft <= nRight) { @@ -1258,10 +1258,10 @@ CPVT_WordPlace CPDF_VariableText::GetSectionEndPlace(const CPVT_WordPlace & plac } return place; } -FX_INT32 CPDF_VariableText::GetTotalWords() const +int32_t CPDF_VariableText::GetTotalWords() const { - FX_INT32 nTotal = 0; - for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) + int32_t nTotal = 0; + for (int32_t i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) if (CSection * pSection = m_SectionArray.GetAt(i)) { nTotal += (pSection->m_WordArray.GetSize() + PVT_RETURN_LENGTH); } @@ -1269,7 +1269,7 @@ FX_INT32 CPDF_VariableText::GetTotalWords() const } void CPDF_VariableText::ResetSectionArray() { - for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { + for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { delete m_SectionArray.GetAt(s); } m_SectionArray.RemoveAll(); @@ -1279,11 +1279,8 @@ CPVT_WordPlace CPDF_VariableText::AddSection(const CPVT_WordPlace & place, const if (IsValid() && !m_bMultiLine) { return place; } - FX_INT32 nSecIndex = FPDF_MAX(FPDF_MIN(place.nSecIndex, m_SectionArray.GetSize()), 0); - CSection * pSection = FX_NEW CSection(this); - if (!pSection) { - return place; - } + int32_t nSecIndex = FPDF_MAX(FPDF_MIN(place.nSecIndex, m_SectionArray.GetSize()), 0); + CSection* pSection = new CSection(this); pSection->m_SecInfo = secinfo; pSection->SecPlace.nSecIndex = nSecIndex; if (nSecIndex == m_SectionArray.GetSize()) { @@ -1361,13 +1358,13 @@ FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_B { return m_bRichText && WordInfo.pWordProps ? (WordInfo.pWordProps->nScriptType == PVTWORD_SCRIPT_NORMAL || bFactFontSize ? WordInfo.pWordProps->fFontSize : WordInfo.pWordProps->fFontSize * PVT_HALF) : GetFontSize(); } -FX_INT32 CPDF_VariableText::GetWordFontIndex(const CPVT_WordInfo & WordInfo) +int32_t CPDF_VariableText::GetWordFontIndex(const CPVT_WordInfo & WordInfo) { return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nFontIndex : WordInfo.nFontIndex; } -FX_FLOAT CPDF_VariableText::GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, - FX_FLOAT fCharSpace, FX_INT32 nHorzScale, - FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle) +FX_FLOAT CPDF_VariableText::GetWordWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, + FX_FLOAT fCharSpace, int32_t nHorzScale, + FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle) { return (GetCharWidth(nFontIndex, Word, SubWord, nWordStyle) * fFontSize * PVT_FONTSCALE + fCharSpace) * nHorzScale * PVT_PERCENT + fWordTail; } @@ -1387,11 +1384,11 @@ FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo & SecInfo) return m_bRichText && SecInfo.pWordProps ? GetFontDescent(SecInfo.pWordProps->nFontIndex, SecInfo.pWordProps->fFontSize) : GetFontDescent(GetDefaultFontIndex(), GetFontSize()); } -FX_FLOAT CPDF_VariableText::GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize) +FX_FLOAT CPDF_VariableText::GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize) { return (FX_FLOAT)GetTypeAscent(nFontIndex) * fFontSize * PVT_FONTSCALE; } -FX_FLOAT CPDF_VariableText::GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize) +FX_FLOAT CPDF_VariableText::GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize) { return (FX_FLOAT)GetTypeDescent(nFontIndex) * fFontSize * PVT_FONTSCALE; } @@ -1419,7 +1416,7 @@ FX_FLOAT CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo & SecInfo) { return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->fLineIndent : 0.0f; } -FX_INT32 CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo) +int32_t CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo) { return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->nAlignment : this->m_nAlignment; } @@ -1427,7 +1424,7 @@ FX_FLOAT CPDF_VariableText::GetCharSpace(const CPVT_WordInfo & WordInfo) { return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->fCharSpace : m_fCharSpace; } -FX_INT32 CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo) +int32_t CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo) { return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nHorzScale : m_nHorzScale; } @@ -1435,7 +1432,7 @@ void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place) { CPVT_WordPlace wordplace = AjustLineHeader(place, TRUE); if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { - for (FX_INT32 w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) { + for (int32_t w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) { delete pSection->m_WordArray.GetAt(w); pSection->m_WordArray.RemoveAt(w); } @@ -1469,7 +1466,7 @@ FX_BOOL CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place) void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange) { CPVT_WordPlace wordplace; - for (FX_INT32 s = PlaceRange.EndPos.nSecIndex; s > PlaceRange.BeginPos.nSecIndex; s--) { + for (int32_t s = PlaceRange.EndPos.nSecIndex; s > PlaceRange.BeginPos.nSecIndex; s--) { wordplace.nSecIndex = s; ClearEmptySection(wordplace); } @@ -1479,7 +1476,7 @@ void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place) CPVT_WordPlace oldplace = AjustLineHeader(place, TRUE); if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) { if (CSection * pSection = m_SectionArray.GetAt(oldplace.nSecIndex)) { - for (FX_INT32 w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) { + for (int32_t w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) { if (CPVT_WordInfo * pWord = pNextSection->m_WordArray.GetAt(w)) { oldplace.nWordIndex ++; pSection->AddWord(oldplace, *pWord); @@ -1495,7 +1492,7 @@ void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange) CPVT_WordRange NewRange; NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, TRUE); NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, TRUE); - for (FX_INT32 s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) { + for (int32_t s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) { if (CSection * pSection = m_SectionArray.GetAt(s)) { pSection->ClearWords(NewRange); } @@ -1558,7 +1555,7 @@ CPVT_FloatRect CPDF_VariableText::Rearrange(const CPVT_WordRange & PlaceRange) } FX_FLOAT CPDF_VariableText::GetAutoFontSize() { - FX_INT32 nTotal = sizeof(gFontSizeSteps) / sizeof(FX_BYTE); + int32_t nTotal = sizeof(gFontSizeSteps) / sizeof(uint8_t); if (IsMultiLine()) { nTotal /= 4; } @@ -1568,9 +1565,9 @@ FX_FLOAT CPDF_VariableText::GetAutoFontSize() if (GetPlateWidth() <= 0) { return 0; } - FX_INT32 nLeft = 0; - FX_INT32 nRight = nTotal - 1; - FX_INT32 nMid = nTotal / 2; + int32_t nLeft = 0; + int32_t nRight = nTotal - 1; + int32_t nMid = nTotal / 2; while (nLeft <= nRight) { if (IsBigger(gFontSizeSteps[nMid])) { nRight = nMid - 1; @@ -1588,7 +1585,7 @@ FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) { FX_BOOL bBigger = FALSE; CPVT_Size szTotal; - for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { + for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { if (CSection * pSection = m_SectionArray.GetAt(s)) { CPVT_Size size = pSection->GetSectionSize(fFontSize); szTotal.x = FPDF_MAX(size.x, szTotal.x); @@ -1608,10 +1605,10 @@ CPVT_FloatRect CPDF_VariableText::RearrangeSections(const CPVT_WordRange & Place CPVT_WordPlace place; FX_FLOAT fPosY = 0; FX_FLOAT fOldHeight; - FX_INT32 nSSecIndex = PlaceRange.BeginPos.nSecIndex; - FX_INT32 nESecIndex = PlaceRange.EndPos.nSecIndex; + int32_t nSSecIndex = PlaceRange.BeginPos.nSecIndex; + int32_t nESecIndex = PlaceRange.EndPos.nSecIndex; CPVT_FloatRect rcRet; - for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { + for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { place.nSecIndex = s; if (CSection * pSection = m_SectionArray.GetAt(s)) { pSection->SecPlace = place; @@ -1642,7 +1639,7 @@ CPVT_FloatRect CPDF_VariableText::RearrangeSections(const CPVT_WordRange & Place } return rcRet; } -FX_INT32 CPDF_VariableText::GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle) +int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, int32_t nWordStyle) { if (m_pVTProvider) { if (SubWord > 0) { @@ -1653,19 +1650,19 @@ FX_INT32 CPDF_VariableText::GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_W } return 0; } -FX_INT32 CPDF_VariableText::GetTypeAscent(FX_INT32 nFontIndex) +int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) { return m_pVTProvider ? m_pVTProvider->GetTypeAscent(nFontIndex) : 0; } -FX_INT32 CPDF_VariableText::GetTypeDescent(FX_INT32 nFontIndex) +int32_t CPDF_VariableText::GetTypeDescent(int32_t nFontIndex) { return m_pVTProvider ? m_pVTProvider->GetTypeDescent(nFontIndex) : 0; } -FX_INT32 CPDF_VariableText::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) +int32_t CPDF_VariableText::GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) { return m_pVTProvider ? m_pVTProvider->GetWordFontIndex(word, charset, nFontIndex) : -1; } -FX_INT32 CPDF_VariableText::GetDefaultFontIndex() +int32_t CPDF_VariableText::GetDefaultFontIndex() { return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1; } @@ -1694,7 +1691,7 @@ CPDF_VariableText_Iterator::CPDF_VariableText_Iterator(CPDF_VariableText * pVT): CPDF_VariableText_Iterator::~CPDF_VariableText_Iterator() { } -void CPDF_VariableText_Iterator::SetAt(FX_INT32 nWordIndex) +void CPDF_VariableText_Iterator::SetAt(int32_t nWordIndex) { ASSERT(m_pVT != NULL); m_CurPos = m_pVT->WordIndexToWordPlace(nWordIndex); diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h index 9c38ffc00c..5d8b20cf52 100644 --- a/core/src/fpdfdoc/pdf_vt.h +++ b/core/src/fpdfdoc/pdf_vt.h @@ -118,7 +118,7 @@ struct CPVT_SectionInfo { } } CPVT_FloatRect rcSection; - FX_INT32 nTotalLine; + int32_t nTotalLine; CPVT_SecProps* pSecProps; CPVT_WordProps* pWordProps; }; @@ -127,9 +127,9 @@ struct CPVT_LineInfo { fLineX(0.0f), fLineY(0.0f), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) { } - FX_INT32 nTotalWord; - FX_INT32 nBeginWordIndex; - FX_INT32 nEndWordIndex; + int32_t nTotalWord; + int32_t nBeginWordIndex; + int32_t nEndWordIndex; FX_FLOAT fLineX; FX_FLOAT fLineY; FX_FLOAT fLineWidth; @@ -141,7 +141,7 @@ struct CPVT_WordInfo { fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL) { } - CPVT_WordInfo(FX_WORD word, FX_INT32 charset, FX_INT32 fontIndex, CPVT_WordProps * pProps): + CPVT_WordInfo(FX_WORD word, int32_t charset, int32_t fontIndex, CPVT_WordProps * pProps): Word(word), nCharset(charset), fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(fontIndex), pWordProps(pProps) { @@ -174,11 +174,11 @@ struct CPVT_WordInfo { } } FX_WORD Word; - FX_INT32 nCharset; + int32_t nCharset; FX_FLOAT fWordX; FX_FLOAT fWordY; FX_FLOAT fWordTail; - FX_INT32 nFontIndex; + int32_t nFontIndex; CPVT_WordProps* pWordProps; }; struct CPVT_FloatRange { @@ -235,11 +235,11 @@ public: { RemoveAll(); } - FX_INT32 GetSize() const + int32_t GetSize() const { return m_Lines.GetSize(); } - CLine * GetAt(FX_INT32 nIndex) const + CLine * GetAt(int32_t nIndex) const { return m_Lines.GetAt(nIndex); } @@ -249,13 +249,13 @@ public: } void RemoveAll() { - for (FX_INT32 i = 0, sz = GetSize(); i < sz; i++) { + for (int32_t i = 0, sz = GetSize(); i < sz; i++) { delete GetAt(i); } m_Lines.RemoveAll(); m_nTotal = 0; } - FX_INT32 Add(const CPVT_LineInfo & lineinfo) + int32_t Add(const CPVT_LineInfo & lineinfo) { if (m_nTotal >= GetSize()) { if (CLine * pLine = FX_NEW CLine) { @@ -273,14 +273,14 @@ public: } void Clear() { - for (FX_INT32 i = GetSize() - 1; i >= m_nTotal; i--) { + for (int32_t i = GetSize() - 1; i >= m_nTotal; i--) { delete GetAt(i); m_Lines.RemoveAt(i); } } private: CPVT_ArrayTemplate<CLine*> m_Lines; - FX_INT32 m_nTotal; + int32_t m_nTotal; }; class CSection { @@ -312,9 +312,9 @@ public: CLines m_LineArray; CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; private: - void ClearLeftWords(FX_INT32 nWordIndex); - void ClearRightWords(FX_INT32 nWordIndex); - void ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); + void ClearLeftWords(int32_t nWordIndex); + void ClearRightWords(int32_t nWordIndex); + void ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex); CPDF_VariableText *m_pVT; }; @@ -414,7 +414,7 @@ public: { CPDF_EditContainer::SetPlateRect(rect); } - void SetAlignment(FX_INT32 nFormat = 0) + void SetAlignment(int32_t nFormat = 0) { m_nAlignment = nFormat; } @@ -422,7 +422,7 @@ public: { m_wSubWord = wSubWord; } - void SetLimitChar(FX_INT32 nLimitChar = 0) + void SetLimitChar(int32_t nLimitChar = 0) { m_nLimitChar = nLimitChar; } @@ -430,7 +430,7 @@ public: { m_fCharSpace = fCharSpace; } - void SetHorzScale(FX_INT32 nHorzScale = 100) + void SetHorzScale(int32_t nHorzScale = 100) { m_nHorzScale = nHorzScale; } @@ -446,7 +446,7 @@ public: { m_fFontSize = fFontSize; } - void SetCharArray(FX_INT32 nCharArray = 0) + void SetCharArray(int32_t nCharArray = 0) { m_nCharArray = nCharArray; } @@ -474,13 +474,13 @@ public: void RearrangeAll(); void RearrangePart(const CPVT_WordRange & PlaceRange); void ResetAll(); - void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL, + void SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL); - CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1, + CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1, const CPVT_WordProps * pWordProps = NULL); CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL); - CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1, + CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL); CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange); CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place); @@ -490,20 +490,20 @@ public: return CPDF_EditContainer::GetPlateRect(); } CPDF_Rect GetContentRect() const; - FX_INT32 GetTotalWords() const; + int32_t GetTotalWords() const; FX_FLOAT GetFontSize() const { return m_fFontSize; } - FX_INT32 GetAlignment() const + int32_t GetAlignment() const { return m_nAlignment; } - FX_INT32 GetCharArray() const + int32_t GetCharArray() const { return m_nCharArray; } - FX_INT32 GetLimitChar() const + int32_t GetLimitChar() const { return m_nLimitChar; } @@ -511,7 +511,7 @@ public: { return m_bMultiLine; } - FX_INT32 GetHorzScale() const + int32_t GetHorzScale() const { return m_nHorzScale; } @@ -532,8 +532,8 @@ public: CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const; void UpdateWordPlace(CPVT_WordPlace & place) const; - FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const; - CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const; + int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const; + CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; FX_WORD GetPasswordChar() const { return GetSubWord(); @@ -543,11 +543,11 @@ public: return m_wSubWord; } private: - FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle); - FX_INT32 GetTypeAscent(FX_INT32 nFontIndex); - FX_INT32 GetTypeDescent(FX_INT32 nFontIndex); - FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); - FX_INT32 GetDefaultFontIndex(); + int32_t GetCharWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, int32_t nWordStyle); + int32_t GetTypeAscent(int32_t nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); + int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); + int32_t GetDefaultFontIndex(); FX_BOOL IsLatinWord(FX_WORD word); private: @@ -559,9 +559,9 @@ private: FX_BOOL GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); FX_BOOL GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); - FX_FLOAT GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, - FX_FLOAT fCharSpace, FX_INT32 nHorzScale, - FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle); + FX_FLOAT GetWordWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, + FX_FLOAT fCharSpace, int32_t nHorzScale, + FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle); FX_FLOAT GetWordWidth(const CPVT_WordInfo & WordInfo); FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); @@ -569,14 +569,14 @@ private: FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); FX_FLOAT GetLineAscent(const CPVT_SectionInfo & SecInfo); FX_FLOAT GetLineDescent(const CPVT_SectionInfo & SecInfo); - FX_FLOAT GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); - FX_FLOAT GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); - FX_INT32 GetWordFontIndex(const CPVT_WordInfo & WordInfo); + FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); + FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize); + int32_t GetWordFontIndex(const CPVT_WordInfo & WordInfo); FX_FLOAT GetCharSpace(const CPVT_WordInfo & WordInfo); - FX_INT32 GetHorzScale(const CPVT_WordInfo & WordInfo); + int32_t GetHorzScale(const CPVT_WordInfo & WordInfo); FX_FLOAT GetLineLeading(const CPVT_SectionInfo & SecInfo); FX_FLOAT GetLineIndent(const CPVT_SectionInfo & SecInfo); - FX_INT32 GetAlignment(const CPVT_SectionInfo& SecInfo); + int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); void ClearSectionRightWords(const CPVT_WordPlace & place); CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; @@ -595,15 +595,15 @@ private: void ResetSectionArray(); private: CPVT_ArrayTemplate<CSection*> m_SectionArray; - FX_INT32 m_nLimitChar; - FX_INT32 m_nCharArray; + int32_t m_nLimitChar; + int32_t m_nCharArray; FX_BOOL m_bMultiLine; FX_BOOL m_bLimitWidth; FX_BOOL m_bAutoFontSize; - FX_INT32 m_nAlignment; + int32_t m_nAlignment; FX_FLOAT m_fLineLeading; FX_FLOAT m_fCharSpace; - FX_INT32 m_nHorzScale; + int32_t m_nHorzScale; FX_WORD m_wSubWord; FX_FLOAT m_fFontSize; @@ -629,7 +629,7 @@ public: FX_BOOL GetLine(CPVT_Line & line) const; FX_BOOL GetSection(CPVT_Section & section) const; FX_BOOL SetSection(const CPVT_Section & section); - void SetAt(FX_INT32 nWordIndex); + void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace & place); const CPVT_WordPlace & GetAt() const { diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index c391524b9e..5efbe51c03 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -75,7 +75,7 @@ void CTextPage::ProcessObject(CPDF_PageObject* pObject) CFX_AffineMatrix matrix; pText->GetTextMatrix(&matrix); for (int i = 0; i < pText->m_nChars; i ++) { - FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i]; + FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(uintptr_t)pText->m_pCharCodes : pText->m_pCharCodes[i]; if (charcode == (FX_DWORD) - 1) { continue; } @@ -113,7 +113,7 @@ void CTextPage::ProcessObject(CPDF_PageObject* pObject) int space_count = 0; FX_FLOAT last_left = 0, last_right = 0, segment_left = 0, segment_right = 0; for (int i = 0; i < pText->m_nChars; i ++) { - FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i]; + FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(uintptr_t)pText->m_pCharCodes : pText->m_pCharCodes[i]; if (charcode == (FX_DWORD) - 1) { continue; } @@ -314,11 +314,11 @@ void NormalizeString(CFX_WideString& str) } CFX_WordArray order; FX_BOOL bR2L = FALSE; - FX_INT32 start = 0, count = 0, i = 0; + int32_t start = 0, count = 0, i = 0; int nR2L = 0, nL2R = 0; for (i = 0; i < str.GetLength(); i++) { if(BidiChar->AppendChar(str.GetAt(i))) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); @@ -332,7 +332,7 @@ void NormalizeString(CFX_WideString& str) } } if(BidiChar->EndChar()) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index b0c4ae2753..10bd3c8b36 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -652,7 +652,7 @@ void CPDF_TextPage::GetCharInfo(int index, FPDF_CHAR_INFO & info) const info.m_Matrix.Copy(charinfo.m_Matrix); return; } -void CPDF_TextPage::CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const +void CPDF_TextPage::CheckMarkedContentObject(int32_t& start, int32_t& nCount) const { PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start); PAGECHAR_INFO charinfo2 = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - 1); @@ -963,24 +963,24 @@ int CPDF_TextPage::GetWordBreak(int index, int direction) const } return breakPos; } -FX_INT32 CPDF_TextPage::FindTextlineFlowDirection() +int32_t CPDF_TextPage::FindTextlineFlowDirection() { if (!m_pPage) { return -1; } - const FX_INT32 nPageWidth = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageWidth(); - const FX_INT32 nPageHeight = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageHeight(); + const int32_t nPageWidth = (int32_t)((CPDF_Page*)m_pPage)->GetPageWidth(); + const int32_t nPageHeight = (int32_t)((CPDF_Page*)m_pPage)->GetPageHeight(); CFX_ByteArray nHorizontalMask; if (!nHorizontalMask.SetSize(nPageWidth)) { return -1; } - FX_BYTE* pDataH = nHorizontalMask.GetData(); + uint8_t* pDataH = nHorizontalMask.GetData(); CFX_ByteArray nVerticalMask; if (!nVerticalMask.SetSize(nPageHeight)) { return -1; } - FX_BYTE* pDataV = nVerticalMask.GetData(); - FX_INT32 index = 0; + uint8_t* pDataV = nVerticalMask.GetData(); + int32_t index = 0; FX_FLOAT fLineHeight = 0.0f; CPDF_PageObject* pPageObj = NULL; FX_POSITION pos = NULL; @@ -996,10 +996,10 @@ FX_INT32 CPDF_TextPage::FindTextlineFlowDirection() if(PDFPAGE_TEXT != pPageObj->m_Type) { continue; } - FX_INT32 minH = (FX_INT32)pPageObj->m_Left < 0 ? 0 : (FX_INT32)pPageObj->m_Left; - FX_INT32 maxH = (FX_INT32)pPageObj->m_Right > nPageWidth ? nPageWidth : (FX_INT32)pPageObj->m_Right; - FX_INT32 minV = (FX_INT32)pPageObj->m_Bottom < 0 ? 0 : (FX_INT32)pPageObj->m_Bottom; - FX_INT32 maxV = (FX_INT32)pPageObj->m_Top > nPageHeight ? nPageHeight : (FX_INT32)pPageObj->m_Top; + int32_t minH = (int32_t)pPageObj->m_Left < 0 ? 0 : (int32_t)pPageObj->m_Left; + int32_t maxH = (int32_t)pPageObj->m_Right > nPageWidth ? nPageWidth : (int32_t)pPageObj->m_Right; + int32_t minV = (int32_t)pPageObj->m_Bottom < 0 ? 0 : (int32_t)pPageObj->m_Bottom; + int32_t maxV = (int32_t)pPageObj->m_Top > nPageHeight ? nPageHeight : (int32_t)pPageObj->m_Top; if (minH >= maxH || minV >= maxV) { continue; } @@ -1010,8 +1010,8 @@ FX_INT32 CPDF_TextPage::FindTextlineFlowDirection() } pPageObj = NULL; } - FX_INT32 nStartH = 0; - FX_INT32 nEndH = 0; + int32_t nStartH = 0; + int32_t nEndH = 0; FX_FLOAT nSumH = 0.0f; for (index = 0; index < nPageWidth; index++) if(1 == nHorizontalMask[index]) { @@ -1027,8 +1027,8 @@ FX_INT32 CPDF_TextPage::FindTextlineFlowDirection() nSumH += nHorizontalMask[index]; } nSumH /= nEndH - nStartH; - FX_INT32 nStartV = 0; - FX_INT32 nEndV = 0; + int32_t nStartV = 0; + int32_t nEndV = 0; FX_FLOAT nSumV = 0.0f; for (index = 0; index < nPageHeight; index++) if(1 == nVerticalMask[index]) { @@ -1044,10 +1044,10 @@ FX_INT32 CPDF_TextPage::FindTextlineFlowDirection() nSumV += nVerticalMask[index]; } nSumV /= nEndV - nStartV; - if ((nEndV - nStartV) < (FX_INT32)(2 * fLineHeight)) { + if ((nEndV - nStartV) < (int32_t)(2 * fLineHeight)) { return 0; } - if ((nEndH - nStartH) < (FX_INT32)(2 * fLineHeight)) { + if ((nEndH - nStartH) < (int32_t)(2 * fLineHeight)) { return 1; } if (nSumH > 0.8f) { @@ -1141,8 +1141,8 @@ int CPDF_TextPage::GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const } void CPDF_TextPage::OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str) { - FX_INT32 start, count; - FX_INT32 ret = pBidi->GetBidiInfo(start, count); + int32_t start, count; + int32_t ret = pBidi->GetBidiInfo(start, count); if(ret == 2) { for(int i = start + count - 1; i >= start; i--) { m_TextBuf.AppendChar(str.GetAt(i)); @@ -1232,7 +1232,7 @@ void CPDF_TextPage::CloseTempLine() CFX_WideString str = m_TempTextBuf.GetWideString(); CFX_WordArray order; FX_BOOL bR2L = FALSE; - FX_INT32 start = 0, count = 0; + int32_t start = 0, count = 0; int nR2L = 0, nL2R = 0; FX_BOOL bPrevSpace = FALSE; for (int i = 0; i < str.GetLength(); i++) { @@ -1250,7 +1250,7 @@ void CPDF_TextPage::CloseTempLine() bPrevSpace = FALSE; } if(BidiChar && BidiChar->AppendChar(str.GetAt(i))) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); @@ -1264,7 +1264,7 @@ void CPDF_TextPage::CloseTempLine() } } if(BidiChar && BidiChar->EndChar()) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); @@ -1438,7 +1438,7 @@ void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, const CFX_Affin m_LineObj.Add(Obj); } } -FX_INT32 CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) +int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) { CPDF_TextObject* pTextObj = Obj.m_pTextObj; CPDF_ContentMarkData* pMarkData = (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject(); @@ -1598,7 +1598,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) CFX_AffineMatrix matrix; pTextObj->GetTextMatrix(&matrix); matrix.Concat(formMatrix); - FX_INT32 bPreMKC = PreMarkedContent(Obj); + int32_t bPreMKC = PreMarkedContent(Obj); if (FPDFTEXT_MC_DONE == bPreMKC) { m_pPreTextObj = pTextObj; m_perMatrix.Copy(formMatrix); @@ -1645,7 +1645,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) } } } else if (result == 3 && !m_ParseOptions.m_bOutputHyphen) { - FX_INT32 nChars = pTextObj->CountChars(); + int32_t nChars = pTextObj->CountChars(); if (nChars == 1) { CPDF_TextObjectItem item; pTextObj->GetCharInfo(0, &item); @@ -1684,11 +1684,11 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) FX_BOOL bIsBidiAndMirrosInverse = FALSE; IFX_BidiChar* BidiChar = IFX_BidiChar::Create(); - FX_INT32 nR2L = 0; - FX_INT32 nL2R = 0; - FX_INT32 start = 0, count = 0; + int32_t nR2L = 0; + int32_t nL2R = 0; + int32_t start = 0, count = 0; CPDF_TextObjectItem item; - for (FX_INT32 i = 0; i < nItems; i++) { + for (int32_t i = 0; i < nItems; i++) { pTextObj->GetItemInfo(i, &item); if (item.m_CharCode == (FX_DWORD)-1) { continue; @@ -1702,7 +1702,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) continue; } if (BidiChar && BidiChar->AppendChar(wChar)) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); if (ret == 2) { nR2L++; } @@ -1712,7 +1712,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) } } if (BidiChar && BidiChar->EndChar()) { - FX_INT32 ret = BidiChar->GetBidiInfo(start, count); + int32_t ret = BidiChar->GetBidiInfo(start, count); if (ret == 2) { nR2L++; } @@ -1725,8 +1725,8 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) bR2L = TRUE; } bIsBidiAndMirrosInverse = bR2L && (matrix.a * matrix.d - matrix.b * matrix.c) < 0; - FX_INT32 iBufStartAppend = m_TempTextBuf.GetLength(); - FX_INT32 iCharListStartAppend = m_TempCharList.GetSize(); + int32_t iBufStartAppend = m_TempTextBuf.GetLength(); + int32_t iCharListStartAppend = m_TempCharList.GetSize(); FX_FLOAT spacing = 0; for (int i = 0; i < nItems; i++) { @@ -1870,7 +1870,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) } } if (bIsBidiAndMirrosInverse) { - FX_INT32 i, j; + int32_t i, j; i = iCharListStartAppend; j = m_TempCharList.GetSize() - 1; for (; i < j; i++, j--) { @@ -1885,9 +1885,9 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) } } } -FX_INT32 CPDF_TextPage::GetTextObjectWritingMode(const CPDF_TextObject* pTextObj) +int32_t CPDF_TextPage::GetTextObjectWritingMode(const CPDF_TextObject* pTextObj) { - FX_INT32 nChars = pTextObj->CountChars(); + int32_t nChars = pTextObj->CountChars(); if (nChars == 1) { return m_TextlineDir; } @@ -2051,7 +2051,7 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_Af } return 2; } - FX_INT32 nChars = pObj->CountChars(); + int32_t nChars = pObj->CountChars(); if (nChars == 1 && ( 0x2D == curChar || 0xAD == curChar)) if (IsHyphen(curChar)) { return 3; diff --git a/core/src/fpdftext/fpdf_text_search.cpp b/core/src/fpdftext/fpdf_text_search.cpp index bfd742f1ab..89e132991d 100644 --- a/core/src/fpdftext/fpdf_text_search.cpp +++ b/core/src/fpdftext/fpdf_text_search.cpp @@ -266,14 +266,14 @@ FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFir m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode); if (m_pObjArray) { m_pObjArray->Add((void*)pObj); - m_pObjArray->Add((void*)(FX_INTPTR)item_index); + m_pObjArray->Add((void*)(intptr_t)item_index); } } else { m_Buffer << unicode_str; if (m_pObjArray) { for (int i = 0; i < unicode_str.GetLength(); i ++) { m_pObjArray->Add((void*)pObj); - m_pObjArray->Add((void*)(FX_INTPTR)item_index); + m_pObjArray->Add((void*)(intptr_t)item_index); } } } diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h index 59dcd329b3..03f6ce1dc8 100644 --- a/core/src/fpdftext/text_int.h +++ b/core/src/fpdftext/text_int.h @@ -33,7 +33,7 @@ typedef struct _PAGECHAR_INFO { FX_WCHAR m_Unicode; FX_FLOAT m_OriginX; FX_FLOAT m_OriginY; - FX_INT32 m_Flag; + int32_t m_Flag; CFX_FloatRect m_CharBox; CPDF_TextObject* m_pTextObj; CFX_AffineMatrix m_Matrix; @@ -108,14 +108,14 @@ private: int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const; void CloseTempLine(); void OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str); - FX_INT32 PreMarkedContent(PDFTEXT_Obj pObj); + int32_t PreMarkedContent(PDFTEXT_Obj pObj); void ProcessMarkedContent(PDFTEXT_Obj pObj); - void CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const; + void CheckMarkedContentObject(int32_t& start, int32_t& nCount) const; void FindPreviousTextObject(void); void AddCharInfoByLRDirection(CFX_WideString& str, int i); void AddCharInfoByRLDirection(CFX_WideString& str, int i); - FX_INT32 GetTextObjectWritingMode(const CPDF_TextObject* pTextObj); - FX_INT32 FindTextlineFlowDirection(); + int32_t GetTextObjectWritingMode(const CPDF_TextObject* pTextObj); + int32_t FindTextlineFlowDirection(); protected: CPDFText_ParseOptions m_ParseOptions; CFX_WordArray m_CharIndex; diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index ae9f22bc4a..c50faaa936 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -17,9 +17,9 @@ class CCodec_BasicModule : public ICodec_BasicModule { public: - virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); - virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc); @@ -27,7 +27,7 @@ public: struct CCodec_ImageDataCache { int m_Width, m_Height; int m_nCachedLines; - FX_BYTE m_Data; + uint8_t m_Data; }; class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { @@ -126,10 +126,10 @@ class CCodec_FlateModule : public ICodec_FlateModule public: virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns); - virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, + virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); - virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size, + virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); @@ -185,12 +185,12 @@ public: virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr); virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size); - virtual FX_INT32 ReadHeader(void* pContext, int* width, int* height, + virtual int32_t ReadHeader(void* pContext, int* width, int* height, int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute); - virtual FX_INT32 LoadFrameInfo(void* pContext, int* frame_num); + virtual int32_t LoadFrameInfo(void* pContext, int* frame_num); - virtual FX_INT32 LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute); + virtual int32_t LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute); protected: FX_CHAR m_szLastError[256]; @@ -206,8 +206,8 @@ public: virtual void Finish(void* pContext); virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr); virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size); - virtual FX_INT32 ReadHeader(void* pContext, FX_INT32* width, FX_INT32* height, FX_BOOL* tb_flag, FX_INT32* components, FX_INT32* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute); - virtual FX_INT32 LoadImage(void* pContext); + virtual int32_t ReadHeader(void* pContext, int32_t* width, int32_t* height, FX_BOOL* tb_flag, int32_t* components, int32_t* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute); + virtual int32_t LoadImage(void* pContext); protected: FX_CHAR m_szLastError[256]; @@ -225,10 +225,10 @@ public: FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC, FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING ); - virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT); - virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, - FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents, + FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT ); @@ -263,8 +263,8 @@ class CCodec_TiffModule : public ICodec_TiffModule { public: virtual FX_LPVOID CreateDecoder(IFX_FileRead* file_ptr); - virtual void GetFrames(FX_LPVOID ctx, FX_INT32& frames); - virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL); + virtual void GetFrames(FX_LPVOID ctx, int32_t& frames); + virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL); virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap); virtual void DestroyDecoder(FX_LPVOID ctx); }; @@ -273,14 +273,14 @@ class CPDF_Jbig2Interface : public CJBig2_Module public: virtual void *JBig2_Malloc(FX_DWORD dwSize) { - return FX_Alloc(FX_BYTE, dwSize); + return FX_Alloc(uint8_t, dwSize); } virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) { if (dwSize && num >= UINT_MAX / dwSize) { return NULL; } - return FX_Alloc(FX_BYTE, num * dwSize); + return FX_Alloc(uint8_t, num * dwSize); } virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2) { @@ -291,11 +291,11 @@ public: if (size && num >= UINT_MAX / size) { return NULL; } - return FX_Alloc(FX_BYTE, num * size); + return FX_Alloc(uint8_t, num * size); } virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize) { - return FX_Realloc(FX_BYTE, pMem, dwSize); + return FX_Realloc(uint8_t, pMem, dwSize); } virtual void JBig2_Free(FX_LPVOID pMem) { diff --git a/core/src/fxcodec/codec/fx_codec.cpp b/core/src/fxcodec/codec/fx_codec.cpp index 711e2898a1..5676e46be0 100644 --- a/core/src/fxcodec/codec/fx_codec.cpp +++ b/core/src/fxcodec/codec/fx_codec.cpp @@ -123,7 +123,7 @@ void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height) FX_Free(m_pDataCache); m_pDataCache = NULL; } - m_pDataCache = (CCodec_ImageDataCache*)FX_TryAlloc(FX_BYTE, sizeof(CCodec_ImageDataCache) + m_Pitch * m_OutputHeight); + m_pDataCache = (CCodec_ImageDataCache*)FX_TryAlloc(uint8_t, sizeof(CCodec_ImageDataCache) + m_Pitch * m_OutputHeight); if (m_pDataCache == NULL) { return; } @@ -131,7 +131,7 @@ void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height) m_pDataCache->m_Width = m_OutputWidth; m_pDataCache->m_nCachedLines = 0; } -FX_BOOL CCodec_BasicModule::RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, +FX_BOOL CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { return FALSE; @@ -240,7 +240,7 @@ extern "C" double FXstrtod(const char* nptr, char** endptr) } return is_negative ? -ret : ret; } -FX_BOOL CCodec_BasicModule::A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, +FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { return FALSE; @@ -368,7 +368,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExifIFD(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYT wTag = m_readWord(data); data += 2; if (!pMap->Lookup(wTag, buf)) { - buf = FX_Alloc(FX_BYTE, 10); + buf = FX_Alloc(uint8_t, 10); if (buf == NULL) { return FALSE; } @@ -387,7 +387,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExifIFD(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYT wTag = m_readWord(data); data += 2; if (!pMap->Lookup(wTag, buf)) { - buf = FX_Alloc(FX_BYTE, 10); + buf = FX_Alloc(uint8_t, 10); if (buf == NULL) { return FALSE; } @@ -452,7 +452,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* case FX_SignedByte: case FX_Undefined: dwSize = dwModuleNum; - val = FX_Alloc(FX_BYTE, dwSize); + val = FX_Alloc(uint8_t, dwSize); if (val == NULL) { return FALSE; } @@ -465,7 +465,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* case FX_UnsignedShort: case FX_SignedShort: dwSize = dwModuleNum << 1; - val = FX_Alloc(FX_BYTE, dwSize); + val = FX_Alloc(uint8_t, dwSize); if (val == NULL) { return FALSE; } @@ -484,7 +484,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* case FX_SignedLong: case FX_SignedFloat: dwSize = dwModuleNum << 2; - val = FX_Alloc(FX_BYTE, dwSize); + val = FX_Alloc(uint8_t, dwSize); if (val == NULL) { return FALSE; } @@ -502,7 +502,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* case FX_UnsignedRation: case FX_SignedRation: { dwSize = dwModuleNum << 3; - buf = FX_Alloc(FX_BYTE, dwSize); + buf = FX_Alloc(uint8_t, dwSize); if (buf == NULL) { return FALSE; } @@ -512,7 +512,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* FXSYS_memcpy32(buf, head, dwSize); } temp = buf; - val = FX_Alloc(FX_BYTE, dwSize / 2); + val = FX_Alloc(uint8_t, dwSize / 2); if (val == NULL) { FX_Free(buf); return FALSE; @@ -530,7 +530,7 @@ FX_BOOL CFX_DIBAttributeExif::ParseExif(CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE>* break; case FX_DoubleFloat: dwSize = dwModuleNum << 3; - val = FX_Alloc(FX_BYTE, dwSize); + val = FX_Alloc(uint8_t, dwSize); if (val == NULL) { return FALSE; } @@ -606,7 +606,7 @@ public: protected: FX_BOOL CheckDestSize(); void GetNextOperator(); - void UpdateOperator(FX_BYTE used_bytes); + void UpdateOperator(uint8_t used_bytes); FX_LPBYTE m_pScanline; FX_LPCBYTE m_pSrcBuf; @@ -614,7 +614,7 @@ protected: FX_DWORD m_dwLineBytes; FX_DWORD m_SrcOffset; FX_BOOL m_bEOD; - FX_BYTE m_Operator; + uint8_t m_Operator; }; CCodec_RLScanlineDecoder::CCodec_RLScanlineDecoder() : m_pScanline(NULL) @@ -673,7 +673,7 @@ FX_BOOL CCodec_RLScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, m_DownScale = 1; m_Pitch = (width * nComps * bpc + 31) / 32 * 4; m_dwLineBytes = (width * nComps * bpc + 7) / 8; - m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanline = FX_Alloc(uint8_t, m_Pitch); return CheckDestSize(); } FX_BOOL CCodec_RLScanlineDecoder::v_Rewind() @@ -709,7 +709,7 @@ FX_LPBYTE CCodec_RLScanlineDecoder::v_GetNextLine() } FXSYS_memcpy32(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len); col_pos += copy_len; - UpdateOperator((FX_BYTE)copy_len); + UpdateOperator((uint8_t)copy_len); } else if (m_Operator > 128) { int fill = 0; if (m_SrcOffset - 1 < m_SrcSize - 1) { @@ -722,7 +722,7 @@ FX_LPBYTE CCodec_RLScanlineDecoder::v_GetNextLine() } FXSYS_memset8(m_pScanline + col_pos, fill, duplicate_len); col_pos += duplicate_len; - UpdateOperator((FX_BYTE)duplicate_len); + UpdateOperator((uint8_t)duplicate_len); } else { m_bEOD = TRUE; break; @@ -739,7 +739,7 @@ void CCodec_RLScanlineDecoder::GetNextOperator() m_Operator = m_pSrcBuf[m_SrcOffset]; m_SrcOffset ++; } -void CCodec_RLScanlineDecoder::UpdateOperator(FX_BYTE used_bytes) +void CCodec_RLScanlineDecoder::UpdateOperator(uint8_t used_bytes) { if (used_bytes == 0) { return; @@ -758,7 +758,7 @@ void CCodec_RLScanlineDecoder::UpdateOperator(FX_BYTE used_bytes) } return; } - FX_BYTE count = 257 - m_Operator; + uint8_t count = 257 - m_Operator; FXSYS_assert((FX_DWORD)count >= used_bytes); if (used_bytes == count) { m_SrcOffset ++; diff --git a/core/src/fxcodec/codec/fx_codec_bmp.cpp b/core/src/fxcodec/codec/fx_codec_bmp.cpp index 4e974e2124..924eaa91a4 100644 --- a/core/src/fxcodec/codec/fx_codec_bmp.cpp +++ b/core/src/fxcodec/codec/fx_codec_bmp.cpp @@ -33,7 +33,7 @@ static void _bmp_error_data(bmp_decompress_struct_p bmp_ptr, FX_LPCSTR err_msg) FXSYS_strncpy((char*)bmp_ptr->err_ptr, err_msg, BMP_MAX_ERROR_SIZE - 1);
longjmp(bmp_ptr->jmpbuf, 1);
}
-static void _bmp_read_scanline(bmp_decompress_struct_p bmp_ptr, FX_INT32 row_num, FX_LPBYTE row_buf)
+static void _bmp_read_scanline(bmp_decompress_struct_p bmp_ptr, int32_t row_num, FX_LPBYTE row_buf)
{
FXBMP_Context* p = (FXBMP_Context*)bmp_ptr->context_ptr;
CCodec_BmpModule* pModule = (CCodec_BmpModule*)p->parent_ptr;
@@ -47,7 +47,7 @@ static FX_BOOL _bmp_get_data_position(bmp_decompress_struct_p bmp_ptr, FX_DWORD }
void* CCodec_BmpModule::Start(void* pModule)
{
- FXBMP_Context* p = (FXBMP_Context*)FX_Alloc(FX_BYTE, sizeof(FXBMP_Context));
+ FXBMP_Context* p = (FXBMP_Context*)FX_Alloc(uint8_t, sizeof(FXBMP_Context));
if (p == NULL) {
return NULL;
}
@@ -80,13 +80,13 @@ void CCodec_BmpModule::Finish(void* pContext) p->m_FreeFunc(p);
}
}
-FX_INT32 CCodec_BmpModule::ReadHeader(void* pContext, FX_INT32* width, FX_INT32* height, FX_BOOL* tb_flag, FX_INT32* components, FX_INT32* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute)
+int32_t CCodec_BmpModule::ReadHeader(void* pContext, int32_t* width, int32_t* height, FX_BOOL* tb_flag, int32_t* components, int32_t* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute)
{
FXBMP_Context* p = (FXBMP_Context*)pContext;
if(setjmp(p->bmp_ptr->jmpbuf)) {
return 0;
}
- FX_INT32 ret = _bmp_read_header(p->bmp_ptr);
+ int32_t ret = _bmp_read_header(p->bmp_ptr);
if (ret != 1) {
return ret;
}
@@ -104,7 +104,7 @@ FX_INT32 CCodec_BmpModule::ReadHeader(void* pContext, FX_INT32* width, FX_INT32* }
return 1;
}
-FX_INT32 CCodec_BmpModule::LoadImage(void* pContext)
+int32_t CCodec_BmpModule::LoadImage(void* pContext)
{
FXBMP_Context* p = (FXBMP_Context*)pContext;
if(setjmp(p->bmp_ptr->jmpbuf)) {
diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp index dc2ee2aacd..869751e05b 100644 --- a/core/src/fxcodec/codec/fx_codec_fax.cpp +++ b/core/src/fxcodec/codec/fx_codec_fax.cpp @@ -6,7 +6,7 @@ #include "../../../include/fxcodec/fx_codec.h" #include "codec_int.h" -const FX_BYTE OneLeadPos[256] = { +const uint8_t OneLeadPos[256] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -24,7 +24,7 @@ const FX_BYTE OneLeadPos[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -const FX_BYTE ZeroLeadPos[256] = { +const uint8_t ZeroLeadPos[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -43,14 +43,14 @@ const FX_BYTE ZeroLeadPos[256] = { 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, }; -int _FindBit(const FX_BYTE* data_buf, int max_pos, int start_pos, int bit) +int _FindBit(const uint8_t* data_buf, int max_pos, int start_pos, int bit) { if (start_pos >= max_pos) { return max_pos; } FX_LPCBYTE leading_pos = bit ? OneLeadPos : ZeroLeadPos; if (start_pos % 8) { - FX_BYTE data = data_buf[start_pos / 8]; + uint8_t data = data_buf[start_pos / 8]; if (bit) { data &= 0xff >> (start_pos % 8); } else { @@ -61,7 +61,7 @@ int _FindBit(const FX_BYTE* data_buf, int max_pos, int start_pos, int bit) } start_pos += 7; } - FX_BYTE skip = bit ? 0x00 : 0xff; + uint8_t skip = bit ? 0x00 : 0xff; int byte_pos = start_pos / 8; int max_byte = (max_pos + 7) / 8; while (byte_pos < max_byte) { @@ -79,12 +79,12 @@ int _FindBit(const FX_BYTE* data_buf, int max_pos, int start_pos, int bit) } return pos; } -void _FaxG4FindB1B2(const FX_BYTE* ref_buf, int columns, int a0, FX_BOOL a0color, int& b1, int& b2) +void _FaxG4FindB1B2(const uint8_t* ref_buf, int columns, int a0, FX_BOOL a0color, int& b1, int& b2) { if (a0color) { a0color = 1; } - FX_BYTE first_bit = (a0 < 0) ? 1 : ((ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0); + uint8_t first_bit = (a0 < 0) ? 1 : ((ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0); b1 = _FindBit(ref_buf, columns, a0 + 1, !first_bit); if (b1 >= columns) { b1 = b2 = columns; @@ -136,7 +136,7 @@ void _FaxFillBits(FX_LPBYTE dest_buf, int columns, int startpos, int endpos) #define NEXTBIT src_buf[bitpos/8] & (1 << (7-bitpos%8)); bitpos ++; #define ADDBIT(code, bit) code = code << 1; if (bit) code ++; #define GETBIT(bitpos) src_buf[bitpos/8] & (1 << (7-bitpos%8)) -static const FX_BYTE FaxBlackRunIns[] = { +static const uint8_t FaxBlackRunIns[] = { 0, 2, 0x02, 3, 0, @@ -256,7 +256,7 @@ static const FX_BYTE FaxBlackRunIns[] = { 0x77, 1216 % 256, 1216 / 256, 0xff }; -static const FX_BYTE FaxWhiteRunIns[] = { +static const uint8_t FaxWhiteRunIns[] = { 0, 0, 0, @@ -375,12 +375,12 @@ static const FX_BYTE FaxWhiteRunIns[] = { 0x1f, 2560 % 256, 2560 / 256, 0xff, }; -int _FaxGetRun(FX_LPCBYTE ins_array, const FX_BYTE* src_buf, int& bitpos, int bitsize) +int _FaxGetRun(FX_LPCBYTE ins_array, const uint8_t* src_buf, int& bitpos, int bitsize) { FX_DWORD code = 0; int ins_off = 0; while (1) { - FX_BYTE ins = ins_array[ins_off++]; + uint8_t ins = ins_array[ins_off++]; if (ins == 0xff) { return -1; } @@ -400,7 +400,7 @@ int _FaxGetRun(FX_LPCBYTE ins_array, const FX_BYTE* src_buf, int& bitpos, int bi } } } -FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns) +FX_BOOL _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const uint8_t* ref_buf, int columns) { int a0 = -1, a0color = 1; while (1) { @@ -522,7 +522,7 @@ FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE a0color = !a0color; } } -FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos) +FX_BOOL _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos) { int startbit = bitpos; while (bitpos < bitsize) { @@ -536,7 +536,7 @@ FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos) } return FALSE; } -FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns) +FX_BOOL _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns) { int color = TRUE; int startpos = 0; @@ -621,8 +621,8 @@ FX_BOOL CCodec_FaxDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int wid m_Pitch = (m_OrigWidth + 31) / 32 * 4; m_OutputWidth = m_OrigWidth; m_OutputHeight = m_OrigHeight; - m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch); - m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch); + m_pRefBuf = FX_Alloc(uint8_t, m_Pitch); m_pSrcBuf = src_buf; m_SrcSize = src_size; m_nComps = 1; @@ -698,7 +698,7 @@ extern "C" { if (pitch == 0) { pitch = (width + 7) / 8; } - FX_LPBYTE ref_buf = FX_Alloc(FX_BYTE, pitch); + FX_LPBYTE ref_buf = FX_Alloc(uint8_t, pitch); FXSYS_memset8(ref_buf, 0xff, pitch); int bitpos = *pbitpos; for (int iRow = 0; iRow < height; iRow ++) { @@ -711,7 +711,7 @@ extern "C" { *pbitpos = bitpos; } }; -static const FX_BYTE BlackRunTerminator[128] = { +static const uint8_t BlackRunTerminator[128] = { 0x37, 10, 0x02, 3, 0x03, 2, 0x02, 2, 0x03, 3, 0x03, 4, 0x02, 4, 0x03, 5, 0x05, 6, 0x04, 6, 0x04, 7, 0x05, 7, 0x07, 7, 0x04, 8, 0x07, 8, 0x18, 9, 0x17, 10, 0x18, 10, 0x08, 10, 0x67, 11, 0x68, 11, 0x6c, 11, 0x37, 11, 0x28, 11, @@ -721,14 +721,14 @@ static const FX_BYTE BlackRunTerminator[128] = { 0x64, 12, 0x65, 12, 0x52, 12, 0x53, 12, 0x24, 12, 0x37, 12, 0x38, 12, 0x27, 12, 0x28, 12, 0x58, 12, 0x59, 12, 0x2b, 12, 0x2c, 12, 0x5a, 12, 0x66, 12, 0x67, 12, }; -static const FX_BYTE BlackRunMarkup[80] = { +static const uint8_t BlackRunMarkup[80] = { 0x0f, 10, 0xc8, 12, 0xc9, 12, 0x5b, 12, 0x33, 12, 0x34, 12, 0x35, 12, 0x6c, 13, 0x6d, 13, 0x4a, 13, 0x4b, 13, 0x4c, 13, 0x4d, 13, 0x72, 13, 0x73, 13, 0x74, 13, 0x75, 13, 0x76, 13, 0x77, 13, 0x52, 13, 0x53, 13, 0x54, 13, 0x55, 13, 0x5a, 13, 0x5b, 13, 0x64, 13, 0x65, 13, 0x08, 11, 0x0c, 11, 0x0d, 11, 0x12, 12, 0x13, 12, 0x14, 12, 0x15, 12, 0x16, 12, 0x17, 12, 0x1c, 12, 0x1d, 12, 0x1e, 12, 0x1f, 12, }; -static const FX_BYTE WhiteRunTerminator[128] = { +static const uint8_t WhiteRunTerminator[128] = { 0x35, 8, 0x07, 6, 0x07, 4, @@ -794,7 +794,7 @@ static const FX_BYTE WhiteRunTerminator[128] = { 0x33, 8, 0x34, 8, }; -static const FX_BYTE WhiteRunMarkup[80] = { +static const uint8_t WhiteRunMarkup[80] = { 0x1b, 5, 0x12, 5, 0x17, 6, @@ -935,9 +935,9 @@ CCodec_FaxEncoder::CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, m_Cols = width; m_Rows = height; m_Pitch = pitch; - m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch); + m_pRefLine = FX_Alloc(uint8_t, m_Pitch); FXSYS_memset8(m_pRefLine, 0xff, m_Pitch); - m_pLineBuf = FX_Alloc2D(FX_BYTE, m_Pitch, 8); + m_pLineBuf = FX_Alloc2D(uint8_t, m_Pitch, 8); m_DestBuf.EstimateSize(0, 10240); } CCodec_FaxEncoder::~CCodec_FaxEncoder() @@ -952,7 +952,7 @@ CCodec_FaxEncoder::~CCodec_FaxEncoder() void CCodec_FaxEncoder::Encode(FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { int dest_bitpos = 0; - FX_BYTE last_byte = 0; + uint8_t last_byte = 0; for (int i = 0; i < m_Rows; i ++) { FX_LPCBYTE scan_line = m_pSrcBuf + i * m_Pitch; FXSYS_memset32(m_pLineBuf, 0, m_Pitch * 8); diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp index 7a19e8b855..9997a570d6 100644 --- a/core/src/fxcodec/codec/fx_codec_flate.cpp +++ b/core/src/fxcodec/codec/fx_codec_flate.cpp @@ -13,7 +13,7 @@ extern "C" { static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size) { - return FX_Alloc2D(FX_BYTE, items, size); + return FX_Alloc2D(uint8_t, items, size); } static void my_free_func (void* opaque, void* address) { @@ -79,22 +79,22 @@ extern "C" class CLZWDecoder { public: - FX_BOOL Decode(FX_LPBYTE output, FX_DWORD& outlen, const FX_BYTE* input, FX_DWORD& size, FX_BOOL bEarlyChange); + FX_BOOL Decode(FX_LPBYTE output, FX_DWORD& outlen, const uint8_t* input, FX_DWORD& size, FX_BOOL bEarlyChange); private: FX_DWORD m_InPos; FX_DWORD m_OutPos; FX_LPBYTE m_pOutput; - const FX_BYTE* m_pInput; + const uint8_t* m_pInput; FX_BOOL m_Early; - void AddCode(FX_DWORD prefix_code, FX_BYTE append_char); + void AddCode(FX_DWORD prefix_code, uint8_t append_char); FX_DWORD m_CodeArray[5021]; FX_DWORD m_nCodes; - FX_BYTE m_DecodeStack[4000]; + uint8_t m_DecodeStack[4000]; FX_DWORD m_StackLen; void DecodeString(FX_DWORD code); int m_CodeLen; }; -void CLZWDecoder::AddCode(FX_DWORD prefix_code, FX_BYTE append_char) +void CLZWDecoder::AddCode(FX_DWORD prefix_code, uint8_t append_char) { if (m_nCodes + m_Early == 4094) { return; @@ -119,15 +119,15 @@ void CLZWDecoder::DecodeString(FX_DWORD code) if (m_StackLen >= sizeof(m_DecodeStack)) { return; } - m_DecodeStack[m_StackLen++] = (FX_BYTE)data; + m_DecodeStack[m_StackLen++] = (uint8_t)data; code = data >> 16; } if (m_StackLen >= sizeof(m_DecodeStack)) { return; } - m_DecodeStack[m_StackLen++] = (FX_BYTE)code; + m_DecodeStack[m_StackLen++] = (uint8_t)code; } -int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* src_buf, FX_DWORD& src_size, FX_BOOL bEarlyChange) +int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const uint8_t* src_buf, FX_DWORD& src_size, FX_BOOL bEarlyChange) { m_CodeLen = 9; m_InPos = 0; @@ -137,7 +137,7 @@ int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* m_Early = bEarlyChange ? 1 : 0; m_nCodes = 0; FX_DWORD old_code = (FX_DWORD) - 1; - FX_BYTE last_char; + uint8_t last_char; while (1) { if (m_InPos + m_CodeLen > src_size * 8) { break; @@ -164,10 +164,10 @@ int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* return -5; } if (m_pOutput) { - m_pOutput[m_OutPos] = (FX_BYTE)code; + m_pOutput[m_OutPos] = (uint8_t)code; } m_OutPos ++; - last_char = (FX_BYTE)code; + last_char = (uint8_t)code; if (old_code != (FX_DWORD) - 1) { AddCode(old_code, last_char); } @@ -217,19 +217,19 @@ int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* src_size = (m_InPos + 7) / 8; return 0; } -static FX_BYTE PaethPredictor(int a, int b, int c) +static uint8_t PaethPredictor(int a, int b, int c) { int p = a + b - c; int pa = FXSYS_abs(p - a); int pb = FXSYS_abs(p - b); int pc = FXSYS_abs(p - c); if (pa <= pb && pa <= pc) { - return (FX_BYTE)a; + return (uint8_t)a; } if (pb <= pc) { - return (FX_BYTE)b; + return (uint8_t)b; } - return (FX_BYTE)c; + return (uint8_t)c; } static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, int predictor, int Colors, @@ -241,7 +241,7 @@ static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, return FALSE; const int row_count = (data_size + row_size - 1) / row_size; const int last_row_size = data_size % row_size; - FX_LPBYTE dest_buf = FX_Alloc2D(FX_BYTE, row_size + 1, row_count); + FX_LPBYTE dest_buf = FX_Alloc2D(uint8_t, row_size + 1, row_count); int byte_cnt = 0; FX_LPBYTE pSrcData = data_buf; FX_LPBYTE pDestData = dest_buf; @@ -262,7 +262,7 @@ static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, switch (predictor) { case 11: { pDestData[0] = 1; - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pSrcData[byte - BytesPerPixel]; } @@ -271,7 +271,7 @@ static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; case 12: { pDestData[0] = 2; - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pSrcData[byte - row_size]; } @@ -280,11 +280,11 @@ static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; case 13: { pDestData[0] = 3; - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pSrcData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pSrcData[byte - row_size]; } @@ -293,15 +293,15 @@ static FX_BOOL PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; case 14: { pDestData[0] = 4; - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pSrcData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pSrcData[byte - row_size]; } - FX_BYTE upper_left = 0; + uint8_t upper_left = 0; if (byte >= BytesPerPixel && row) { upper_left = pSrcData[byte - row_size - BytesPerPixel]; } @@ -328,16 +328,16 @@ static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE { int row_size = (nPixels * bpc * nColors + 7) / 8; int BytesPerPixel = (bpc * nColors + 7) / 8; - FX_BYTE tag = pSrcData[0]; + uint8_t tag = pSrcData[0]; if (tag == 0) { FXSYS_memmove32(pDestData, pSrcData + 1, row_size); return; } for (int byte = 0; byte < row_size; byte ++) { - FX_BYTE raw_byte = pSrcData[byte + 1]; + uint8_t raw_byte = pSrcData[byte + 1]; switch (tag) { case 1: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } @@ -345,7 +345,7 @@ static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE break; } case 2: { - FX_BYTE up = 0; + uint8_t up = 0; if (pLastLine) { up = pLastLine[byte]; } @@ -353,11 +353,11 @@ static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE break; } case 3: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (pLastLine) { up = pLastLine[byte]; } @@ -365,15 +365,15 @@ static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE break; } case 4: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (pLastLine) { up = pLastLine[byte]; } - FX_BYTE upper_left = 0; + uint8_t upper_left = 0; if (byte >= BytesPerPixel && pLastLine) { upper_left = pLastLine[byte - BytesPerPixel]; } @@ -395,12 +395,12 @@ static FX_BOOL PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size, return FALSE; const int row_count = (data_size + row_size) / (row_size + 1); const int last_row_size = data_size % (row_size + 1); - FX_LPBYTE dest_buf = FX_Alloc2D(FX_BYTE, row_size, row_count); + FX_LPBYTE dest_buf = FX_Alloc2D(uint8_t, row_size, row_count); int byte_cnt = 0; FX_LPBYTE pSrcData = data_buf; FX_LPBYTE pDestData = dest_buf; for (int row = 0; row < row_count; row ++) { - FX_BYTE tag = pSrcData[0]; + uint8_t tag = pSrcData[0]; byte_cnt++; if (tag == 0) { int move_size = row_size; @@ -414,10 +414,10 @@ static FX_BOOL PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size, continue; } for (int byte = 0; byte < row_size && byte_cnt < (int)data_size; byte ++) { - FX_BYTE raw_byte = pSrcData[byte + 1]; + uint8_t raw_byte = pSrcData[byte + 1]; switch (tag) { case 1: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } @@ -425,7 +425,7 @@ static FX_BOOL PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; } case 2: { - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pDestData[byte - row_size]; } @@ -433,11 +433,11 @@ static FX_BOOL PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; } case 3: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pDestData[byte - row_size]; } @@ -445,15 +445,15 @@ static FX_BOOL PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size, break; } case 4: { - FX_BYTE left = 0; + uint8_t left = 0; if (byte >= BytesPerPixel) { left = pDestData[byte - BytesPerPixel]; } - FX_BYTE up = 0; + uint8_t up = 0; if (row) { up = pDestData[byte - row_size]; } - FX_BYTE upper_left = 0; + uint8_t upper_left = 0; if (byte >= BytesPerPixel && row) { upper_left = pDestData[byte - row_size - BytesPerPixel]; } @@ -478,7 +478,7 @@ static void TIFF_PredictorEncodeLine(FX_LPBYTE dest_buf, int row_size, int BitsP { int BytesPerPixel = BitsPerComponent * Colors / 8; if (BitsPerComponent < 8) { - FX_BYTE mask = 0x01; + uint8_t mask = 0x01; if (BitsPerComponent == 2) { mask = 0x03; } else if (BitsPerComponent == 4) { @@ -490,8 +490,8 @@ static void TIFF_PredictorEncodeLine(FX_LPBYTE dest_buf, int row_size, int BitsP int index = i / 8; int col_pre = (col == 0) ? (8 - BitsPerComponent) : (col - BitsPerComponent); int index_pre = (col == 0) ? (index - 1) : index; - FX_BYTE cur = (dest_buf[index] >> (8 - col - BitsPerComponent)) & mask; - FX_BYTE left = (dest_buf[index_pre] >> (8 - col_pre - BitsPerComponent)) & mask; + uint8_t cur = (dest_buf[index] >> (8 - col - BitsPerComponent)) & mask; + uint8_t left = (dest_buf[index_pre] >> (8 - col_pre - BitsPerComponent)) & mask; cur -= left; cur &= mask; cur <<= (8 - col - BitsPerComponent); @@ -507,7 +507,7 @@ static void TIFF_PredictorEncodeLine(FX_LPBYTE dest_buf, int row_size, int BitsP FX_WORD pixel = (dest_buf[i] << 8) | dest_buf[i + 1]; pixel -= (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1]; dest_buf[i] = pixel >> 8; - dest_buf[i + 1] = (FX_BYTE)pixel; + dest_buf[i + 1] = (uint8_t)pixel; } } } @@ -553,7 +553,7 @@ static void TIFF_PredictLine(FX_LPBYTE dest_buf, int row_size, int BitsPerCompon FX_WORD pixel = (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1]; pixel += (dest_buf[i] << 8) | dest_buf[i + 1]; dest_buf[i] = pixel >> 8; - dest_buf[i + 1] = (FX_BYTE)pixel; + dest_buf[i + 1] = (uint8_t)pixel; } } else { for (int i = BytesPerPixel; i < row_size; i ++) { @@ -641,7 +641,7 @@ void CCodec_FlateScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, m_bpc = bpc; m_bColorTransformed = FALSE; m_Pitch = (width * nComps * bpc + 7) / 8; - m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanline = FX_Alloc(uint8_t, m_Pitch); m_Predictor = 0; if (predictor) { if (predictor >= 10) { @@ -659,9 +659,9 @@ void CCodec_FlateScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, m_BitsPerComponent = BitsPerComponent; m_Columns = Columns; m_PredictPitch = (m_BitsPerComponent * m_Colors * m_Columns + 7) / 8; - m_pLastLine = FX_Alloc(FX_BYTE, m_PredictPitch); - m_pPredictRaw = FX_Alloc(FX_BYTE, m_PredictPitch + 1); - m_pPredictBuffer = FX_Alloc(FX_BYTE, m_PredictPitch); + m_pLastLine = FX_Alloc(uint8_t, m_PredictPitch); + m_pPredictRaw = FX_Alloc(uint8_t, m_PredictPitch + 1); + m_pPredictBuffer = FX_Alloc(uint8_t, m_PredictPitch); } } } @@ -737,7 +737,7 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig FX_DWORD last_buf_size = buf_size; void* context = nullptr; - FX_LPBYTE guess_buf = FX_Alloc(FX_BYTE, guess_size + 1); + FX_LPBYTE guess_buf = FX_Alloc(uint8_t, guess_size + 1); FX_LPBYTE cur_buf = guess_buf; guess_buf[guess_size] = '\0'; context = FPDFAPI_FlateInit(my_alloc_func, my_free_func); @@ -746,10 +746,10 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig FPDFAPI_FlateInput(context, src_buf, src_size); if (useOldImpl) { while (1) { - FX_INT32 ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size); + int32_t ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size); if (ret != Z_OK) break; - FX_INT32 avail_buf_size = FPDFAPI_FlateGetAvailOut(context); + int32_t avail_buf_size = FPDFAPI_FlateGetAvailOut(context); if (avail_buf_size != 0) break; @@ -758,7 +758,7 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig guess_size += alloc_step; if (guess_size < old_size || guess_size + 1 < guess_size) goto fail; - guess_buf = FX_Realloc(FX_BYTE, guess_buf, guess_size + 1); + guess_buf = FX_Realloc(uint8_t, guess_buf, guess_size + 1); if (!guess_buf) goto fail; guess_buf[guess_size] = '\0'; @@ -768,7 +768,7 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig dest_size = FPDFAPI_FlateGetTotalOut(context); offset = FPDFAPI_FlateGetTotalIn(context); if (guess_size / 2 > dest_size) { - guess_buf = FX_Realloc(FX_BYTE, guess_buf, dest_size + 1); + guess_buf = FX_Realloc(uint8_t, guess_buf, dest_size + 1); if (!guess_buf) goto fail; guess_size = dest_size; @@ -778,8 +778,8 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig } else { CFX_ArrayTemplate<FX_LPBYTE> result_tmp_bufs; while (1) { - FX_INT32 ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size); - FX_INT32 avail_buf_size = FPDFAPI_FlateGetAvailOut(context); + int32_t ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size); + int32_t avail_buf_size = FPDFAPI_FlateGetAvailOut(context); if (ret != Z_OK) { last_buf_size = buf_size - avail_buf_size; result_tmp_bufs.Add(cur_buf); @@ -793,7 +793,7 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig // |avail_buf_size| == 0 case. result_tmp_bufs.Add(cur_buf); - cur_buf = FX_Alloc(FX_BYTE, buf_size + 1); + cur_buf = FX_Alloc(uint8_t, buf_size + 1); cur_buf[buf_size] = '\0'; } dest_size = FPDFAPI_FlateGetTotalOut(context); @@ -801,9 +801,9 @@ static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig if (result_tmp_bufs.GetSize() == 1) { dest_buf = result_tmp_bufs[0]; } else { - FX_LPBYTE result_buf = FX_Alloc(FX_BYTE, dest_size); + FX_LPBYTE result_buf = FX_Alloc(uint8_t, dest_size); FX_DWORD result_pos = 0; - for (FX_INT32 i = 0; i < result_tmp_bufs.GetSize(); i++) { + for (int32_t i = 0; i < result_tmp_bufs.GetSize(); i++) { FX_LPBYTE tmp_buf = result_tmp_bufs[i]; FX_DWORD tmp_buf_size = buf_size; if (i == result_tmp_bufs.GetSize() - 1) { @@ -832,7 +832,7 @@ ICodec_ScanlineDecoder* CCodec_FlateModule::CreateDecoder(FX_LPCBYTE src_buf, FX pDecoder->Create(src_buf, src_size, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, Columns); return pDecoder; } -FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, +FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { @@ -859,7 +859,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_b } { nonstd::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder); - dest_buf = FX_Alloc( FX_BYTE, dest_size + 1); + dest_buf = FX_Alloc( uint8_t, dest_size + 1); dest_buf[dest_size] = '\0'; decoder->Decode(dest_buf, dest_size, src_buf, offset, bEarlyChange); } @@ -879,7 +879,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_b } return ret ? offset : -1; } -FX_BOOL CCodec_FlateModule::Encode(const FX_BYTE* src_buf, FX_DWORD src_size, +FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { @@ -887,7 +887,7 @@ FX_BOOL CCodec_FlateModule::Encode(const FX_BYTE* src_buf, FX_DWORD src_size, return Encode(src_buf, src_size, dest_buf, dest_size); } FX_LPBYTE pSrcBuf = NULL; - pSrcBuf = FX_Alloc(FX_BYTE, src_size); + pSrcBuf = FX_Alloc(uint8_t, src_size); FXSYS_memcpy32(pSrcBuf, src_buf, src_size); FX_BOOL ret = TRUE; if (predictor == 2) { @@ -905,7 +905,7 @@ FX_BOOL CCodec_FlateModule::Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL CCodec_FlateModule::Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) { dest_size = src_size + src_size / 1000 + 12; - dest_buf = FX_Alloc( FX_BYTE, dest_size); + dest_buf = FX_Alloc( uint8_t, dest_size); unsigned long temp_size = dest_size; FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); dest_size = (FX_DWORD)temp_size; diff --git a/core/src/fxcodec/codec/fx_codec_gif.cpp b/core/src/fxcodec/codec/fx_codec_gif.cpp index 1fc708db5c..218b58a946 100644 --- a/core/src/fxcodec/codec/fx_codec_gif.cpp +++ b/core/src/fxcodec/codec/fx_codec_gif.cpp @@ -33,7 +33,7 @@ static void _gif_error_data(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg) FXSYS_strncpy((char*)gif_ptr->err_ptr, err_msg, GIF_MAX_ERROR_SIZE - 1);
longjmp(gif_ptr->jmpbuf, 1);
}
-static FX_LPBYTE _gif_ask_buf_for_pal(gif_decompress_struct_p gif_ptr, FX_INT32 pal_size)
+static FX_LPBYTE _gif_ask_buf_for_pal(gif_decompress_struct_p gif_ptr, int32_t pal_size)
{
FXGIF_Context* p = (FXGIF_Context*)gif_ptr->context_ptr;
CCodec_GifModule* pModule = (CCodec_GifModule*)p->parent_ptr;
@@ -47,17 +47,17 @@ static void _gif_record_current_position(gif_decompress_struct_p gif_ptr, FX_DWO CCodec_GifModule* pModule = (CCodec_GifModule*)p->parent_ptr;
pModule->RecordCurrentPositionCallback(p->child_ptr, *cur_pos_ptr);
}
-static void _gif_read_scanline(gif_decompress_struct_p gif_ptr, FX_INT32 row_num, FX_LPBYTE row_buf)
+static void _gif_read_scanline(gif_decompress_struct_p gif_ptr, int32_t row_num, FX_LPBYTE row_buf)
{
FXGIF_Context* p = (FXGIF_Context*)gif_ptr->context_ptr;
CCodec_GifModule* pModule = (CCodec_GifModule*)p->parent_ptr;
pModule->ReadScanlineCallback(p->child_ptr, row_num, row_buf);
}
static FX_BOOL _gif_get_record_position(gif_decompress_struct_p gif_ptr, FX_DWORD cur_pos,
- FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace)
+ int32_t left, int32_t top, int32_t width, int32_t height,
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace)
{
FXGIF_Context* p = (FXGIF_Context*)gif_ptr->context_ptr;
CCodec_GifModule* pModule = (CCodec_GifModule*)p->parent_ptr;
@@ -66,7 +66,7 @@ static FX_BOOL _gif_get_record_position(gif_decompress_struct_p gif_ptr, FX_DWOR }
void* CCodec_GifModule::Start(void* pModule)
{
- FXGIF_Context* p = (FXGIF_Context*)FX_Alloc(FX_BYTE, sizeof(FXGIF_Context));
+ FXGIF_Context* p = (FXGIF_Context*)FX_Alloc(uint8_t, sizeof(FXGIF_Context));
if (p == NULL) {
return NULL;
}
@@ -98,14 +98,14 @@ void CCodec_GifModule::Finish(void* pContext) p->m_FreeFunc(p);
}
}
-FX_INT32 CCodec_GifModule::ReadHeader(void* pContext, int* width, int* height,
+int32_t CCodec_GifModule::ReadHeader(void* pContext, int* width, int* height,
int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute)
{
FXGIF_Context* p = (FXGIF_Context*)pContext;
if(setjmp(p->gif_ptr->jmpbuf)) {
return 0;
}
- FX_INT32 ret = _gif_read_header(p->gif_ptr);
+ int32_t ret = _gif_read_header(p->gif_ptr);
if (ret != 1) {
return ret;
}
@@ -118,26 +118,26 @@ FX_INT32 CCodec_GifModule::ReadHeader(void* pContext, int* width, int* height, *bg_index = p->gif_ptr->bc_index;
return 1;
}
-FX_INT32 CCodec_GifModule::LoadFrameInfo(void* pContext, int* frame_num)
+int32_t CCodec_GifModule::LoadFrameInfo(void* pContext, int* frame_num)
{
FXGIF_Context* p = (FXGIF_Context*)pContext;
if(setjmp(p->gif_ptr->jmpbuf)) {
return 0;
}
- FX_INT32 ret = _gif_get_frame(p->gif_ptr);
+ int32_t ret = _gif_get_frame(p->gif_ptr);
if (ret != 1) {
return ret;
}
*frame_num = _gif_get_frame_num(p->gif_ptr);
return 1;
}
-FX_INT32 CCodec_GifModule::LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute)
+int32_t CCodec_GifModule::LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute)
{
FXGIF_Context* p = (FXGIF_Context*)pContext;
if(setjmp(p->gif_ptr->jmpbuf)) {
return 0;
}
- FX_INT32 ret = _gif_load_frame(p->gif_ptr, frame_num);
+ int32_t ret = _gif_load_frame(p->gif_ptr, frame_num);
if (ret == 1) {
if (pAttribute) {
pAttribute->m_nGifLeft = p->gif_ptr->img_ptr_arr_ptr->GetAt(frame_num)->image_info_ptr->left;
@@ -147,7 +147,7 @@ FX_INT32 CCodec_GifModule::LoadFrame(void* pContext, int frame_num, CFX_DIBAttri FX_LPCBYTE buf = (FX_LPCBYTE)p->gif_ptr->cmt_data_ptr->GetBuffer(0);
FX_DWORD len = p->gif_ptr->cmt_data_ptr->GetLength();
if (len > 21) {
- FX_BYTE size = *buf++;
+ uint8_t size = *buf++;
if (size) {
pAttribute->m_strAuthor = CFX_ByteString(buf, size);
} else {
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp index 26b4c1adfc..cde5d4c1bd 100644 --- a/core/src/fxcodec/codec/fx_codec_icc.cpp +++ b/core/src/fxcodec/codec/fx_codec_icc.cpp @@ -13,7 +13,7 @@ const FX_DWORD N_COMPONENT_RGB = 3; const FX_DWORD N_COMPONENT_CMYK = 4; const FX_DWORD N_COMPONENT_DEFAULT = 3; -FX_BOOL MD5ComputeID( FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16] ) +FX_BOOL MD5ComputeID( FX_LPCVOID buf, FX_DWORD dwSize, uint8_t ID[16] ) { return cmsMD5computeIDExt(buf, dwSize, ID); } @@ -65,7 +65,7 @@ FX_BOOL CheckComponents(cmsColorSpaceSignature cs, int nComponents, FX_BOOL bDst } return TRUE; } -FX_INT32 GetCSComponents(cmsColorSpaceSignature cs) +int32_t GetCSComponents(cmsColorSpaceSignature cs) { FX_DWORD components; switch (cs) { @@ -87,8 +87,8 @@ FX_INT32 GetCSComponents(cmsColorSpaceSignature cs) } return components; } -void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, - const unsigned char* pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 nDstComponents, +void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents, + const unsigned char* pDstProfileData, FX_DWORD dwDstProfileSize, int32_t nDstComponents, int intent, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT) { cmsHPROFILE srcProfile = NULL; @@ -157,7 +157,7 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSr cmsCloseProfile(dstProfile); return pCmm; } -void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, FX_DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent, FX_DWORD dwSrcFormat) +void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent, FX_DWORD dwSrcFormat) { return IccLib_CreateTransform(pProfileData, dwProfileSize, nComponents, NULL, 0, 3, intent, dwSrcFormat); } @@ -175,7 +175,7 @@ void IccLib_Translate(void* pTransform, FX_DWORD nSrcComponents, FX_FLOAT* pSrcV return; } CLcmsCmm* p = (CLcmsCmm*)pTransform; - FX_BYTE output[4]; + uint8_t output[4]; if (p->m_bLab) { CFX_FixedBufGrow<double, 16> inputs(nSrcComponents); double* input = inputs; @@ -184,8 +184,8 @@ void IccLib_Translate(void* pTransform, FX_DWORD nSrcComponents, FX_FLOAT* pSrcV } cmsDoTransform(p->m_hTransform, input, output, 1); } else { - CFX_FixedBufGrow<FX_BYTE, 16> inputs(nSrcComponents); - FX_BYTE* input = inputs; + CFX_FixedBufGrow<uint8_t, 16> inputs(nSrcComponents); + uint8_t* input = inputs; for (FX_DWORD i = 0; i < nSrcComponents; i ++) { if (pSrcValues[i] > 1.0f) { input[i] = 255; @@ -214,7 +214,7 @@ void IccLib_Translate(void* pTransform, FX_DWORD nSrcComponents, FX_FLOAT* pSrcV break; } } -void IccLib_TranslateImage(void* pTransform, unsigned char* pDest, const unsigned char* pSrc, FX_INT32 pixels) +void IccLib_TranslateImage(void* pTransform, unsigned char* pDest, const unsigned char* pSrc, int32_t pixels) { cmsDoTransform(((CLcmsCmm*)pTransform)->m_hTransform, (void*)pSrc, pDest, pixels); } @@ -284,7 +284,7 @@ ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(IFX_FileRead* pFile) } ICodec_IccModule::IccCS cs; FX_DWORD dwSize = (FX_DWORD)pFile->GetSize(); - FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, dwSize); + FX_LPBYTE pBuf = FX_Alloc(uint8_t, dwSize); pFile->ReadBlock(pBuf, 0, dwSize); cs = GetProfileCS(pBuf, dwSize); FX_Free(pBuf); @@ -406,7 +406,7 @@ FX_LPVOID CCodec_IccModule::CreateProfile(ICodec_IccModule::IccParam* pIccParam, CFX_ByteStringKey key; CFX_ByteString text; key << pIccParam->ColorSpace << (pIccParam->dwProfileType | ic << 8); - FX_BYTE ID[16]; + uint8_t ID[16]; switch (pIccParam->dwProfileType) { case Icc_PARAMTYPE_NONE: return NULL; @@ -526,12 +526,12 @@ CCodec_IccModule::~CCodec_IccModule() } } } -void* CCodec_IccModule::CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent, FX_DWORD dwSrcFormat) +void* CCodec_IccModule::CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent, FX_DWORD dwSrcFormat) { return IccLib_CreateTransform_sRGB(pProfileData, dwProfileSize, nComponents, intent, dwSrcFormat); } -void* CCodec_IccModule::CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, - FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 intent, +void* CCodec_IccModule::CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents, + FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent, FX_DWORD dwSrcFormat , FX_DWORD dwDstFormat) { return IccLib_CreateTransform(pSrcProfileData, dwSrcProfileSize, nSrcComponents, @@ -545,11 +545,11 @@ void CCodec_IccModule::Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOA { IccLib_Translate(pTransform, m_nComponents, pSrcValues, pDestValues); } -void CCodec_IccModule::TranslateScanline(void* pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, FX_INT32 pixels) +void CCodec_IccModule::TranslateScanline(void* pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int32_t pixels) { IccLib_TranslateImage(pTransform, pDest, pSrc, pixels); } -const FX_BYTE g_CMYKSamples[81 * 81 * 3] = { +const uint8_t g_CMYKSamples[81 * 81 * 3] = { 255, 255, 255, 225, 226, 228, 199, 200, 202, 173, 174, 178, 147, 149, 152, 123, 125, 128, 99, 99, 102, 69, 70, 71, 34, 30, 31, 255, 253, 229, 226, 224, 203, 200, 199, 182, 173, 173, 158, 149, 148, 135, 125, 124, 113, 99, 99, 90, 70, 69, 63, 33, 29, 24, 255, 251, 204, 228, 223, 182, 201, 198, 163, 174, 172, 142, 150, 147, 122, 125, 123, 101, 99, 98, 80, 70, 68, 54, 32, 28, 16, @@ -1280,7 +1280,7 @@ const FX_BYTE g_CMYKSamples[81 * 81 * 3] = { 53, 53, 66, 47, 44, 57, 40, 36, 48, 32, 27, 39, 22, 18, 30, 9, 4, 18, 0, 0, 3, 0, 0, 0, 0, 0, 0, 54, 53, 57, 48, 45, 49, 41, 37, 41, 33, 28, 32, 22, 19, 23, 11, 6, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, }; -void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B) +void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t m, uint8_t y, uint8_t k, uint8_t& R, uint8_t& G, uint8_t& B) { int fix_c = c << 8; int fix_m = m << 8; @@ -1357,11 +1357,11 @@ void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, } void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) { - FX_BYTE c1 = FXSYS_round(c * 255); - FX_BYTE m1 = FXSYS_round(m * 255); - FX_BYTE y1 = FXSYS_round(y * 255); - FX_BYTE k1 = FXSYS_round(k * 255); - FX_BYTE r, g, b; + uint8_t c1 = FXSYS_round(c * 255); + uint8_t m1 = FXSYS_round(m * 255); + uint8_t y1 = FXSYS_round(y * 255); + uint8_t k1 = FXSYS_round(k * 255); + uint8_t r, g, b; AdobeCMYK_to_sRGB1(c1, m1, y1, k1, r, g, b); R = 1.0f * r / 255; G = 1.0f * g / 255; diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp index 8fcd9f4711..622448d659 100644 --- a/core/src/fxcodec/codec/fx_codec_jbig.cpp +++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp @@ -52,7 +52,7 @@ FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr, CJBig2_Context* pContext = NULL; CJBig2_Image* dest_image = NULL; FX_DWORD src_size = (FX_DWORD)file_ptr->GetSize(); - FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size); + FX_LPBYTE src_buf = FX_Alloc(uint8_t, src_size); int ret = 0; if(!file_ptr->ReadBlock(src_buf, 0, src_size)) { goto failed; @@ -129,7 +129,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead m_pJbig2Context->m_bFileReader = TRUE; m_pJbig2Context->m_dest_image = NULL; m_pJbig2Context->m_src_size = (FX_DWORD)file_ptr->GetSize(); - m_pJbig2Context->m_src_buf = FX_Alloc(FX_BYTE, m_pJbig2Context->m_src_size); + m_pJbig2Context->m_src_buf = FX_Alloc(uint8_t, m_pJbig2Context->m_src_size); int ret = 0; if(!file_ptr->ReadBlock((void*)m_pJbig2Context->m_src_buf, 0, m_pJbig2Context->m_src_size)) { goto failed; diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp index 7d18cb599f..4d06a77067 100644 --- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp @@ -12,7 +12,7 @@ #include "codec_int.h" extern "C" { - static void _JpegScanSOI(const FX_BYTE*& src_buf, FX_DWORD& src_size) + static void _JpegScanSOI(const uint8_t*& src_buf, FX_DWORD& src_size) { if (src_size == 0) { return; @@ -95,8 +95,8 @@ static FX_BOOL _JpegLoadIccProfile(j_decompress_ptr cinfo, FX_LPBYTE* icc_buf_pt *icc_length = 0; FX_LPBYTE icc_data_ptr = NULL; FX_DWORD icc_data_len = 0; - FX_BYTE count_icc_marker = 0; - FX_BYTE num_icc_marker = 0; + uint8_t count_icc_marker = 0; + uint8_t num_icc_marker = 0; jpeg_saved_marker_ptr marker_list[256] = {NULL}; for (jpeg_saved_marker_ptr cur_marker = cinfo->marker_list; cur_marker != NULL; @@ -126,7 +126,7 @@ static FX_BOOL _JpegLoadIccProfile(j_decompress_ptr cinfo, FX_LPBYTE* icc_buf_pt if(num_icc_marker == 0) { return TRUE; } - icc_data_ptr = FX_Alloc(FX_BYTE, icc_data_len); + icc_data_ptr = FX_Alloc(uint8_t, icc_data_len); if(icc_buf_ptr == NULL) { return FALSE; } @@ -150,15 +150,15 @@ static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, FX_LPCBYTE icc_buf_ptr return FALSE; } FX_DWORD icc_data_length = JPEG_OVERHEAD_LEN + (icc_segment_num > 1 ? icc_segment_size : icc_length); - FX_LPBYTE icc_data = FX_Alloc(FX_BYTE, icc_data_length); + FX_LPBYTE icc_data = FX_Alloc(uint8_t, icc_data_length); FXSYS_memcpy32(icc_data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12); - icc_data[13] = (FX_BYTE)icc_segment_num; - for (FX_BYTE i = 0; i < (icc_segment_num - 1); i++) { + icc_data[13] = (uint8_t)icc_segment_num; + for (uint8_t i = 0; i < (icc_segment_num - 1); i++) { icc_data[12] = i + 1; FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + i * icc_segment_size, icc_segment_size); jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, icc_data_length); } - icc_data[12] = (FX_BYTE)icc_segment_num; + icc_data[12] = (uint8_t)icc_segment_num; FX_DWORD icc_size = (icc_segment_num - 1) * icc_segment_size; FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + icc_size, icc_length - icc_size); jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, JPEG_OVERHEAD_LEN + icc_length - icc_size); @@ -206,11 +206,11 @@ static void _JpegEncode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_ST dest_buf = nullptr; } else { dest_buf_length = safe_buf_len.ValueOrDie(); - dest_buf = FX_TryAlloc(FX_BYTE, dest_buf_length); + dest_buf = FX_TryAlloc(uint8_t, dest_buf_length); const int MIN_TRY_BUF_LEN = 1024; while (!dest_buf && dest_buf_length > MIN_TRY_BUF_LEN) { dest_buf_length >>= 1; - dest_buf = FX_TryAlloc(FX_BYTE, dest_buf_length); + dest_buf = FX_TryAlloc(uint8_t, dest_buf_length); } } if (!dest_buf) { @@ -235,7 +235,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_ST } FX_LPBYTE line_buf = NULL; if (nComponents > 1) { - line_buf = FX_Alloc2D(FX_BYTE, width, nComponents); + line_buf = FX_Alloc2D(uint8_t, width, nComponents); } jpeg_set_defaults(&cinfo); if(quality != 75) { @@ -269,7 +269,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_ST row = cinfo.next_scanline; jpeg_write_scanlines(&cinfo, row_pointer, 1); if (cinfo.next_scanline == row) { - dest_buf = FX_Realloc(FX_BYTE, dest_buf, dest_buf_length + JPEG_BLOCK_SIZE); + dest_buf = FX_Realloc(uint8_t, dest_buf, dest_buf_length + JPEG_BLOCK_SIZE); dest.next_output_byte = dest_buf + dest_buf_length - dest.free_in_buffer; dest_buf_length += JPEG_BLOCK_SIZE; dest.free_in_buffer += JPEG_BLOCK_SIZE; @@ -477,7 +477,7 @@ FX_BOOL CCodec_JpegDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int wi return FALSE; } m_Pitch = (cinfo.image_width * cinfo.num_components + 3) / 4 * 4; - m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch); m_nComps = cinfo.num_components; m_bpc = 8; m_bColorTransformed = FALSE; @@ -485,7 +485,7 @@ FX_BOOL CCodec_JpegDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int wi return TRUE; } extern "C" { - FX_INT32 FX_GetDownsampleRatio(FX_INT32 originWidth, FX_INT32 originHeight, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight) + int32_t FX_GetDownsampleRatio(int32_t originWidth, int32_t originHeight, int32_t downsampleWidth, int32_t downsampleHeight) { int iratio_w = originWidth / downsampleWidth; int iratio_h = originHeight / downsampleHeight; @@ -637,7 +637,7 @@ void* CCodec_JpegModule::Start() if (m_pExtProvider) { return m_pExtProvider->Start(); } - FXJPEG_Context* p = (FXJPEG_Context*)FX_Alloc(FX_BYTE, sizeof(FXJPEG_Context)); + FXJPEG_Context* p = (FXJPEG_Context*)FX_Alloc(uint8_t, sizeof(FXJPEG_Context)); p->m_AllocFunc = jpeg_alloc_func; p->m_FreeFunc = jpeg_free_func; p->m_ErrMgr.error_exit = _error_fatal1; diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp index 1a1616c0a1..01faf67a30 100644 --- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp +++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp @@ -714,7 +714,7 @@ FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateCo return FALSE; } FXSYS_memset8(dest_buf, 0xff, image->y1 * pitch); - FX_BYTE** channel_bufs = FX_Alloc(FX_BYTE*, image->numcomps); + uint8_t** channel_bufs = FX_Alloc(uint8_t*, image->numcomps); FX_BOOL result = FALSE; int* adjust_comps = FX_Alloc(int, image->numcomps); for (i = 0; i < (int)image->numcomps; i ++) { @@ -742,7 +742,7 @@ FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateCo if (adjust_comps[channel] > 0) { *pPixel = 0; } else { - *pPixel = (FX_BYTE)(src << -adjust_comps[channel]); + *pPixel = (uint8_t)(src << -adjust_comps[channel]); } } } @@ -757,7 +757,7 @@ FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateCo src = image->comps[channel].data[row * wid + col]; src += image->comps[channel].sgnd ? 1 << (image->comps[channel].prec - 1) : 0; if (adjust_comps[channel] - 1 < 0) { - *pPixel = (FX_BYTE)((src >> adjust_comps[channel])); + *pPixel = (uint8_t)((src >> adjust_comps[channel])); } else { int tmpPixel = (src >> adjust_comps[channel]) + ((src >> (adjust_comps[channel] - 1)) % 2); if (tmpPixel > 255) { @@ -765,7 +765,7 @@ FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateCo } else if (tmpPixel < 0) { tmpPixel = 0; } - *pPixel = (FX_BYTE)tmpPixel; + *pPixel = (uint8_t)tmpPixel; } } } diff --git a/core/src/fxcodec/codec/fx_codec_png.cpp b/core/src/fxcodec/codec/fx_codec_png.cpp index ea5ffaf68a..8cb24ba2fa 100644 --- a/core/src/fxcodec/codec/fx_codec_png.cpp +++ b/core/src/fxcodec/codec/fx_codec_png.cpp @@ -191,7 +191,7 @@ static void _png_get_row_func(png_structp png_ptr, png_bytep new_row, png_uint_3 }
void* CCodec_PngModule::Start(void* pModule)
{
- FXPNG_Context* p = (FXPNG_Context*)FX_Alloc(FX_BYTE, sizeof(FXPNG_Context));
+ FXPNG_Context* p = (FXPNG_Context*)FX_Alloc(uint8_t, sizeof(FXPNG_Context));
if(p == NULL) {
return NULL;
}
diff --git a/core/src/fxcodec/codec/fx_codec_progress.cpp b/core/src/fxcodec/codec/fx_codec_progress.cpp index 0a51a9d437..d6ef06311c 100644 --- a/core/src/fxcodec/codec/fx_codec_progress.cpp +++ b/core/src/fxcodec/codec/fx_codec_progress.cpp @@ -21,7 +21,7 @@ void CFXCODEC_WeightTable::Calc(int dest_len, int dest_min, int dest_max, int sr }
m_ItemSize = (int)(sizeof(int) * 2 + sizeof(int) * (FXSYS_ceil(FXSYS_fabs((FX_FLOAT)scale)) + 1));
m_DestMin = dest_min;
- m_pWeightTables = FX_Alloc(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4);
+ m_pWeightTables = FX_Alloc(uint8_t, (dest_max - dest_min) * m_ItemSize + 4);
if(m_pWeightTables == NULL) {
return;
}
@@ -103,7 +103,7 @@ void CFXCODEC_HorzTable::Calc(int dest_len, int src_len, FX_BOOL bInterpol) double scale = (double)dest_len / (double)src_len;
m_ItemSize = sizeof(int) * 4;
int size = dest_len * m_ItemSize + 4;
- m_pWeightTables = FX_Alloc(FX_BYTE, size);
+ m_pWeightTables = FX_Alloc(uint8_t, size);
if(m_pWeightTables == NULL) {
return;
}
@@ -160,7 +160,7 @@ void CFXCODEC_VertTable::Calc(int dest_len, int src_len) double scale = (double)dest_len / (double)src_len;
m_ItemSize = sizeof(int) * 4;
int size = dest_len * m_ItemSize + 4;
- m_pWeightTables = FX_Alloc(FX_BYTE, size);
+ m_pWeightTables = FX_Alloc(uint8_t, size);
if(m_pWeightTables == NULL) {
return;
}
@@ -288,7 +288,7 @@ FX_BOOL CCodec_ProgressiveDecoder::JpegReadMoreData(ICodec_JpegModule* pJpegModu dwSize = FXCODEC_BLOCK_SIZE;
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) / FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(FX_BYTE, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return FALSE;
@@ -360,17 +360,17 @@ FX_BOOL CCodec_ProgressiveDecoder::PngAskScanlineBufFunc(void* pModule, int line }
if(line >= pCodec->m_clipBox.top && line < pCodec->m_clipBox.bottom) {
double scale_y = (double)pCodec->m_sizeY / (double)pCodec->m_clipBox.Height();
- FX_INT32 row = (FX_INT32)((line - pCodec->m_clipBox.top) * scale_y) + pCodec->m_startY;
+ int32_t row = (int32_t)((line - pCodec->m_clipBox.top) * scale_y) + pCodec->m_startY;
FX_LPBYTE src_scan = (FX_LPBYTE)pDIBitmap->GetScanline(row);
FX_LPBYTE des_scan = pCodec->m_pDecodeBuf;
src_buf = pCodec->m_pDecodeBuf;
- FX_INT32 src_Bpp = pDIBitmap->GetBPP() >> 3;
- FX_INT32 des_Bpp = (pCodec->m_SrcFormat & 0xff) >> 3;
- FX_INT32 src_left = pCodec->m_startX;
- FX_INT32 des_left = pCodec->m_clipBox.left;
+ int32_t src_Bpp = pDIBitmap->GetBPP() >> 3;
+ int32_t des_Bpp = (pCodec->m_SrcFormat & 0xff) >> 3;
+ int32_t src_left = pCodec->m_startX;
+ int32_t des_left = pCodec->m_clipBox.left;
src_scan += src_left * src_Bpp;
des_scan += des_left * des_Bpp;
- for (FX_INT32 src_col = 0; src_col < pCodec->m_sizeX; src_col++) {
+ for (int32_t src_col = 0; src_col < pCodec->m_sizeX; src_col++) {
PixelWeight* pPixelWeights = pCodec->m_WeightHorzOO.GetPixelWeight(src_col);
if(pPixelWeights->m_SrcStart != pPixelWeights->m_SrcEnd) {
continue;
@@ -387,7 +387,7 @@ FX_BOOL CCodec_ProgressiveDecoder::PngAskScanlineBufFunc(void* pModule, int line }
FX_DWORD des_g = 0;
des_g += pPixelWeights->m_Weights[0] * src_scan[src_col];
- des_scan[pPixelWeights->m_SrcStart] = (FX_BYTE)(des_g >> 16);
+ des_scan[pPixelWeights->m_SrcStart] = (uint8_t)(des_g >> 16);
}
break;
case FXDIB_Rgb:
@@ -398,9 +398,9 @@ FX_BOOL CCodec_ProgressiveDecoder::PngAskScanlineBufFunc(void* pModule, int line des_g += pPixelWeights->m_Weights[0] * (*p++);
des_r += pPixelWeights->m_Weights[0] * (*p);
FX_LPBYTE pDes = &des_scan[pPixelWeights->m_SrcStart * des_Bpp];
- *pDes++ = (FX_BYTE)((des_b) >> 16);
- *pDes++ = (FX_BYTE)((des_g) >> 16);
- *pDes = (FX_BYTE)((des_r) >> 16);
+ *pDes++ = (uint8_t)((des_b) >> 16);
+ *pDes++ = (uint8_t)((des_g) >> 16);
+ *pDes = (uint8_t)((des_r) >> 16);
}
break;
case FXDIB_Argb: {
@@ -410,9 +410,9 @@ FX_BOOL CCodec_ProgressiveDecoder::PngAskScanlineBufFunc(void* pModule, int line des_g += pPixelWeights->m_Weights[0] * (*p++);
des_r += pPixelWeights->m_Weights[0] * (*p++);
FX_LPBYTE pDes = &des_scan[pPixelWeights->m_SrcStart * des_Bpp];
- *pDes++ = (FX_BYTE)((des_b) >> 16);
- *pDes++ = (FX_BYTE)((des_g) >> 16);
- *pDes++ = (FX_BYTE)((des_r) >> 16);
+ *pDes++ = (uint8_t)((des_b) >> 16);
+ *pDes++ = (uint8_t)((des_g) >> 16);
+ *pDes++ = (uint8_t)((des_r) >> 16);
*pDes = *p;
}
break;
@@ -423,16 +423,16 @@ FX_BOOL CCodec_ProgressiveDecoder::PngAskScanlineBufFunc(void* pModule, int line }
return TRUE;
}
-void CCodec_ProgressiveDecoder::PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, FX_INT32 des_line, FX_LPBYTE src_scan, FXCodec_Format src_format)
+void CCodec_ProgressiveDecoder::PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, int32_t des_line, FX_LPBYTE src_scan, FXCodec_Format src_format)
{
FX_LPBYTE des_scan = (FX_LPBYTE)pDeviceBitmap->GetScanline(des_line);
- FX_INT32 src_Bpp = (m_SrcFormat & 0xff) >> 3;
- FX_INT32 des_Bpp = pDeviceBitmap->GetBPP() >> 3;
- FX_INT32 src_left = m_clipBox.left;
- FX_INT32 des_left = m_startX;
+ int32_t src_Bpp = (m_SrcFormat & 0xff) >> 3;
+ int32_t des_Bpp = pDeviceBitmap->GetBPP() >> 3;
+ int32_t src_left = m_clipBox.left;
+ int32_t des_left = m_startX;
src_scan += src_left * src_Bpp;
des_scan += des_left * des_Bpp;
- for (FX_INT32 des_col = 0; des_col < m_sizeX; des_col++) {
+ for (int32_t des_col = 0; des_col < m_sizeX; des_col++) {
PixelWeight* pPixelWeights = m_WeightHorzOO.GetPixelWeight(des_col);
switch(pDeviceBitmap->GetFormat()) {
case FXDIB_1bppMask:
@@ -447,7 +447,7 @@ void CCodec_ProgressiveDecoder::PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBi FX_DWORD des_g = 0;
des_g += pPixelWeights->m_Weights[0] * src_scan[pPixelWeights->m_SrcStart];
des_g += pPixelWeights->m_Weights[1] * src_scan[pPixelWeights->m_SrcEnd];
- *des_scan++ = (FX_BYTE)(des_g >> 16);
+ *des_scan++ = (uint8_t)(des_g >> 16);
}
break;
case FXDIB_Rgb:
@@ -462,9 +462,9 @@ void CCodec_ProgressiveDecoder::PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBi des_b += pPixelWeights->m_Weights[1] * (*p++);
des_g += pPixelWeights->m_Weights[1] * (*p++);
des_r += pPixelWeights->m_Weights[1] * (*p);
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
des_scan += des_Bpp - 3;
}
break;
@@ -481,10 +481,10 @@ void CCodec_ProgressiveDecoder::PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBi des_g += pPixelWeights->m_Weights[1] * (*p++);
des_r += pPixelWeights->m_Weights[1] * (*p++);
des_a += pPixelWeights->m_Weights[1] * (*p);
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
- *des_scan++ = (FX_BYTE)((des_a) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_a) >> 16);
}
break;
default:
@@ -532,7 +532,7 @@ FX_BOOL CCodec_ProgressiveDecoder::GifReadMoreData(ICodec_GifModule* pGifModule, dwSize = FXCODEC_BLOCK_SIZE;
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) / FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(FX_BYTE, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return FALSE;
@@ -560,14 +560,14 @@ void CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback(void* pModule, FX_DWORD remain_size = pCodec->m_pCodecMgr->GetGifModule()->GetAvailInput(pCodec->m_pGifContext);
cur_pos = pCodec->m_offSet - remain_size;
}
-FX_LPBYTE CCodec_ProgressiveDecoder::GifAskLocalPaletteBufCallback(void* pModule, FX_INT32 frame_num, FX_INT32 pal_size)
+FX_LPBYTE CCodec_ProgressiveDecoder::GifAskLocalPaletteBufCallback(void* pModule, int32_t frame_num, int32_t pal_size)
{
- return FX_Alloc(FX_BYTE, pal_size);
+ return FX_Alloc(uint8_t, pal_size);
}
FX_BOOL CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace)
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace)
{
CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
pCodec->m_offSet = rcd_pos;
@@ -599,7 +599,7 @@ FX_BOOL CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback(void* pModu pCodec->m_GifTransIndex = trans_index;
pCodec->m_GifFrameRect = img_rc;
pCodec->m_SrcPassNumber = interlace ? 4 : 1;
- FX_INT32 pal_index = pCodec->m_GifBgIndex;
+ int32_t pal_index = pCodec->m_GifBgIndex;
CFX_DIBitmap* pDevice = pCodec->m_pDeviceBitmap;
if (trans_index >= pal_num) {
trans_index = -1;
@@ -620,7 +620,7 @@ FX_BOOL CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback(void* pModu FX_LPBYTE pScanline = (FX_LPBYTE)pDevice->GetScanline(row + startY) + startX * Bpp;
switch(pCodec->m_TransMethod) {
case 3: {
- FX_BYTE gray = FXRGB2GRAY(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
+ uint8_t gray = FXRGB2GRAY(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
FXSYS_memset8(pScanline, gray, sizeX);
break;
}
@@ -644,12 +644,12 @@ FX_BOOL CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback(void* pModu }
return TRUE;
}
-void CCodec_ProgressiveDecoder::GifReadScanlineCallback(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf)
+void CCodec_ProgressiveDecoder::GifReadScanlineCallback(void* pModule, int32_t row_num, FX_LPBYTE row_buf)
{
CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
CFX_DIBitmap* pDIBitmap = pCodec->m_pDeviceBitmap;
ASSERT(pDIBitmap != NULL);
- FX_INT32 img_width = pCodec->m_GifFrameRect.Width();
+ int32_t img_width = pCodec->m_GifFrameRect.Width();
if (!pDIBitmap->HasAlpha()) {
FX_LPBYTE byte_ptr = row_buf;
for (int i = 0; i < img_width; i++ ) {
@@ -659,14 +659,14 @@ void CCodec_ProgressiveDecoder::GifReadScanlineCallback(void* pModule, FX_INT32 byte_ptr++;
}
}
- FX_INT32 pal_index = pCodec->m_GifBgIndex;
+ int32_t pal_index = pCodec->m_GifBgIndex;
if (pCodec->m_GifTransIndex != -1 && pCodec->m_pDeviceBitmap->HasAlpha()) {
pal_index = pCodec->m_GifTransIndex;
}
FXSYS_memset8(pCodec->m_pDecodeBuf, pal_index, pCodec->m_SrcWidth);
FX_BOOL bLastPass = ((row_num % 2) == 1) ? TRUE : FALSE;
- FX_INT32 line = row_num + pCodec->m_GifFrameRect.top;
- FX_INT32 left = pCodec->m_GifFrameRect.left;
+ int32_t line = row_num + pCodec->m_GifFrameRect.top;
+ int32_t left = pCodec->m_GifFrameRect.left;
FXSYS_memcpy32(pCodec->m_pDecodeBuf + left, row_buf, img_width);
int src_top = pCodec->m_clipBox.top;
int src_bottom = pCodec->m_clipBox.bottom;
@@ -732,7 +732,7 @@ void CCodec_ProgressiveDecoder::GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceB int des_g = 0;
des_g += pWeight->m_Weights[0] * (*scan_src1++);
des_g += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)(des_g >> 16);
+ *scan_des++ = (uint8_t)(des_g >> 16);
}
break;
case FXDIB_Rgb:
@@ -746,9 +746,9 @@ void CCodec_ProgressiveDecoder::GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceB des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
scan_src2 += des_Bpp - 3;
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
scan_des += des_Bpp - 3;
}
break;
@@ -762,10 +762,10 @@ void CCodec_ProgressiveDecoder::GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceB des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
des_a += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
- *scan_des++ = (FX_BYTE)((des_a) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_a) >> 16);
}
break;
default:
@@ -791,7 +791,7 @@ FX_BOOL CCodec_ProgressiveDecoder::BmpReadMoreData(ICodec_BmpModule* pBmpModule, dwSize = FXCODEC_BLOCK_SIZE;
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) / FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(FX_BYTE, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return FALSE;
@@ -823,7 +823,7 @@ FX_BOOL CCodec_ProgressiveDecoder::BmpInputImagePositionBufCallback(void* pModul }
return TRUE;
}
-void CCodec_ProgressiveDecoder::BmpReadScanlineCallback(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf)
+void CCodec_ProgressiveDecoder::BmpReadScanlineCallback(void* pModule, int32_t row_num, FX_LPBYTE row_buf)
{
CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
CFX_DIBitmap* pDIBitmap = pCodec->m_pDeviceBitmap;
@@ -887,7 +887,7 @@ void CCodec_ProgressiveDecoder::ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, doub int des_g = 0;
des_g += pWeight->m_Weights[0] * (*scan_src1++);
des_g += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)(des_g >> 16);
+ *scan_des++ = (uint8_t)(des_g >> 16);
}
break;
case FXDIB_Rgb:
@@ -901,9 +901,9 @@ void CCodec_ProgressiveDecoder::ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, doub des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
scan_src2 += des_Bpp - 3;
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
scan_des += des_Bpp - 3;
}
break;
@@ -917,10 +917,10 @@ void CCodec_ProgressiveDecoder::ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, doub des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
des_a += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
- *scan_des++ = (FX_BYTE)((des_a) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_a) >> 16);
}
break;
default:
@@ -940,7 +940,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, FX_Free(m_pSrcBuf);
m_pSrcBuf = NULL;
}
- m_pSrcBuf = FX_Alloc(FX_BYTE, size);
+ m_pSrcBuf = FX_Alloc(uint8_t, size);
if(m_pSrcBuf == NULL) {
m_status = FXCODEC_STATUS_ERR_MEMORY;
return FALSE;
@@ -969,7 +969,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, m_offSet += size;
pBmpModule->Input(m_pBmpContext, m_pSrcBuf, size);
FX_DWORD* pPalette = NULL;
- FX_INT32 readResult = pBmpModule->ReadHeader(m_pBmpContext, &m_SrcWidth, &m_SrcHeight, &m_BmpIsTopBottom,
+ int32_t readResult = pBmpModule->ReadHeader(m_pBmpContext, &m_SrcWidth, &m_SrcHeight, &m_BmpIsTopBottom,
&m_SrcComponents, &m_SrcPaletteNumber, &pPalette, pAttribute);
while(readResult == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
@@ -1023,7 +1023,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, }
m_offSet += size;
pJpegModule->Input(m_pJpegContext, m_pSrcBuf, size);
- FX_INT32 readResult = pJpegModule->ReadHeader(m_pJpegContext, &m_SrcWidth, &m_SrcHeight, &m_SrcComponents, pAttribute);
+ int32_t readResult = pJpegModule->ReadHeader(m_pJpegContext, &m_SrcWidth, &m_SrcHeight, &m_SrcComponents, pAttribute);
while(readResult == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
if(!JpegReadMoreData(pJpegModule, error_status)) {
@@ -1079,7 +1079,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, }
if(m_pSrcBuf != NULL && input_size > m_SrcSize) {
FX_Free(m_pSrcBuf);
- m_pSrcBuf = FX_Alloc(FX_BYTE, input_size);
+ m_pSrcBuf = FX_Alloc(uint8_t, input_size);
if(m_pSrcBuf == NULL) {
m_status = FXCODEC_STATUS_ERR_MEMORY;
return FALSE;
@@ -1129,7 +1129,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, m_offSet += size;
pGifModule->Input(m_pGifContext, m_pSrcBuf, size);
m_SrcComponents = 1;
- FX_INT32 readResult = pGifModule->ReadHeader(m_pGifContext, &m_SrcWidth, &m_SrcHeight,
+ int32_t readResult = pGifModule->ReadHeader(m_pGifContext, &m_SrcWidth, &m_SrcHeight,
&m_GifPltNumber, (void**)&m_pGifPalette, &m_GifBgIndex);
while(readResult == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
@@ -1164,7 +1164,7 @@ FX_BOOL CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, m_status = FXCODEC_STATUS_ERR_FORMAT;
return FALSE;
}
- FX_INT32 frames = 0;
+ int32_t frames = 0;
pTiffModule->GetFrames(m_pTiffContext, frames);
FX_DWORD bpc;
FX_BOOL ret = pTiffModule->LoadFrameInfo(m_pTiffContext, 0, (FX_DWORD&)m_SrcWidth, (FX_DWORD&)m_SrcHeight, (FX_DWORD&)m_SrcComponents, bpc, pAttribute);
@@ -1380,7 +1380,7 @@ void CCodec_ProgressiveDecoder::GetTransMethod(FXDIB_Format des_format, FXCodec_ void _RGB2BGR(FX_LPBYTE buffer, int width = 1)
{
if (buffer && width > 0) {
- FX_BYTE temp;
+ uint8_t temp;
int i = 0;
int j = 0;
for (; i < width; i++, j += 3) {
@@ -1416,7 +1416,7 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
des_g += pixel_weight * src_scan[j];
}
- *des_scan++ = (FX_BYTE)(des_g >> 16);
+ *des_scan++ = (uint8_t)(des_g >> 16);
}
break;
case 3: {
@@ -1424,11 +1424,11 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb = m_pSrcPalette[src_scan[j]];
- des_r += pixel_weight * (FX_BYTE)(argb >> 16);
- des_g += pixel_weight * (FX_BYTE)(argb >> 8);
- des_b += pixel_weight * (FX_BYTE)argb;
+ des_r += pixel_weight * (uint8_t)(argb >> 16);
+ des_g += pixel_weight * (uint8_t)(argb >> 8);
+ des_b += pixel_weight * (uint8_t)argb;
}
- *des_scan++ = (FX_BYTE)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
+ *des_scan++ = (uint8_t)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
}
break;
case 4: {
@@ -1440,7 +1440,7 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in des_g += pixel_weight * (*src_pixel++);
des_r += pixel_weight * (*src_pixel);
}
- *des_scan++ = (FX_BYTE)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
+ *des_scan++ = (uint8_t)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
}
break;
case 5: {
@@ -1448,14 +1448,14 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
FX_LPCBYTE src_pixel = src_scan + j * src_Bpp;
- FX_BYTE src_b = 0, src_g = 0, src_r = 0;
+ uint8_t src_b = 0, src_g = 0, src_r = 0;
AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], 255 - src_pixel[2], 255 - src_pixel[3],
src_r, src_g, src_b);
des_b += pixel_weight * src_b;
des_g += pixel_weight * src_g;
des_r += pixel_weight * src_r;
}
- *des_scan++ = (FX_BYTE)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
+ *des_scan++ = (uint8_t)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
}
break;
case 6:
@@ -1466,7 +1466,7 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
des_g += pixel_weight * src_scan[j];
}
- FXSYS_memset8(des_scan, (FX_BYTE)(des_g >> 16), 3);
+ FXSYS_memset8(des_scan, (uint8_t)(des_g >> 16), 3);
des_scan += des_Bpp;
}
break;
@@ -1475,13 +1475,13 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb = m_pSrcPalette[src_scan[j]];
- des_r += pixel_weight * (FX_BYTE)(argb >> 16);
- des_g += pixel_weight * (FX_BYTE)(argb >> 8);
- des_b += pixel_weight * (FX_BYTE)argb;
+ des_r += pixel_weight * (uint8_t)(argb >> 16);
+ des_g += pixel_weight * (uint8_t)(argb >> 8);
+ des_b += pixel_weight * (uint8_t)argb;
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
des_scan += des_Bpp - 3;
}
break;
@@ -1491,28 +1491,28 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb = m_pSrcPalette[src_scan[j]];
- des_r += pixel_weight * (FX_BYTE)(argb >> 16);
- des_g += pixel_weight * (FX_BYTE)(argb >> 8);
- des_b += pixel_weight * (FX_BYTE)argb;
+ des_r += pixel_weight * (uint8_t)(argb >> 16);
+ des_g += pixel_weight * (uint8_t)(argb >> 8);
+ des_b += pixel_weight * (uint8_t)argb;
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
*des_scan++ = 0xFF;
} else {
int des_a = 0, des_r = 0, des_g = 0, des_b = 0;
for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb = m_pSrcPalette[src_scan[j]];
- des_a += pixel_weight * (FX_BYTE)(argb >> 24);
- des_r += pixel_weight * (FX_BYTE)(argb >> 16);
- des_g += pixel_weight * (FX_BYTE)(argb >> 8);
- des_b += pixel_weight * (FX_BYTE)argb;
+ des_a += pixel_weight * (uint8_t)(argb >> 24);
+ des_r += pixel_weight * (uint8_t)(argb >> 16);
+ des_g += pixel_weight * (uint8_t)(argb >> 8);
+ des_b += pixel_weight * (uint8_t)argb;
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
- *des_scan++ = (FX_BYTE)((des_a) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_a) >> 16);
}
}
break;
@@ -1525,9 +1525,9 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in des_g += pixel_weight * (*src_pixel++);
des_r += pixel_weight * (*src_pixel);
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
des_scan += des_Bpp - 3;
}
break;
@@ -1536,16 +1536,16 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
FX_LPCBYTE src_pixel = src_scan + j * src_Bpp;
- FX_BYTE src_b = 0, src_g = 0, src_r = 0;
+ uint8_t src_b = 0, src_g = 0, src_r = 0;
AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], 255 - src_pixel[2], 255 - src_pixel[3],
src_r, src_g, src_b);
des_b += pixel_weight * src_b;
des_g += pixel_weight * src_g;
des_r += pixel_weight * src_r;
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
des_scan += des_Bpp - 3;
}
break;
@@ -1560,10 +1560,10 @@ void CCodec_ProgressiveDecoder::ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, in des_r += pixel_weight * (*src_pixel);
des_alpha += pixel_weight;
}
- *des_scan++ = (FX_BYTE)((des_b) >> 16);
- *des_scan++ = (FX_BYTE)((des_g) >> 16);
- *des_scan++ = (FX_BYTE)((des_r) >> 16);
- *des_scan++ = (FX_BYTE)((des_alpha * 255) >> 16);
+ *des_scan++ = (uint8_t)((des_b) >> 16);
+ *des_scan++ = (uint8_t)((des_g) >> 16);
+ *des_scan++ = (uint8_t)((des_r) >> 16);
+ *des_scan++ = (uint8_t)((des_alpha * 255) >> 16);
}
break;
default:
@@ -1609,7 +1609,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(CFX_DIBitmap* pDeviceBitmap, double int des_g = 0;
des_g += pWeight->m_Weights[0] * (*scan_src1++);
des_g += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)(des_g >> 16);
+ *scan_des++ = (uint8_t)(des_g >> 16);
}
break;
case FXDIB_Rgb:
@@ -1623,9 +1623,9 @@ void CCodec_ProgressiveDecoder::ResampleVert(CFX_DIBitmap* pDeviceBitmap, double des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
scan_src2 += des_Bpp - 3;
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
scan_des += des_Bpp - 3;
}
break;
@@ -1639,10 +1639,10 @@ void CCodec_ProgressiveDecoder::ResampleVert(CFX_DIBitmap* pDeviceBitmap, double des_g += pWeight->m_Weights[1] * (*scan_src2++);
des_r += pWeight->m_Weights[1] * (*scan_src2++);
des_a += pWeight->m_Weights[1] * (*scan_src2++);
- *scan_des++ = (FX_BYTE)((des_b) >> 16);
- *scan_des++ = (FX_BYTE)((des_g) >> 16);
- *scan_des++ = (FX_BYTE)((des_r) >> 16);
- *scan_des++ = (FX_BYTE)((des_a) >> 16);
+ *scan_des++ = (uint8_t)((des_b) >> 16);
+ *scan_des++ = (uint8_t)((des_g) >> 16);
+ *scan_des++ = (uint8_t)((des_r) >> 16);
+ *scan_des++ = (uint8_t)((des_a) >> 16);
}
break;
default:
@@ -1674,7 +1674,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(CFX_DIBitmap* pDeviceBitmap, double }
}
}
-void CCodec_ProgressiveDecoder::Resample(CFX_DIBitmap* pDeviceBitmap, FX_INT32 src_line, FX_LPBYTE src_scan, FXCodec_Format src_format)
+void CCodec_ProgressiveDecoder::Resample(CFX_DIBitmap* pDeviceBitmap, int32_t src_line, FX_LPBYTE src_scan, FXCodec_Format src_format)
{
int src_top = m_clipBox.top;
int des_top = m_startY;
@@ -1693,7 +1693,7 @@ void CCodec_ProgressiveDecoder::Resample(CFX_DIBitmap* pDeviceBitmap, FX_INT32 s }
}
}
-FXCODEC_STATUS CCodec_ProgressiveDecoder::GetFrames(FX_INT32& frames, IFX_Pause* pPause)
+FXCODEC_STATUS CCodec_ProgressiveDecoder::GetFrames(int32_t& frames, IFX_Pause* pPause)
{
if(!(m_status == FXCODEC_STATUS_FRAME_READY || m_status == FXCODEC_STATUS_FRAME_TOBECONTINUE)) {
return FXCODEC_STATUS_ERROR;
@@ -1708,7 +1708,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::GetFrames(FX_INT32& frames, IFX_Pause* case FXCODEC_IMAGE_GIF: {
ICodec_GifModule* pGifModule = m_pCodecMgr->GetGifModule();
while (TRUE) {
- FX_INT32 readResult = pGifModule->LoadFrameInfo(m_pGifContext, &m_FrameNumber);
+ int32_t readResult = pGifModule->LoadFrameInfo(m_pGifContext, &m_FrameNumber);
while(readResult == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_READ;
if(!GifReadMoreData(pGifModule, error_status)) {
@@ -1738,7 +1738,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::GetFrames(FX_INT32& frames, IFX_Pause* }
FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap,
int start_x, int start_y, int size_x, int size_y,
- FX_INT32 frames, FX_BOOL bInterpol)
+ int32_t frames, FX_BOOL bInterpol)
{
if(m_status != FXCODEC_STATUS_DECODE_READY) {
return FXCODEC_STATUS_ERROR;
@@ -1755,8 +1755,8 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, return FXCODEC_STATUS_ERR_PARAMS;
}
FX_RECT device_rc = FX_RECT(start_x, start_y, start_x + size_x, start_y + size_y);
- FX_INT32 out_range_x = device_rc.right - pDIBitmap->GetWidth();
- FX_INT32 out_range_y = device_rc.bottom - pDIBitmap->GetHeight();
+ int32_t out_range_x = device_rc.right - pDIBitmap->GetWidth();
+ int32_t out_range_y = device_rc.bottom - pDIBitmap->GetHeight();
device_rc.Intersect(FX_RECT(0, 0, pDIBitmap->GetWidth(), pDIBitmap->GetHeight()));
if(device_rc.IsEmpty()) {
return FXCODEC_STATUS_ERR_PARAMS;
@@ -1770,19 +1770,19 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, if(start_x < 0 || out_range_x > 0) {
FX_FLOAT scaleX = (FX_FLOAT)m_clipBox.Width() / (FX_FLOAT)size_x;
if(start_x < 0) {
- m_clipBox.left -= (FX_INT32)FXSYS_ceil((FX_FLOAT)start_x * scaleX);
+ m_clipBox.left -= (int32_t)FXSYS_ceil((FX_FLOAT)start_x * scaleX);
}
if(out_range_x > 0) {
- m_clipBox.right -= (FX_INT32)FXSYS_floor((FX_FLOAT)out_range_x * scaleX);
+ m_clipBox.right -= (int32_t)FXSYS_floor((FX_FLOAT)out_range_x * scaleX);
}
}
if(start_y < 0 || out_range_y > 0) {
FX_FLOAT scaleY = (FX_FLOAT)m_clipBox.Height() / (FX_FLOAT)size_y;
if(start_y < 0) {
- m_clipBox.top -= (FX_INT32)FXSYS_ceil((FX_FLOAT)start_y * scaleY);
+ m_clipBox.top -= (int32_t)FXSYS_ceil((FX_FLOAT)start_y * scaleY);
}
if(out_range_y > 0) {
- m_clipBox.bottom -= (FX_INT32)FXSYS_floor((FX_FLOAT)out_range_y * scaleY);
+ m_clipBox.bottom -= (int32_t)FXSYS_floor((FX_FLOAT)out_range_y * scaleY);
}
}
if(m_clipBox.IsEmpty()) {
@@ -1809,7 +1809,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, FX_Free(m_pDecodeBuf);
m_pDecodeBuf = NULL;
}
- m_pDecodeBuf = FX_Alloc(FX_BYTE, scanline_size);
+ m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
if(m_pDecodeBuf == NULL) {
m_pDeviceBitmap = NULL;
m_pFile = NULL;
@@ -1878,7 +1878,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, FX_Free(m_pDecodeBuf);
m_pDecodeBuf = NULL;
}
- m_pDecodeBuf = FX_Alloc(FX_BYTE, scanline_size);
+ m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
if(m_pDecodeBuf == NULL) {
m_pDeviceBitmap = NULL;
m_pFile = NULL;
@@ -1904,7 +1904,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, FX_Free(m_pDecodeBuf);
m_pDecodeBuf = NULL;
}
- m_pDecodeBuf = FX_Alloc(FX_BYTE, scanline_size);
+ m_pDecodeBuf = FX_Alloc(uint8_t, scanline_size);
if(m_pDecodeBuf == NULL) {
m_pDeviceBitmap = NULL;
m_pFile = NULL;
@@ -1941,7 +1941,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(CFX_DIBitmap* pDIBitmap, FX_Free(m_pDecodeBuf);
m_pDecodeBuf = NULL;
}
- m_pDecodeBuf = FX_Alloc(FX_BYTE, m_ScanlineSize);
+ m_pDecodeBuf = FX_Alloc(uint8_t, m_ScanlineSize);
if(m_pDecodeBuf == NULL) {
m_pDeviceBitmap = NULL;
m_pFile = NULL;
@@ -2012,7 +2012,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) }
if(m_pSrcBuf != NULL && input_size > m_SrcSize) {
FX_Free(m_pSrcBuf);
- m_pSrcBuf = FX_Alloc(FX_BYTE, input_size);
+ m_pSrcBuf = FX_Alloc(uint8_t, input_size);
if(m_pSrcBuf == NULL) {
m_pDeviceBitmap = NULL;
m_pFile = NULL;
@@ -2043,7 +2043,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) case FXCODEC_IMAGE_GIF: {
ICodec_GifModule* pGifModule = m_pCodecMgr->GetGifModule();
while(TRUE) {
- FX_INT32 readRes = pGifModule->LoadFrame(m_pGifContext, m_FrameCur);
+ int32_t readRes = pGifModule->LoadFrame(m_pGifContext, m_FrameCur);
while(readRes == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_DECODE_FINISH;
if(!GifReadMoreData(pGifModule, error_status)) {
@@ -2070,7 +2070,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) case FXCODEC_IMAGE_BMP: {
ICodec_BmpModule* pBmpModule = m_pCodecMgr->GetBmpModule();
while(TRUE) {
- FX_INT32 readRes = pBmpModule->LoadImage(m_pBmpContext);
+ int32_t readRes = pBmpModule->LoadImage(m_pBmpContext);
while(readRes == 2) {
FXCODEC_STATUS error_status = FXCODEC_STATUS_DECODE_FINISH;
if(!BmpReadMoreData(pBmpModule, error_status)) {
@@ -2165,14 +2165,14 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) switch(m_pDeviceBitmap->GetFormat()) {
case FXDIB_8bppRgb:
case FXDIB_8bppMask: {
- for (FX_INT32 row = 0; row < pClipBitmap->GetHeight(); row++) {
+ for (int32_t row = 0; row < pClipBitmap->GetHeight(); row++) {
FX_LPBYTE src_line = (FX_LPBYTE)pClipBitmap->GetScanline(row);
FX_LPBYTE des_line = (FX_LPBYTE)pFormatBitmap->GetScanline(row);
- for (FX_INT32 col = 0; col < pClipBitmap->GetWidth(); col++) {
- FX_BYTE _a = 255 - src_line[3];
- FX_BYTE b = (src_line[0] * src_line[3] + 0xFF * _a) / 255;
- FX_BYTE g = (src_line[1] * src_line[3] + 0xFF * _a) / 255;
- FX_BYTE r = (src_line[2] * src_line[3] + 0xFF * _a) / 255;
+ for (int32_t col = 0; col < pClipBitmap->GetWidth(); col++) {
+ uint8_t _a = 255 - src_line[3];
+ uint8_t b = (src_line[0] * src_line[3] + 0xFF * _a) / 255;
+ uint8_t g = (src_line[1] * src_line[3] + 0xFF * _a) / 255;
+ uint8_t r = (src_line[2] * src_line[3] + 0xFF * _a) / 255;
*des_line++ = FXRGB2GRAY(r, g, b);
src_line += 4;
}
@@ -2181,15 +2181,15 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode(IFX_Pause* pPause) break;
case FXDIB_Rgb:
case FXDIB_Rgb32: {
- FX_INT32 desBpp = (m_pDeviceBitmap->GetFormat() == FXDIB_Rgb) ? 3 : 4;
- for (FX_INT32 row = 0; row < pClipBitmap->GetHeight(); row++) {
+ int32_t desBpp = (m_pDeviceBitmap->GetFormat() == FXDIB_Rgb) ? 3 : 4;
+ for (int32_t row = 0; row < pClipBitmap->GetHeight(); row++) {
FX_LPBYTE src_line = (FX_LPBYTE)pClipBitmap->GetScanline(row);
FX_LPBYTE des_line = (FX_LPBYTE)pFormatBitmap->GetScanline(row);
- for (FX_INT32 col = 0; col < pClipBitmap->GetWidth(); col++) {
- FX_BYTE _a = 255 - src_line[3];
- FX_BYTE b = (src_line[0] * src_line[3] + 0xFF * _a) / 255;
- FX_BYTE g = (src_line[1] * src_line[3] + 0xFF * _a) / 255;
- FX_BYTE r = (src_line[2] * src_line[3] + 0xFF * _a) / 255;
+ for (int32_t col = 0; col < pClipBitmap->GetWidth(); col++) {
+ uint8_t _a = 255 - src_line[3];
+ uint8_t b = (src_line[0] * src_line[3] + 0xFF * _a) / 255;
+ uint8_t g = (src_line[1] * src_line[3] + 0xFF * _a) / 255;
+ uint8_t r = (src_line[2] * src_line[3] + 0xFF * _a) / 255;
*des_line++ = b;
*des_line++ = g;
*des_line++ = r;
diff --git a/core/src/fxcodec/codec/fx_codec_progress.h b/core/src/fxcodec/codec/fx_codec_progress.h index ea53c8f010..e5a4e53376 100644 --- a/core/src/fxcodec/codec/fx_codec_progress.h +++ b/core/src/fxcodec/codec/fx_codec_progress.h @@ -108,28 +108,28 @@ public: {
return m_imagType;
}
- virtual FX_INT32 GetWidth()
+ virtual int32_t GetWidth()
{
return m_SrcWidth;
}
- virtual FX_INT32 GetHeight()
+ virtual int32_t GetHeight()
{
return m_SrcHeight;
}
- virtual FX_INT32 GetNumComponents()
+ virtual int32_t GetNumComponents()
{
return m_SrcComponents;
}
- virtual FX_INT32 GetBPC()
+ virtual int32_t GetBPC()
{
return m_SrcBPC;
}
virtual void SetClipBox(FX_RECT* clip);
- virtual FXCODEC_STATUS GetFrames(FX_INT32& frames, IFX_Pause* pPause);
+ virtual FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause);
virtual FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap,
int start_x, int start_y, int size_x, int size_y,
- FX_INT32 frames, FX_BOOL bInterpol);
+ int32_t frames, FX_BOOL bInterpol);
virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause);
@@ -137,27 +137,27 @@ protected: FX_BOOL DetectImageType(FXCODEC_IMAGE_TYPE imageType, CFX_DIBAttribute* pAttribute = NULL);
void GetDownScale(int& down_scale);
void GetTransMethod(FXDIB_Format des_format, FXCodec_Format src_format);
- void ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, FX_INT32 des_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
- void Resample(CFX_DIBitmap* pDeviceBitmap, FX_INT32 src_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
+ void ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, int32_t des_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
+ void Resample(CFX_DIBitmap* pDeviceBitmap, int32_t src_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
void ResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row);
FX_BOOL JpegReadMoreData(ICodec_JpegModule* pJpegModule, FXCODEC_STATUS& err_status);
static FX_BOOL PngReadHeaderFunc(void* pModule, int width, int height, int bpc, int pass, int* color_type, double* gamma);
static FX_BOOL PngAskScanlineBufFunc(void* pModule, int line, FX_LPBYTE& src_buf);
static void PngFillScanlineBufCompletedFunc(void* pModule, int pass, int line);
- void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, FX_INT32 des_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
+ void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, int32_t des_line, FX_LPBYTE src_scan, FXCodec_Format src_format);
FX_BOOL GifReadMoreData(ICodec_GifModule* pGifModule, FXCODEC_STATUS& err_status);
static void GifRecordCurrentPositionCallback(void* pModule, FX_DWORD& cur_pos);
- static FX_LPBYTE GifAskLocalPaletteBufCallback(void* pModule, FX_INT32 frame_num, FX_INT32 pal_size);
+ static FX_LPBYTE GifAskLocalPaletteBufCallback(void* pModule, int32_t frame_num, int32_t pal_size);
static FX_BOOL GifInputRecordPositionBufCallback(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace);
- static void GifReadScanlineCallback(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace);
+ static void GifReadScanlineCallback(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row);
FX_BOOL BmpReadMoreData(ICodec_BmpModule* pBmpModule, FXCODEC_STATUS& err_status);
static FX_BOOL BmpInputImagePositionBufCallback(void* pModule, FX_DWORD rcd_pos);
- static void BmpReadScanlineCallback(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ static void BmpReadScanlineCallback(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row);
public:
IFX_FileRead* m_pFile;
@@ -197,7 +197,7 @@ public: int m_FrameCur;
int m_GifBgIndex;
FX_LPBYTE m_pGifPalette;
- FX_INT32 m_GifPltNumber;
+ int32_t m_GifPltNumber;
int m_GifTransIndex;
FX_RECT m_GifFrameRect;
FX_BOOL m_BmpIsTopBottom;
diff --git a/core/src/fxcodec/codec/fx_codec_tiff.cpp b/core/src/fxcodec/codec/fx_codec_tiff.cpp index fee2c783c5..8e9dd10f29 100644 --- a/core/src/fxcodec/codec/fx_codec_tiff.cpp +++ b/core/src/fxcodec/codec/fx_codec_tiff.cpp @@ -20,8 +20,8 @@ public: ~CCodec_TiffContext();
FX_BOOL InitDecoder(IFX_FileRead* file_ptr);
- void GetFrames(FX_INT32& frames);
- FX_BOOL LoadFrameInfo(FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute);
+ void GetFrames(int32_t& frames);
+ FX_BOOL LoadFrameInfo(int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute);
FX_BOOL Decode(CFX_DIBitmap* pDIBitmap);
union {
@@ -33,15 +33,15 @@ public: TIFF* tif_ctx;
void* icc_ctx;
- FX_INT32 frame_num;
- FX_INT32 frame_cur;
+ int32_t frame_num;
+ int32_t frame_cur;
FX_BOOL isDecoder;
private:
FX_BOOL isSupport(CFX_DIBitmap* pDIBitmap);
- void SetPalette(CFX_DIBitmap* pDIBitmap, FX_UINT16 bps);
- FX_BOOL Decode1bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp);
- FX_BOOL Decode8bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp);
- FX_BOOL Decode24bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp);
+ void SetPalette(CFX_DIBitmap* pDIBitmap, uint16_t bps);
+ FX_BOOL Decode1bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp);
+ FX_BOOL Decode8bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp);
+ FX_BOOL Decode24bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp);
};
CCodec_TiffContext::CCodec_TiffContext()
{
@@ -142,7 +142,7 @@ TIFF* _tiff_open(void* context, const char* mode) _tiff_read, _tiff_write, _tiff_seek, _tiff_close,
_tiff_get_size, _tiff_map, _tiff_unmap);
if(tif) {
- tif->tif_fd = (int)(FX_INTPTR)context;
+ tif->tif_fd = (int)(intptr_t)context;
}
return tif;
}
@@ -207,7 +207,7 @@ FX_BOOL CCodec_TiffContext::InitDecoder(IFX_FileRead* file_ptr) }
return TRUE;
}
-void CCodec_TiffContext::GetFrames(FX_INT32& frames)
+void CCodec_TiffContext::GetFrames(int32_t& frames)
{
frames = frame_num = TIFFNumberOfDirectories(tif_ctx);
}
@@ -215,7 +215,7 @@ void CCodec_TiffContext::GetFrames(FX_INT32& frames) T val = (T)0;\
TIFFGetField(tif_ctx,tag,&val);\
if (val) {\
- (key) = FX_Alloc(FX_BYTE,sizeof(T));\
+ (key) = FX_Alloc(uint8_t,sizeof(T));\
if ((key)) {\
T* ptr = (T*)(key);\
*ptr = val;\
@@ -226,7 +226,7 @@ void CCodec_TiffContext::GetFrames(FX_INT32& frames) FX_LPBYTE buf = NULL;\
TIFFGetField(tif_ctx,tag,&size, &buf);\
if (size && buf) {\
- (key) = FX_Alloc(FX_BYTE,size);\
+ (key) = FX_Alloc(uint8_t,size);\
if ((key)) {\
FXSYS_memcpy32((key),buf,size);\
pExif->m_TagVal.SetAt(tag,(key));}}}\
@@ -238,7 +238,7 @@ static FX_BOOL Tiff_Exif_GetInfo(TIFF* tif_ctx, ttag_t tag, CFX_DIBAttributeExif T val = (T)0;
TIFFGetField(tif_ctx, tag, &val);
if (val) {
- (key) = FX_Alloc(FX_BYTE, sizeof(T));
+ (key) = FX_Alloc(uint8_t, sizeof(T));
if ((key) == NULL) {
return FALSE;
}
@@ -255,8 +255,8 @@ static void Tiff_Exif_GetStringInfo(TIFF* tif_ctx, ttag_t tag, CFX_DIBAttributeE FX_LPBYTE key = NULL;
TIFFGetField(tif_ctx, tag, &buf);
if (buf) {
- FX_INT32 size = (FX_INT32)FXSYS_strlen(buf);
- (key) = FX_Alloc(FX_BYTE, size + 1);
+ int32_t size = (int32_t)FXSYS_strlen(buf);
+ (key) = FX_Alloc(uint8_t, size + 1);
if ((key) == NULL) {
return;
}
@@ -265,7 +265,7 @@ static void Tiff_Exif_GetStringInfo(TIFF* tif_ctx, ttag_t tag, CFX_DIBAttributeE pExif->m_TagVal.SetAt(tag, (key));
}
}
-FX_BOOL CCodec_TiffContext::LoadFrameInfo(FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute)
+FX_BOOL CCodec_TiffContext::LoadFrameInfo(int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute)
{
if (!TIFFSetDirectory(tif_ctx, (uint16)frame)) {
return FALSE;
@@ -296,12 +296,12 @@ FX_BOOL CCodec_TiffContext::LoadFrameInfo(FX_INT32 frame, FX_DWORD& width, FX_DW if (Tiff_Exif_GetInfo<FX_FLOAT>(tif_ctx, TIFFTAG_XRESOLUTION, pExif)) {
FX_FLOAT fDpi = 0;
pExif->GetInfo(TIFFTAG_XRESOLUTION, &fDpi);
- pAttribute->m_nXDPI = (FX_INT32)(fDpi + 0.5f);
+ pAttribute->m_nXDPI = (int32_t)(fDpi + 0.5f);
}
if (Tiff_Exif_GetInfo<FX_FLOAT>(tif_ctx, TIFFTAG_YRESOLUTION, pExif)) {
FX_FLOAT fDpi = 0;
pExif->GetInfo(TIFFTAG_YRESOLUTION, &fDpi);
- pAttribute->m_nYDPI = (FX_INT32)(fDpi + 0.5f);
+ pAttribute->m_nYDPI = (int32_t)(fDpi + 0.5f);
}
Tiff_Exif_GetStringInfo(tif_ctx, TIFFTAG_IMAGEDESCRIPTION, pExif);
Tiff_Exif_GetStringInfo(tif_ctx, TIFFTAG_MAKE, pExif);
@@ -313,10 +313,10 @@ FX_BOOL CCodec_TiffContext::LoadFrameInfo(FX_INT32 frame, FX_DWORD& width, FX_DW }
return TRUE;
}
-void _TiffBGRA2RGBA(FX_LPBYTE pBuf, FX_INT32 pixel, FX_INT32 spp)
+void _TiffBGRA2RGBA(FX_LPBYTE pBuf, int32_t pixel, int32_t spp)
{
- register FX_BYTE tmp;
- for (FX_INT32 n = 0; n < pixel; n++) {
+ register uint8_t tmp;
+ for (int32_t n = 0; n < pixel; n++) {
tmp = pBuf[0];
pBuf[0] = pBuf[2];
pBuf[2] = tmp;
@@ -328,7 +328,7 @@ FX_BOOL CCodec_TiffContext::isSupport(CFX_DIBitmap* pDIBitmap) if (TIFFIsTiled(tif_ctx)) {
return FALSE;
}
- FX_UINT16 photometric;
+ uint16_t photometric;
if (!TIFFGetField(tif_ctx, TIFFTAG_PHOTOMETRIC, &photometric)) {
return FALSE;
}
@@ -347,7 +347,7 @@ FX_BOOL CCodec_TiffContext::isSupport(CFX_DIBitmap* pDIBitmap) default:
return FALSE;
}
- FX_UINT16 planarconfig;
+ uint16_t planarconfig;
if (!TIFFGetFieldDefaulted(tif_ctx, TIFFTAG_PLANARCONFIG, &planarconfig)) {
return FALSE;
}
@@ -356,33 +356,33 @@ FX_BOOL CCodec_TiffContext::isSupport(CFX_DIBitmap* pDIBitmap) }
return TRUE;
}
-void CCodec_TiffContext::SetPalette(CFX_DIBitmap* pDIBitmap, FX_UINT16 bps)
+void CCodec_TiffContext::SetPalette(CFX_DIBitmap* pDIBitmap, uint16_t bps)
{
- FX_UINT16 *red_orig, *green_orig, *blue_orig;
+ uint16_t *red_orig, *green_orig, *blue_orig;
TIFFGetField(tif_ctx, TIFFTAG_COLORMAP, &red_orig, &green_orig, &blue_orig);
- for (FX_INT32 i = (1L << bps) - 1; i >= 0; i--) {
-#define CVT(x) ((FX_UINT16)((x)>>8))
+ for (int32_t i = (1L << bps) - 1; i >= 0; i--) {
+#define CVT(x) ((uint16_t)((x)>>8))
red_orig[i] = CVT(red_orig[i]);
green_orig[i] = CVT(green_orig[i]);
blue_orig[i] = CVT(blue_orig[i]);
#undef CVT
}
- FX_INT32 len = 1 << bps;
- for(FX_INT32 index = 0; index < len; index++) {
+ int32_t len = 1 << bps;
+ for(int32_t index = 0; index < len; index++) {
FX_DWORD r = red_orig[index] & 0xFF;
FX_DWORD g = green_orig[index] & 0xFF;
FX_DWORD b = blue_orig[index] & 0xFF;
- FX_DWORD color = (FX_UINT32)b | ((FX_UINT32)g << 8) | ((FX_UINT32)r << 16) | (((uint32)0xffL) << 24);
+ FX_DWORD color = (uint32_t)b | ((uint32_t)g << 8) | ((uint32_t)r << 16) | (((uint32)0xffL) << 24);
pDIBitmap->SetPaletteEntry(index, color);
}
}
-FX_BOOL CCodec_TiffContext::Decode1bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp)
+FX_BOOL CCodec_TiffContext::Decode1bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp)
{
if (pDIBitmap->GetBPP() != 1 || spp != 1 || bps != 1 || !isSupport(pDIBitmap)) {
return FALSE;
}
SetPalette(pDIBitmap, bps);
- FX_INT32 size = (FX_INT32)TIFFScanlineSize(tif_ctx);
+ int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
FX_LPBYTE buf = (FX_LPBYTE)_TIFFmalloc(size);
if (buf == NULL) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
@@ -390,22 +390,22 @@ FX_BOOL CCodec_TiffContext::Decode1bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 heig }
FX_LPBYTE bitMapbuffer = (FX_LPBYTE)pDIBitmap->GetBuffer();
FX_DWORD pitch = pDIBitmap->GetPitch();
- for(FX_INT32 row = 0; row < height; row++) {
+ for(int32_t row = 0; row < height; row++) {
TIFFReadScanline(tif_ctx, buf, row, 0);
- for(FX_INT32 j = 0; j < size; j++) {
+ for(int32_t j = 0; j < size; j++) {
bitMapbuffer[row * pitch + j] = buf[j];
}
}
_TIFFfree(buf);
return TRUE;
}
-FX_BOOL CCodec_TiffContext::Decode8bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp)
+FX_BOOL CCodec_TiffContext::Decode8bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp)
{
if (pDIBitmap->GetBPP() != 8 || spp != 1 || (bps != 4 && bps != 8) || !isSupport(pDIBitmap)) {
return FALSE;
}
SetPalette(pDIBitmap, bps);
- FX_INT32 size = (FX_INT32)TIFFScanlineSize(tif_ctx);
+ int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
FX_LPBYTE buf = (FX_LPBYTE)_TIFFmalloc(size);
if (buf == NULL) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
@@ -413,9 +413,9 @@ FX_BOOL CCodec_TiffContext::Decode8bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 heig }
FX_LPBYTE bitMapbuffer = (FX_LPBYTE)pDIBitmap->GetBuffer();
FX_DWORD pitch = pDIBitmap->GetPitch();
- for(FX_INT32 row = 0; row < height; row++) {
+ for(int32_t row = 0; row < height; row++) {
TIFFReadScanline(tif_ctx, buf, row, 0);
- for(FX_INT32 j = 0; j < size; j++) {
+ for(int32_t j = 0; j < size; j++) {
switch(bps) {
case 4:
bitMapbuffer[row * pitch + 2 * j + 0] = (buf[j] & 0xF0) >> 4;
@@ -430,12 +430,12 @@ FX_BOOL CCodec_TiffContext::Decode8bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 heig _TIFFfree(buf);
return TRUE;
}
-FX_BOOL CCodec_TiffContext::Decode24bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 height, FX_INT32 width, FX_UINT16 bps, FX_UINT16 spp)
+FX_BOOL CCodec_TiffContext::Decode24bppRGB(CFX_DIBitmap* pDIBitmap, int32_t height, int32_t width, uint16_t bps, uint16_t spp)
{
if (pDIBitmap->GetBPP() != 24 || !isSupport(pDIBitmap)) {
return FALSE;
}
- FX_INT32 size = (FX_INT32)TIFFScanlineSize(tif_ctx);
+ int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
FX_LPBYTE buf = (FX_LPBYTE)_TIFFmalloc(size);
if (buf == NULL) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
@@ -443,9 +443,9 @@ FX_BOOL CCodec_TiffContext::Decode24bppRGB(CFX_DIBitmap* pDIBitmap, FX_INT32 hei }
FX_LPBYTE bitMapbuffer = (FX_LPBYTE)pDIBitmap->GetBuffer();
FX_DWORD pitch = pDIBitmap->GetPitch();
- for(FX_INT32 row = 0; row < height; row++) {
+ for(int32_t row = 0; row < height; row++) {
TIFFReadScanline(tif_ctx, buf, row, 0);
- for(FX_INT32 j = 0; j < size - 2; j += 3) {
+ for(int32_t j = 0; j < size - 2; j += 3) {
bitMapbuffer[row * pitch + j + 0] = buf[j + 2];
bitMapbuffer[row * pitch + j + 1] = buf[j + 1];
bitMapbuffer[row * pitch + j + 2] = buf[j + 0];
@@ -477,7 +477,7 @@ FX_BOOL CCodec_TiffContext::Decode(CFX_DIBitmap* pDIBitmap) return TRUE;
}
}
- FX_UINT16 spp, bps;
+ uint16_t spp, bps;
TIFFGetField(tif_ctx, TIFFTAG_SAMPLESPERPIXEL, &spp);
TIFFGetField(tif_ctx, TIFFTAG_BITSPERSAMPLE, &bps);
FX_DWORD bpp = bps * spp;
@@ -499,12 +499,12 @@ FX_LPVOID CCodec_TiffModule::CreateDecoder(IFX_FileRead* file_ptr) }
return pDecoder;
}
-void CCodec_TiffModule::GetFrames(FX_LPVOID ctx, FX_INT32& frames)
+void CCodec_TiffModule::GetFrames(FX_LPVOID ctx, int32_t& frames)
{
CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
pDecoder->GetFrames(frames);
}
-FX_BOOL CCodec_TiffModule::LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute)
+FX_BOOL CCodec_TiffModule::LoadFrameInfo(FX_LPVOID ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute)
{
CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
return pDecoder->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute);
diff --git a/core/src/fxcodec/fx_tiff/tiff_v403/tiffconf.h b/core/src/fxcodec/fx_tiff/tiff_v403/tiffconf.h index 3ca425c712..d0f823d8c3 100644 --- a/core/src/fxcodec/fx_tiff/tiff_v403/tiffconf.h +++ b/core/src/fxcodec/fx_tiff/tiff_v403/tiffconf.h @@ -44,7 +44,7 @@ /*#define HAVE_SEARCH_H 1 */ /* The size of a `int', as computed by sizeof. */ -/* According typedef int FX_INT32; in the fx_system.h*/ +/* According typedef int int32_t; in the fx_system.h*/ #define SIZEOF_INT 4 /* Sunliang.Liu 20110325. We should config the correct long size for tif diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h index 9d5d29468f..ff0b9fcfeb 100644 --- a/core/src/fxcodec/jbig2/JBig2_BitStream.h +++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h @@ -11,41 +11,41 @@ class CJBig2_BitStream : public CJBig2_Object { public: - CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength); + CJBig2_BitStream(uint8_t *pBuffer, FX_DWORD dwLength); CJBig2_BitStream(CJBig2_BitStream &bs); ~CJBig2_BitStream(); - FX_INT32 readNBits(FX_DWORD nBits, FX_DWORD *dwResult); + int32_t readNBits(FX_DWORD nBits, FX_DWORD *dwResult); - FX_INT32 readNBits(FX_DWORD nBits, FX_INT32 *nResult); + int32_t readNBits(FX_DWORD nBits, int32_t *nResult); - FX_INT32 read1Bit(FX_DWORD *dwResult); + int32_t read1Bit(FX_DWORD *dwResult); - FX_INT32 read1Bit(FX_BOOL *bResult); + int32_t read1Bit(FX_BOOL *bResult); - FX_INT32 read1Byte(FX_BYTE *cResult); + int32_t read1Byte(uint8_t *cResult); - FX_INT32 readInteger(FX_DWORD *dwResult); + int32_t readInteger(FX_DWORD *dwResult); - FX_INT32 readShortInteger(FX_WORD *wResult); + int32_t readShortInteger(FX_WORD *wResult); void alignByte(); void align4Byte(); - FX_BYTE getAt(FX_DWORD dwOffset); + uint8_t getAt(FX_DWORD dwOffset); - FX_BYTE getCurByte(); + uint8_t getCurByte(); - FX_BYTE getNextByte(); + uint8_t getNextByte(); - FX_INT32 incByteIdx(); + int32_t incByteIdx(); - FX_BYTE getCurByte_arith(); + uint8_t getCurByte_arith(); - FX_BYTE getNextByte_arith(); + uint8_t getNextByte_arith(); FX_DWORD getOffset(); @@ -55,21 +55,21 @@ public: void setBitPos(FX_DWORD dwBitPos); - FX_BYTE *getBuf(); + uint8_t *getBuf(); FX_DWORD getLength() { return m_dwLength; } - FX_BYTE *getPointer(); + uint8_t *getPointer(); void offset(FX_DWORD dwOffset); FX_DWORD getByteLeft(); private: - FX_BYTE *m_pBuf; + uint8_t *m_pBuf; FX_DWORD m_dwLength; @@ -77,7 +77,7 @@ private: FX_DWORD m_dwBitIdx; }; -inline CJBig2_BitStream::CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength) +inline CJBig2_BitStream::CJBig2_BitStream(uint8_t *pBuffer, FX_DWORD dwLength) { m_pBuf = pBuffer; m_dwLength = dwLength; @@ -98,7 +98,7 @@ inline CJBig2_BitStream::CJBig2_BitStream(CJBig2_BitStream &bs) inline CJBig2_BitStream::~CJBig2_BitStream() { } -inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD *dwResult) +inline int32_t CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD *dwResult) { FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx; if(dwTemp <= (m_dwLength << 3)) { @@ -123,7 +123,7 @@ inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD *dwResult) return -1; } } -inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_INT32 *nResult) +inline int32_t CJBig2_BitStream::readNBits(FX_DWORD dwBits, int32_t *nResult) { FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx; if(dwTemp <= (m_dwLength << 3)) { @@ -149,7 +149,7 @@ inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_INT32 *nResult) } } -inline FX_INT32 CJBig2_BitStream::read1Bit(FX_DWORD *dwResult) +inline int32_t CJBig2_BitStream::read1Bit(FX_DWORD *dwResult) { if(m_dwByteIdx < m_dwLength) { *dwResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01; @@ -165,7 +165,7 @@ inline FX_INT32 CJBig2_BitStream::read1Bit(FX_DWORD *dwResult) } } -inline FX_INT32 CJBig2_BitStream::read1Bit(FX_BOOL *bResult) +inline int32_t CJBig2_BitStream::read1Bit(FX_BOOL *bResult) { if(m_dwByteIdx < m_dwLength) { *bResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01; @@ -180,7 +180,7 @@ inline FX_INT32 CJBig2_BitStream::read1Bit(FX_BOOL *bResult) return -1; } } -inline FX_INT32 CJBig2_BitStream::read1Byte(FX_BYTE *cResult) +inline int32_t CJBig2_BitStream::read1Byte(uint8_t *cResult) { if(m_dwByteIdx < m_dwLength) { *cResult = m_pBuf[m_dwByteIdx]; @@ -191,7 +191,7 @@ inline FX_INT32 CJBig2_BitStream::read1Byte(FX_BYTE *cResult) } } -inline FX_INT32 CJBig2_BitStream::readInteger(FX_DWORD *dwResult) +inline int32_t CJBig2_BitStream::readInteger(FX_DWORD *dwResult) { if(m_dwByteIdx + 3 < m_dwLength) { *dwResult = (m_pBuf[m_dwByteIdx] << 24) | (m_pBuf[m_dwByteIdx + 1] << 16) @@ -203,7 +203,7 @@ inline FX_INT32 CJBig2_BitStream::readInteger(FX_DWORD *dwResult) } } -inline FX_INT32 CJBig2_BitStream::readShortInteger(FX_WORD *dwResult) +inline int32_t CJBig2_BitStream::readShortInteger(FX_WORD *dwResult) { if(m_dwByteIdx + 1 < m_dwLength) { *dwResult = (m_pBuf[m_dwByteIdx] << 8) | m_pBuf[m_dwByteIdx + 1]; @@ -228,7 +228,7 @@ inline void CJBig2_BitStream::align4Byte() } m_dwByteIdx = (m_dwByteIdx + 3) & -4; } -inline FX_BYTE CJBig2_BitStream::getAt(FX_DWORD dwOffset) +inline uint8_t CJBig2_BitStream::getAt(FX_DWORD dwOffset) { if(dwOffset < m_dwLength) { return m_pBuf[dwOffset]; @@ -236,7 +236,7 @@ inline FX_BYTE CJBig2_BitStream::getAt(FX_DWORD dwOffset) return 0; } } -inline FX_BYTE CJBig2_BitStream::getCurByte() +inline uint8_t CJBig2_BitStream::getCurByte() { if(m_dwByteIdx < m_dwLength) { return m_pBuf[m_dwByteIdx]; @@ -244,7 +244,7 @@ inline FX_BYTE CJBig2_BitStream::getCurByte() return 0; } } -inline FX_BYTE CJBig2_BitStream::getNextByte() +inline uint8_t CJBig2_BitStream::getNextByte() { if(m_dwByteIdx + 1 < m_dwLength) { return m_pBuf[m_dwByteIdx + 1]; @@ -252,7 +252,7 @@ inline FX_BYTE CJBig2_BitStream::getNextByte() return 0; } } -inline FX_INT32 CJBig2_BitStream::incByteIdx() +inline int32_t CJBig2_BitStream::incByteIdx() { if(m_dwByteIdx < m_dwLength) { m_dwByteIdx ++; @@ -261,7 +261,7 @@ inline FX_INT32 CJBig2_BitStream::incByteIdx() return -1; } } -inline FX_BYTE CJBig2_BitStream::getCurByte_arith() +inline uint8_t CJBig2_BitStream::getCurByte_arith() { if(m_dwByteIdx < m_dwLength) { return m_pBuf[m_dwByteIdx]; @@ -269,7 +269,7 @@ inline FX_BYTE CJBig2_BitStream::getCurByte_arith() return 0xff; } } -inline FX_BYTE CJBig2_BitStream::getNextByte_arith() +inline uint8_t CJBig2_BitStream::getNextByte_arith() { if(m_dwByteIdx + 1 < m_dwLength) { return m_pBuf[m_dwByteIdx + 1]; @@ -297,11 +297,11 @@ inline void CJBig2_BitStream::setBitPos(FX_DWORD dwBitPos) m_dwByteIdx = dwBitPos >> 3; m_dwBitIdx = dwBitPos & 7; } -inline FX_BYTE *CJBig2_BitStream::getBuf() +inline uint8_t *CJBig2_BitStream::getBuf() { return m_pBuf; } -inline FX_BYTE *CJBig2_BitStream::getPointer() +inline uint8_t *CJBig2_BitStream::getPointer() { return m_pBuf + m_dwByteIdx; } diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp index bcd16e7e14..1c7592778d 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp @@ -23,8 +23,8 @@ void OutputBitmap(CJBig2_Image* pImage) return; } } -CJBig2_Context *CJBig2_Context::CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength, - FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause) +CJBig2_Context *CJBig2_Context::CreateContext(CJBig2_Module *pModule, uint8_t *pGlobalData, FX_DWORD dwGlobalLength, + uint8_t *pData, FX_DWORD dwLength, int32_t nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause) { return new(pModule)CJBig2_Context(pGlobalData, dwGlobalLength, pData, dwLength, nStreamType, pSymbolDictCache, pPause); } @@ -34,8 +34,8 @@ void CJBig2_Context::DestroyContext(CJBig2_Context *pContext) delete pContext; } } -CJBig2_Context::CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength, - FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause) +CJBig2_Context::CJBig2_Context(uint8_t *pGlobalData, FX_DWORD dwGlobalLength, + uint8_t *pData, FX_DWORD dwLength, int32_t nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause) { if(pGlobalData && (dwGlobalLength > 0)) { JBIG2_ALLOC(m_pGlobalContext, CJBig2_Context(NULL, 0, pGlobalData, dwGlobalLength, @@ -96,12 +96,12 @@ CJBig2_Context::~CJBig2_Context() } m_pSegmentList = NULL; } -FX_INT32 CJBig2_Context::decodeFile(IFX_Pause* pPause) +int32_t CJBig2_Context::decodeFile(IFX_Pause* pPause) { - FX_BYTE cFlags; + uint8_t cFlags; FX_DWORD dwTemp; - const FX_BYTE fileID[] = {0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A}; - FX_INT32 nRet; + const uint8_t fileID[] = {0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A}; + int32_t nRet; if(m_pStream->getByteLeft() < 8) { m_pModule->JBig2_Error("file header too short."); nRet = JBIG2_ERROR_TOO_SHORT; @@ -139,9 +139,9 @@ FX_INT32 CJBig2_Context::decodeFile(IFX_Pause* pPause) failed: return nRet; } -FX_INT32 CJBig2_Context::decode_SquentialOrgnazation(IFX_Pause* pPause) +int32_t CJBig2_Context::decode_SquentialOrgnazation(IFX_Pause* pPause) { - FX_INT32 nRet; + int32_t nRet; if(m_pStream->getByteLeft() > 0) { while(m_pStream->getByteLeft() >= JBIG2_MIN_SEGMENT_SIZE) { if(m_pSegment == NULL) { @@ -189,14 +189,14 @@ FX_INT32 CJBig2_Context::decode_SquentialOrgnazation(IFX_Pause* pPause) } return JBIG2_SUCCESS; } -FX_INT32 CJBig2_Context::decode_EmbedOrgnazation(IFX_Pause* pPause) +int32_t CJBig2_Context::decode_EmbedOrgnazation(IFX_Pause* pPause) { return decode_SquentialOrgnazation(pPause); } -FX_INT32 CJBig2_Context::decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause) +int32_t CJBig2_Context::decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause) { CJBig2_Segment *pSegment; - FX_INT32 nRet; + int32_t nRet; while(m_pStream->getByteLeft() > JBIG2_MIN_SEGMENT_SIZE) { JBIG2_ALLOC(pSegment, CJBig2_Segment()); nRet = parseSegmentHeader(pSegment); @@ -217,9 +217,9 @@ FX_INT32 CJBig2_Context::decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause) m_nSegmentDecoded = 0; return decode_RandomOrgnazation(pPause); } -FX_INT32 CJBig2_Context::decode_RandomOrgnazation(IFX_Pause* pPause) +int32_t CJBig2_Context::decode_RandomOrgnazation(IFX_Pause* pPause) { - FX_INT32 nRet; + int32_t nRet; for(; m_nSegmentDecoded < m_pSegmentList->getLength(); m_nSegmentDecoded++) { nRet = parseSegmentData(m_pSegmentList->getAt(m_nSegmentDecoded), pPause); if((nRet == JBIG2_END_OF_PAGE) || (nRet == JBIG2_END_OF_FILE)) { @@ -235,9 +235,9 @@ FX_INT32 CJBig2_Context::decode_RandomOrgnazation(IFX_Pause* pPause) } return JBIG2_SUCCESS; } -FX_INT32 CJBig2_Context::getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause) +int32_t CJBig2_Context::getFirstPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause) { - FX_INT32 nRet = 0; + int32_t nRet = 0; if(m_pGlobalContext) { nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause); if(nRet != JBIG2_SUCCESS) { @@ -260,10 +260,10 @@ FX_INT32 CJBig2_Context::getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 he int ret = Continue(pPause); return ret; } -FX_INT32 CJBig2_Context::Continue(IFX_Pause* pPause) +int32_t CJBig2_Context::Continue(IFX_Pause* pPause) { m_ProcessiveStatus = FXCODEC_STATUS_DECODE_READY; - FX_INT32 nRet; + int32_t nRet; if(m_PauseStep <= 1) { switch(m_nStreamType) { case JBIG2_FILE_STREAM: @@ -311,9 +311,9 @@ FX_INT32 CJBig2_Context::Continue(IFX_Pause* pPause) } return nRet; } -FX_INT32 CJBig2_Context::getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause) +int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause) { - FX_INT32 nRet = JBIG2_ERROR_STREAM_TYPE; + int32_t nRet = JBIG2_ERROR_STREAM_TYPE; m_bFirstPage = FALSE; m_PauseStep = 0; if(m_pPage) { @@ -345,9 +345,9 @@ FX_INT32 CJBig2_Context::getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 hei } return nRet; } -FX_INT32 CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) +int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) { - FX_INT32 nRet; + int32_t nRet; m_bFirstPage = TRUE; m_PauseStep = 0; if(m_pGlobalContext) { @@ -359,9 +359,9 @@ FX_INT32 CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) m_bBufSpecified = FALSE; return Continue(pPause); } -FX_INT32 CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause) +int32_t CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause) { - FX_INT32 nRet; + int32_t nRet; m_bBufSpecified = FALSE; m_bFirstPage = FALSE; m_PauseStep = 0; @@ -391,7 +391,7 @@ FX_INT32 CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause) CJBig2_Segment *CJBig2_Context::findSegmentByNumber(FX_DWORD dwNumber) { CJBig2_Segment *pSeg; - FX_INT32 i; + int32_t i; if(m_pGlobalContext) { pSeg = m_pGlobalContext->findSegmentByNumber(dwNumber); if(pSeg) { @@ -407,10 +407,10 @@ CJBig2_Segment *CJBig2_Context::findSegmentByNumber(FX_DWORD dwNumber) return NULL; } CJBig2_Segment *CJBig2_Context::findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment, - FX_BYTE cType, FX_INT32 nIndex) + uint8_t cType, int32_t nIndex) { CJBig2_Segment *pSeg; - FX_INT32 i, count; + int32_t i, count; count = 0; for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) { pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]); @@ -424,10 +424,10 @@ CJBig2_Segment *CJBig2_Context::findReferredSegmentByTypeAndIndex(CJBig2_Segment } return NULL; } -FX_INT32 CJBig2_Context::parseSegmentHeader(CJBig2_Segment *pSegment) +int32_t CJBig2_Context::parseSegmentHeader(CJBig2_Segment *pSegment) { - FX_BYTE cSSize, cPSize; - FX_BYTE cTemp; + uint8_t cSSize, cPSize; + uint8_t cTemp; FX_WORD wTemp; FX_DWORD dwTemp; if((m_pStream->readInteger(&pSegment->m_dwNumber) != 0) @@ -457,7 +457,7 @@ FX_INT32 CJBig2_Context::parseSegmentHeader(CJBig2_Segment *pSegment) if(pSegment->m_nReferred_to_segment_count) { pSegment->m_pReferred_to_segment_numbers = (FX_DWORD*)m_pModule->JBig2_Malloc2( sizeof(FX_DWORD), pSegment->m_nReferred_to_segment_count); - for(FX_INT32 i = 0; i < pSegment->m_nReferred_to_segment_count; i++) { + for(int32_t i = 0; i < pSegment->m_nReferred_to_segment_count; i++) { switch(cSSize) { case 1: if(m_pStream->read1Byte(&cTemp) != 0) { @@ -504,15 +504,15 @@ failed: m_pModule->JBig2_Error("header too short."); return JBIG2_ERROR_TOO_SHORT; } -FX_INT32 CJBig2_Context::parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause) { - FX_INT32 ret = ProcessiveParseSegmentData(pSegment, pPause); + int32_t ret = ProcessiveParseSegmentData(pSegment, pPause); while(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE && m_pStream->getByteLeft() > 0) { ret = ProcessiveParseSegmentData(pSegment, pPause); } return ret; } -FX_INT32 CJBig2_Context::ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause) { switch(pSegment->m_cFlags.s.type) { case 0: @@ -613,13 +613,13 @@ failed2: m_pModule->JBig2_Error("segment syntax error."); return JBIG2_ERROR_FETAL; } -FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; FX_WORD wFlags; - FX_BYTE cSDHUFFDH, cSDHUFFDW, cSDHUFFBMSIZE, cSDHUFFAGGINST; + uint8_t cSDHUFFDH, cSDHUFFDW, cSDHUFFBMSIZE, cSDHUFFAGGINST; CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL; - FX_INT32 i, nIndex, nRet; + int32_t i, nIndex, nRet; CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL; FX_BOOL bUsed; CJBig2_Image ** SDINSYMS = NULL; @@ -627,7 +627,7 @@ FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pP JBig2ArithCtx *gbContext = NULL, *grContext = NULL; CJBig2_ArithDecoder *pArithDecoder; JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc()); - FX_BYTE *key = pSegment->m_pData; + uint8_t *key = pSegment->m_pData; FX_BOOL cache_hit = false; if(m_pStream->readShortInteger(&wFlags) != 0) { m_pModule->JBig2_Error("symbol dictionary segment : data header too short."); @@ -648,8 +648,8 @@ FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pP } else { dwTemp = 2; } - for(i = 0; i < (FX_INT32)dwTemp; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDAT[i]) != 0) { + for(i = 0; i < (int32_t)dwTemp; i++) { + if(m_pStream->read1Byte((uint8_t*)&pSymbolDictDecoder->SDAT[i]) != 0) { m_pModule->JBig2_Error("symbol dictionary segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -658,7 +658,7 @@ FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pP } if((pSymbolDictDecoder->SDREFAGG == 1) && (pSymbolDictDecoder->SDRTEMPLATE == 0)) { for(i = 0; i < 4; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDRAT[i]) != 0) { + if(m_pStream->read1Byte((uint8_t*)&pSymbolDictDecoder->SDRAT[i]) != 0) { m_pModule->JBig2_Error("symbol dictionary segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -917,12 +917,12 @@ FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) { FX_DWORD dwTemp; FX_WORD wFlags; - FX_INT32 i, nIndex, nRet; + int32_t i, nIndex, nRet; JBig2RegionInfo ri; CJBig2_Segment *pSeg; CJBig2_Image **SBSYMS = NULL; JBig2HuffmanCode *SBSYMCODES = NULL; - FX_BYTE cSBHUFFFS, cSBHUFFDS, cSBHUFFDT, cSBHUFFRDW, cSBHUFFRDH, cSBHUFFRDX, cSBHUFFRDY, cSBHUFFRSIZE; + uint8_t cSBHUFFFS, cSBHUFFDS, cSBHUFFDT, cSBHUFFRDW, cSBHUFFRDH, cSBHUFFRDX, cSBHUFFRDY, cSBHUFFRSIZE; CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B6 = NULL, *Table_B7 = NULL, @@ -976,7 +976,7 @@ FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) } if((pTRD->SBREFINE == 1) && (pTRD->SBRTEMPLATE == 0)) { for(i = 0; i < 4; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&pTRD->SBRAT[i]) != 0) { + if(m_pStream->read1Byte((uint8_t*)&pTRD->SBRAT[i]) != 0) { m_pModule->JBig2_Error("text region segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -1032,7 +1032,7 @@ FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) while((FX_DWORD)(1 << dwTemp) < pTRD->SBNUMSYMS) { dwTemp ++; } - pTRD->SBSYMCODELEN = (FX_BYTE)dwTemp; + pTRD->SBSYMCODELEN = (uint8_t)dwTemp; } if(pTRD->SBHUFF == 1) { if((cSBHUFFFS == 2) || (cSBHUFFRDW == 2) || (cSBHUFFRDH == 2) @@ -1326,11 +1326,11 @@ failed: FX_BOOL CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; - FX_BYTE cFlags; + uint8_t cFlags; JBig2ArithCtx *gbContext; CJBig2_ArithDecoder *pArithDecoder; CJBig2_PDDProc *pPDD; - FX_INT32 nRet; + int32_t nRet; JBIG2_ALLOC(pPDD, CJBig2_PDDProc()); if((m_pStream->read1Byte(&cFlags) != 0) || (m_pStream->read1Byte(&pPDD->HDPW) != 0) @@ -1380,14 +1380,14 @@ failed: FX_BOOL CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; - FX_BYTE cFlags; + uint8_t cFlags; JBig2RegionInfo ri; CJBig2_Segment *pSeg; CJBig2_PatternDict *pPatternDict; JBig2ArithCtx *gbContext; CJBig2_ArithDecoder *pArithDecoder; CJBig2_HTRDProc *pHRD; - FX_INT32 nRet; + int32_t nRet; JBIG2_ALLOC(pHRD, CJBig2_HTRDProc()); if((parseRegionInfo(&ri) != JBIG2_SUCCESS) || (m_pStream->read1Byte(&cFlags) != 0) @@ -1474,8 +1474,8 @@ failed: FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; - FX_BYTE cFlags; - FX_INT32 i, nRet; + uint8_t cFlags; + int32_t i, nRet; if(m_pGRD == NULL) { JBIG2_ALLOC(m_pGRD, CJBig2_GRDProc()); if((parseRegionInfo(&m_ri) != JBIG2_SUCCESS) @@ -1497,7 +1497,7 @@ FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* if(m_pGRD->MMR == 0) { if(m_pGRD->GBTEMPLATE == 0) { for(i = 0; i < 8; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) { + if(m_pStream->read1Byte((uint8_t*)&m_pGRD->GBAT[i]) != 0) { m_pModule->JBig2_Error("generic region segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -1505,7 +1505,7 @@ FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* } } else { for(i = 0; i < 2; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) { + if(m_pStream->read1Byte((uint8_t*)&m_pGRD->GBAT[i]) != 0) { m_pModule->JBig2_Error("generic region segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -1593,8 +1593,8 @@ FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) FX_DWORD dwTemp; JBig2RegionInfo ri; CJBig2_Segment *pSeg; - FX_INT32 i, nRet; - FX_BYTE cFlags; + int32_t i, nRet; + uint8_t cFlags; JBig2ArithCtx *grContext; CJBig2_GRRDProc *pGRRD; CJBig2_ArithDecoder *pArithDecoder; @@ -1611,7 +1611,7 @@ FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) pGRRD->TPGRON = (cFlags >> 1) & 0x01; if(pGRRD->GRTEMPLATE == 0) { for(i = 0; i < 4; i++) { - if(m_pStream->read1Byte((FX_BYTE*)&pGRRD->GRAT[i]) != 0) { + if(m_pStream->read1Byte((uint8_t*)&pGRRD->GRAT[i]) != 0) { m_pModule->JBig2_Error("generic refinement region segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; goto failed; @@ -1687,7 +1687,7 @@ FX_BOOL CJBig2_Context::parseTable(CJBig2_Segment *pSegment) m_pStream->alignByte(); return JBIG2_SUCCESS; } -FX_INT32 CJBig2_Context::parseRegionInfo(JBig2RegionInfo *pRI) +int32_t CJBig2_Context::parseRegionInfo(JBig2RegionInfo *pRI) { if((m_pStream->readInteger((FX_DWORD*)&pRI->width) != 0) || (m_pStream->readInteger((FX_DWORD*)&pRI->height) != 0) @@ -1702,9 +1702,9 @@ JBig2HuffmanCode *CJBig2_Context::decodeSymbolIDHuffmanTable(CJBig2_BitStream *p FX_DWORD SBNUMSYMS) { JBig2HuffmanCode *SBSYMCODES; - FX_INT32 runcodes[35], runcodes_len[35], runcode; - FX_INT32 i, j, nTemp, nVal, nBits; - FX_INT32 run; + int32_t runcodes[35], runcodes_len[35], runcode; + int32_t i, j, nTemp, nVal, nBits; + int32_t run; SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(sizeof(JBig2HuffmanCode), SBNUMSYMS); for (i = 0; i < 35; i ++) { if(pStream->readNBits(4, &runcodes_len[i]) != 0) { diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h index f46530e005..b12853accf 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.h +++ b/core/src/fxcodec/jbig2/JBig2_Context.h @@ -14,7 +14,7 @@ #include "../../../include/fxcodec/fx_codec_def.h" #include "../../../include/fxcrt/fx_basic.h" #include <utility> -typedef std::pair<FX_BYTE*, CJBig2_SymbolDict*> CJBig2_CachePair; +typedef std::pair<uint8_t*, CJBig2_SymbolDict*> CJBig2_CachePair; typedef enum { JBIG2_OUT_OF_PAGE = 0, JBIG2_IN_PAGE, @@ -37,64 +37,64 @@ class CJBig2_Context : public CJBig2_Object { public: - static CJBig2_Context *CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength, - FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause = NULL); + static CJBig2_Context *CreateContext(CJBig2_Module *pModule, uint8_t *pGlobalData, FX_DWORD dwGlobalLength, + uint8_t *pData, FX_DWORD dwLength, int32_t nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause = NULL); static void DestroyContext(CJBig2_Context *pContext); - FX_INT32 getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause); + int32_t getFirstPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause); - FX_INT32 getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause); + int32_t getNextPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause); - FX_INT32 getFirstPage(CJBig2_Image **image, IFX_Pause* pPause); + int32_t getFirstPage(CJBig2_Image **image, IFX_Pause* pPause); - FX_INT32 getNextPage(CJBig2_Image **image, IFX_Pause* pPause); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t getNextPage(CJBig2_Image **image, IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); FXCODEC_STATUS GetProcessiveStatus() { return m_ProcessiveStatus; }; private: - CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength, - FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause); + CJBig2_Context(uint8_t *pGlobalData, FX_DWORD dwGlobalLength, + uint8_t *pData, FX_DWORD dwLength, int32_t nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause); ~CJBig2_Context(); - FX_INT32 decodeFile(IFX_Pause* pPause); + int32_t decodeFile(IFX_Pause* pPause); - FX_INT32 decode_SquentialOrgnazation(IFX_Pause* pPause); + int32_t decode_SquentialOrgnazation(IFX_Pause* pPause); - FX_INT32 decode_EmbedOrgnazation(IFX_Pause* pPause); + int32_t decode_EmbedOrgnazation(IFX_Pause* pPause); - FX_INT32 decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause); + int32_t decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause); - FX_INT32 decode_RandomOrgnazation(IFX_Pause* pPause); + int32_t decode_RandomOrgnazation(IFX_Pause* pPause); CJBig2_Segment *findSegmentByNumber(FX_DWORD dwNumber); - CJBig2_Segment *findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment, FX_BYTE cType, FX_INT32 nIndex); + CJBig2_Segment *findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment, uint8_t cType, int32_t nIndex); - FX_INT32 parseSegmentHeader(CJBig2_Segment *pSegment); + int32_t parseSegmentHeader(CJBig2_Segment *pSegment); - FX_INT32 parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 parseTextRegion(CJBig2_Segment *pSegment); + int32_t parseTextRegion(CJBig2_Segment *pSegment); - FX_INT32 parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause); + int32_t parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause); - FX_INT32 parseGenericRefinementRegion(CJBig2_Segment *pSegment); + int32_t parseGenericRefinementRegion(CJBig2_Segment *pSegment); - FX_INT32 parseTable(CJBig2_Segment *pSegment); + int32_t parseTable(CJBig2_Segment *pSegment); - FX_INT32 parseRegionInfo(JBig2RegionInfo *pRI); + int32_t parseRegionInfo(JBig2RegionInfo *pRI); @@ -108,11 +108,11 @@ private: CJBig2_Context *m_pGlobalContext; - FX_INT32 m_nStreamType; + int32_t m_nStreamType; CJBig2_BitStream *m_pStream; - FX_INT32 m_nState; + int32_t m_nState; CJBig2_List<CJBig2_Segment> *m_pSegmentList; @@ -122,9 +122,9 @@ private: FX_BOOL m_bBufSpecified; - FX_INT32 m_nSegmentDecoded; + int32_t m_nSegmentDecoded; IFX_Pause* m_pPause; - FX_INT32 m_PauseStep; + int32_t m_PauseStep; FXCODEC_STATUS m_ProcessiveStatus; FX_BOOL m_bFirstPage; CJBig2_ArithDecoder *m_pArithDecoder; diff --git a/core/src/fxcodec/jbig2/JBig2_Define.h b/core/src/fxcodec/jbig2/JBig2_Define.h index ccf15d07ba..46c6e2b532 100644 --- a/core/src/fxcodec/jbig2/JBig2_Define.h +++ b/core/src/fxcodec/jbig2/JBig2_Define.h @@ -13,15 +13,15 @@ #include "JBig2_Object.h" #define JBIG2_OOB 1 typedef struct { - FX_INT32 width, + int32_t width, height; - FX_INT32 x, + int32_t x, y; - FX_BYTE flags; + uint8_t flags; } JBig2RegionInfo; typedef struct { - FX_INT32 codelen; - FX_INT32 code; + int32_t codelen; + int32_t code; } JBig2HuffmanCode; extern "C" { void _FaxG4Decode(void *pModule, FX_LPCBYTE src_buf, FX_DWORD src_size, int* pbitpos, FX_LPBYTE dest_buf, int width, int height, int pitch = 0); diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp index a5928f9ea3..bad595e6b7 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp @@ -150,9 +150,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, cVal; - FX_INTPTR nStride, nStride2; - FX_INT32 nBits, k; + uint8_t *pLine, cVal; + intptr_t nStride, nStride2; + int32_t nBits, k; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -217,9 +217,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine, *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -401,9 +401,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, cVal; - FX_INTPTR nStride, nStride2; - FX_INT32 nBits, k; + uint8_t *pLine, cVal; + intptr_t nStride, nStride2; + int32_t nBits, k; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -468,9 +468,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine, *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -647,9 +647,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, cVal; - FX_INTPTR nStride, nStride2; - FX_INT32 nBits, k; + uint8_t *pLine, cVal; + intptr_t nStride, nStride2; + int32_t nBits, k; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -714,9 +714,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; - FX_BYTE *pLine, *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine, *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -887,9 +887,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1; - FX_BYTE *pLine, cVal; - FX_INTPTR nStride; - FX_INT32 nBits, k; + uint8_t *pLine, cVal; + intptr_t nStride; + int32_t nBits, k; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -945,9 +945,9 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *p FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1; - FX_BYTE *pLine, *pLine1, cVal; - FX_INT32 nStride, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine, *pLine1, cVal; + int32_t nStride, k; + int32_t nLineBytes, nBitsLeft, cc; LTP = 0; JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH)); if (GBREG->m_pData == NULL) { @@ -1428,13 +1428,13 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line1_r, line2_r, line3_r; - FX_BYTE *pLine, *pLineR, cVal; - FX_INTPTR nStride, nStrideR, nOffset; - FX_INT32 k, nBits; - FX_INT32 GRWR, GRHR; - FX_INT32 GRW, GRH; - GRW = (FX_INT32)CJBig2_GRRDProc::GRW; - GRH = (FX_INT32)CJBig2_GRRDProc::GRH; + uint8_t *pLine, *pLineR, cVal; + intptr_t nStride, nStrideR, nOffset; + int32_t k, nBits; + int32_t GRWR, GRHR; + int32_t GRW, GRH; + GRW = (int32_t)CJBig2_GRRDProc::GRW; + GRH = (int32_t)CJBig2_GRRDProc::GRH; LTP = 0; JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH)); if (GRREG->m_pData == NULL) { @@ -1446,19 +1446,19 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD pLineR = GRREFERENCE->m_pData; nStride = GRREG->m_nStride; nStrideR = GRREFERENCE->m_nStride; - GRWR = (FX_INT32)GRREFERENCE->m_nWidth; - GRHR = (FX_INT32)GRREFERENCE->m_nHeight; + GRWR = (int32_t)GRREFERENCE->m_nWidth; + GRHR = (int32_t)GRREFERENCE->m_nHeight; if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) { GRREFERENCEDY = 0; } nOffset = -GRREFERENCEDY * nStrideR; - for (FX_INT32 h = 0; h < GRH; h++) { + for (int32_t h = 0; h < GRH; h++) { if(TPGRON) { SLTP = pArithDecoder->DECODE(&grContext[0x0010]); LTP = LTP ^ SLTP; } line1 = (h > 0) ? pLine[-nStride] << 4 : 0; - FX_INT32 reference_h = h - GRREFERENCEDY; + int32_t reference_h = h - GRREFERENCEDY; FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR); FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); @@ -1468,7 +1468,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD if(LTP == 0) { CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0) | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007); - for (FX_INT32 w = 0; w < GRW; w += 8) { + for (int32_t w = 0; w < GRW; w += 8) { nBits = GRW - w > 8 ? 8 : GRW - w; if (h > 0) line1 = (line1 << 8) | @@ -1506,7 +1506,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD } else { CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0) | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007); - for (FX_INT32 w = 0; w < GRW; w += 8) { + for (int32_t w = 0; w < GRW; w += 8) { nBits = GRW - w > 8 ? 8 : GRW - w; if (h > 0) line1 = (line1 << 8) | @@ -1637,13 +1637,13 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line1_r, line2_r, line3_r; - FX_BYTE *pLine, *pLineR, cVal; - FX_INTPTR nStride, nStrideR, nOffset; - FX_INT32 k, nBits; - FX_INT32 GRWR, GRHR; - FX_INT32 GRW, GRH; - GRW = (FX_INT32)CJBig2_GRRDProc::GRW; - GRH = (FX_INT32)CJBig2_GRRDProc::GRH; + uint8_t *pLine, *pLineR, cVal; + intptr_t nStride, nStrideR, nOffset; + int32_t k, nBits; + int32_t GRWR, GRHR; + int32_t GRW, GRH; + GRW = (int32_t)CJBig2_GRRDProc::GRW; + GRH = (int32_t)CJBig2_GRRDProc::GRH; LTP = 0; JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH)); if (GRREG->m_pData == NULL) { @@ -1655,19 +1655,19 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD pLineR = GRREFERENCE->m_pData; nStride = GRREG->m_nStride; nStrideR = GRREFERENCE->m_nStride; - GRWR = (FX_INT32)GRREFERENCE->m_nWidth; - GRHR = (FX_INT32)GRREFERENCE->m_nHeight; + GRWR = (int32_t)GRREFERENCE->m_nWidth; + GRHR = (int32_t)GRREFERENCE->m_nHeight; if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) { GRREFERENCEDY = 0; } nOffset = -GRREFERENCEDY * nStrideR; - for (FX_INT32 h = 0; h < GRH; h++) { + for (int32_t h = 0; h < GRH; h++) { if(TPGRON) { SLTP = pArithDecoder->DECODE(&grContext[0x0008]); LTP = LTP ^ SLTP; } line1 = (h > 0) ? pLine[-nStride] << 1 : 0; - FX_INT32 reference_h = h - GRREFERENCEDY; + int32_t reference_h = h - GRREFERENCEDY; FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR); FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); @@ -1677,7 +1677,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD if(LTP == 0) { CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020) | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003); - for (FX_INT32 w = 0; w < GRW; w += 8) { + for (int32_t w = 0; w < GRW; w += 8) { nBits = GRW - w > 8 ? 8 : GRW - w; if (h > 0) line1 = (line1 << 8) | @@ -1709,7 +1709,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD } else { CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020) | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003); - for (FX_INT32 w = 0; w < GRW; w += 8) { + for (int32_t w = 0; w < GRW; w += 8) { nBits = GRW - w > 8 ? 8 : GRW - w; if (h > 0) line1 = (line1 << 8) | @@ -1872,23 +1872,23 @@ CJBig2_Image *CJBig2_GRRDProc::decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBi } CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext) { - FX_INT32 STRIPT, FIRSTS; + int32_t STRIPT, FIRSTS; FX_DWORD NINSTANCES; - FX_INT32 DT, DFS, CURS; - FX_BYTE CURT; - FX_INT32 SI, TI; + int32_t DT, DFS, CURS; + uint8_t CURT; + int32_t SI, TI; FX_DWORD IDI; CJBig2_Image *IBI; FX_DWORD WI, HI; - FX_INT32 IDS; + int32_t IDS; FX_BOOL RI; - FX_INT32 RDWI, RDHI, RDXI, RDYI; + int32_t RDWI, RDHI, RDXI, RDYI; CJBig2_Image *IBOI; FX_DWORD WOI, HOI; CJBig2_Image *SBREG; FX_BOOL bFirst; FX_DWORD nTmp; - FX_INT32 nVal, nBits; + int32_t nVal, nBits; CJBig2_HuffmanDecoder *pHuffmanDecoder; CJBig2_GRRDProc *pGRRD; CJBig2_ArithDecoder *pArithDecoder; @@ -2092,23 +2092,23 @@ failed: CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext, JBig2IntDecoderState *pIDS) { - FX_INT32 STRIPT, FIRSTS; + int32_t STRIPT, FIRSTS; FX_DWORD NINSTANCES; - FX_INT32 DT, DFS, CURS; - FX_INT32 CURT; - FX_INT32 SI, TI; + int32_t DT, DFS, CURS; + int32_t CURT; + int32_t SI, TI; FX_DWORD IDI; CJBig2_Image *IBI; FX_DWORD WI, HI; - FX_INT32 IDS; + int32_t IDS; FX_BOOL RI; - FX_INT32 RDWI, RDHI, RDXI, RDYI; + int32_t RDWI, RDHI, RDXI, RDYI; CJBig2_Image *IBOI; FX_DWORD WOI, HOI; CJBig2_Image *SBREG; FX_BOOL bFirst; - FX_INT32 nRet, nVal; - FX_INT32 bRetained; + int32_t nRet, nVal; + int32_t bRetained; CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, *IARDX, *IARDY; CJBig2_ArithIaidDecoder *IAID; CJBig2_GRRDProc *pGRRD; @@ -2333,21 +2333,21 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod { CJBig2_Image **SDNEWSYMS; FX_DWORD HCHEIGHT, NSYMSDECODED; - FX_INT32 HCDH; + int32_t HCDH; FX_DWORD SYMWIDTH, TOTWIDTH; - FX_INT32 DW; + int32_t DW; CJBig2_Image *BS; FX_DWORD I, J, REFAGGNINST; FX_BOOL *EXFLAGS; FX_DWORD EXINDEX; FX_BOOL CUREXFLAG; FX_DWORD EXRUNLENGTH; - FX_INT32 nVal; + int32_t nVal; FX_DWORD nTmp; FX_DWORD SBNUMSYMS; - FX_BYTE SBSYMCODELEN; + uint8_t SBSYMCODELEN; FX_DWORD IDI; - FX_INT32 RDXI, RDYI; + int32_t RDXI, RDYI; CJBig2_Image **SBSYMS; CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; @@ -2374,7 +2374,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod while((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) { nTmp ++; } - JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder((FX_BYTE)nTmp)); + JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder((uint8_t)nTmp)); SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(CJBig2_Image*)); FXSYS_memset32(SDNEWSYMS, 0 , SDNUMNEWSYMS * sizeof(CJBig2_Image*)); HCHEIGHT = 0; @@ -2458,7 +2458,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) { nTmp ++; } - SBSYMCODELEN = (FX_BYTE)nTmp; + SBSYMCODELEN = (uint8_t)nTmp; pDecoder->SBSYMCODELEN = SBSYMCODELEN; SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*)); JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*)); @@ -2671,22 +2671,22 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, CJBig2_Image **SDNEWSYMS; FX_DWORD *SDNEWSYMWIDTHS; FX_DWORD HCHEIGHT, NSYMSDECODED; - FX_INT32 HCDH; + int32_t HCDH; FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM; - FX_INT32 DW; + int32_t DW; CJBig2_Image *BS, *BHC; FX_DWORD I, J, REFAGGNINST; FX_BOOL *EXFLAGS; FX_DWORD EXINDEX; FX_BOOL CUREXFLAG; FX_DWORD EXRUNLENGTH; - FX_INT32 nVal, nBits; + int32_t nVal, nBits; FX_DWORD nTmp; FX_DWORD SBNUMSYMS; - FX_BYTE SBSYMCODELEN; + uint8_t SBSYMCODELEN; JBig2HuffmanCode *SBSYMCODES; FX_DWORD IDI; - FX_INT32 RDXI, RDYI; + int32_t RDXI, RDYI; FX_DWORD BMSIZE; FX_DWORD stride; CJBig2_Image **SBSYMS; @@ -2843,7 +2843,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) { nTmp ++; } - SBSYMCODELEN = (FX_BYTE)nTmp; + SBSYMCODELEN = (uint8_t)nTmp; SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(JBig2HuffmanCode)); for(I = 0; I < SBNUMSYMS; I++) { SBSYMCODES[I].codelen = SBSYMCODELEN; @@ -2931,7 +2931,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, NSYMSDECODED = NSYMSDECODED + 1; } if(SDREFAGG == 0) { - if(pHuffmanDecoder->decodeAValue(SDHUFFBMSIZE, (FX_INT32*)&BMSIZE) != 0) { + if(pHuffmanDecoder->decodeAValue(SDHUFFBMSIZE, (int32_t*)&BMSIZE) != 0) { m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short."); goto failed; } @@ -3042,7 +3042,7 @@ CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { FX_DWORD ng, mg; - FX_INT32 x, y; + int32_t x, y; CJBig2_Image *HSKIP; FX_DWORD HBPP; FX_DWORD *GI; @@ -3057,8 +3057,8 @@ CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, for(ng = 0; ng < HGW; ng++) { x = (HGX + mg * HRY + ng * HRX) >> 8; y = (HGY + mg * HRX - ng * HRY) >> 8; - if((x + HPW <= 0) | (x >= (FX_INT32)HBW) - | (y + HPH <= 0) | (y >= (FX_INT32)HPH)) { + if((x + HPW <= 0) | (x >= (int32_t)HBW) + | (y + HPH <= 0) | (y >= (int32_t)HPH)) { HSKIP->setPixel(ng, mg, 1); } else { HSKIP->setPixel(ng, mg, 0); @@ -3074,7 +3074,7 @@ CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, pGID->GSMMR = HMMR; pGID->GSW = HGW; pGID->GSH = HGH; - pGID->GSBPP = (FX_BYTE)HBPP; + pGID->GSBPP = (uint8_t)HBPP; pGID->GSUSESKIP = HENABLESKIP; pGID->GSKIP = HSKIP; pGID->GSTEMPLATE = HTEMPLATE; @@ -3110,7 +3110,7 @@ failed: CJBig2_Image *CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause) { FX_DWORD ng, mg; - FX_INT32 x, y; + int32_t x, y; FX_DWORD HBPP; FX_DWORD *GI; CJBig2_Image *HTREG; @@ -3125,7 +3125,7 @@ CJBig2_Image *CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pGID->GSMMR = HMMR; pGID->GSW = HGW; pGID->GSH = HGH; - pGID->GSBPP = (FX_BYTE)HBPP; + pGID->GSBPP = (uint8_t)HBPP; pGID->GSUSESKIP = 0; GI = pGID->decode_MMR(pStream, pPause); if(GI == NULL) { @@ -3168,7 +3168,7 @@ CJBig2_PatternDict *CJBig2_PDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDeco pGRD->GBTEMPLATE = HDTEMPLATE; pGRD->TPGDON = 0; pGRD->USESKIP = 0; - pGRD->GBAT[0] = -(FX_INT32)HDPW; + pGRD->GBAT[0] = -(int32_t)HDPW; pGRD->GBAT[1] = 0; if(pGRD->GBTEMPLATE == 0) { pGRD->GBAT[2] = -3; @@ -3237,7 +3237,7 @@ FX_DWORD *CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { CJBig2_Image **GSPLANES; - FX_INT32 J, K; + int32_t J, K; FX_DWORD x, y; FX_DWORD *GSVALS; CJBig2_GRDProc *pGRD; @@ -3318,7 +3318,7 @@ failed: FX_DWORD *CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause) { CJBig2_Image **GSPLANES; - FX_INT32 J, K; + int32_t J, K; FX_DWORD x, y; FX_DWORD *GSVALS; CJBig2_GRDProc *pGRD; @@ -3808,9 +3808,9 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; - FX_BYTE *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; if(m_pLine == NULL) { m_pLine = pImage->m_pData; } @@ -3949,9 +3949,9 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; - FX_BYTE *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; if (!m_pLine) { m_pLine = pImage->m_pData; } @@ -4087,9 +4087,9 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; - FX_BYTE *pLine1, *pLine2, cVal; - FX_INT32 nStride, nStride2, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine1, *pLine2, cVal; + int32_t nStride, nStride2, k; + int32_t nLineBytes, nBitsLeft, cc; if(!m_pLine) { m_pLine = pImage->m_pData; } @@ -4223,9 +4223,9 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1; - FX_BYTE *pLine1, cVal; - FX_INT32 nStride, k; - FX_INT32 nLineBytes, nBitsLeft, cc; + uint8_t *pLine1, cVal; + int32_t nStride, k; + int32_t nLineBytes, nBitsLeft, cc; if (!m_pLine) { m_pLine = pImage->m_pData; } diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h index 3f43c979a5..45e2940d3a 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h @@ -68,7 +68,7 @@ private: FXCODEC_STATUS decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause); FXCODEC_STATUS decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause); FX_DWORD m_loopIndex; - FX_BYTE * m_pLine; + uint8_t * m_pLine; IFX_Pause* m_pPause; FXCODEC_STATUS m_ProssiveStatus; CJBig2_Image** m_pImage; @@ -114,7 +114,7 @@ public: FX_BOOL MMR; FX_DWORD GBW; FX_DWORD GBH; - FX_BYTE GBTEMPLATE; + uint8_t GBTEMPLATE; FX_BOOL TPGDON; FX_BOOL USESKIP; CJBig2_Image * SKIP; @@ -140,8 +140,8 @@ public: FX_DWORD GRH; FX_BOOL GRTEMPLATE; CJBig2_Image *GRREFERENCE; - FX_INT32 GRREFERENCEDX; - FX_INT32 GRREFERENCEDY; + int32_t GRREFERENCEDX; + int32_t GRREFERENCEDY; FX_BOOL TPGRON; signed char GRAT[4]; }; @@ -175,7 +175,7 @@ public: FX_DWORD SBNUMSYMS; JBig2HuffmanCode *SBSYMCODES; - FX_BYTE SBSYMCODELEN; + uint8_t SBSYMCODELEN; CJBig2_Image **SBSYMS; FX_BOOL SBDEFPIXEL; @@ -214,7 +214,7 @@ public: *SDHUFFDW, *SDHUFFBMSIZE, *SDHUFFAGGINST; - FX_BYTE SDTEMPLATE; + uint8_t SDTEMPLATE; signed char SDAT[8]; FX_BOOL SDRTEMPLATE; signed char SDRAT[4]; @@ -230,7 +230,7 @@ public: FX_DWORD HBW, HBH; FX_BOOL HMMR; - FX_BYTE HTEMPLATE; + uint8_t HTEMPLATE; FX_DWORD HNUMPATS; CJBig2_Image **HPATS; FX_BOOL HDEFPIXEL; @@ -238,11 +238,11 @@ public: FX_BOOL HENABLESKIP; FX_DWORD HGW, HGH; - FX_INT32 HGX, + int32_t HGX, HGY; FX_WORD HRX, HRY; - FX_BYTE HPW, + uint8_t HPW, HPH; }; class CJBig2_PDDProc : public CJBig2_Object @@ -254,10 +254,10 @@ public: CJBig2_PatternDict *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause); public: FX_BOOL HDMMR; - FX_BYTE HDPW, + uint8_t HDPW, HDPH; FX_DWORD GRAYMAX; - FX_BYTE HDTEMPLATE; + uint8_t HDTEMPLATE; }; class CJBig2_GSIDProc : public CJBig2_Object { @@ -269,10 +269,10 @@ public: public: FX_BOOL GSMMR; FX_BOOL GSUSESKIP; - FX_BYTE GSBPP; + uint8_t GSBPP; FX_DWORD GSW, GSH; - FX_BYTE GSTEMPLATE; + uint8_t GSTEMPLATE; CJBig2_Image *GSKIP; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_Image.cpp b/core/src/fxcodec/jbig2/JBig2_Image.cpp index f2cea597c1..044ccf7410 100644 --- a/core/src/fxcodec/jbig2/JBig2_Image.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Image.cpp @@ -11,7 +11,7 @@ #include "../../../include/fxcrt/fx_safe_types.h" #include "JBig2_Image.h" -CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h) +CJBig2_Image::CJBig2_Image(int32_t w, int32_t h) { m_nWidth = w; m_nHeight = h; @@ -22,13 +22,13 @@ CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h) } m_nStride = ((w + 31) >> 5) << 2; if (m_nStride * m_nHeight > 0 && 104857600 / (int)m_nStride > m_nHeight) { - m_pData = (FX_BYTE *)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight); + m_pData = (uint8_t *)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight); } else { m_pData = NULL; } m_bNeedFree = TRUE; } -CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf) +CJBig2_Image::CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf) { m_nWidth = w; m_nHeight = h; @@ -43,7 +43,7 @@ CJBig2_Image::CJBig2_Image(CJBig2_Image &im) m_nHeight = im.m_nHeight; m_nStride = im.m_nStride; if (im.m_pData) { - m_pData = (FX_BYTE*)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight); + m_pData = (uint8_t*)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight); JBIG2_memcpy(m_pData, im.m_pData, m_nStride * m_nHeight); } else { m_pData = NULL; @@ -56,12 +56,12 @@ CJBig2_Image::~CJBig2_Image() m_pModule->JBig2_Free(m_pData); } } -FX_BOOL CJBig2_Image::getPixel(FX_INT32 x, FX_INT32 y) +FX_BOOL CJBig2_Image::getPixel(int32_t x, int32_t y) { if (!m_pData) { return 0; } - FX_INT32 m, n; + int32_t m, n; if(x < 0 || x >= m_nWidth) { return 0; } @@ -73,12 +73,12 @@ FX_BOOL CJBig2_Image::getPixel(FX_INT32 x, FX_INT32 y) return ((m_pData[m] >> (7 - n)) & 1); } -FX_INT32 CJBig2_Image::setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v) +int32_t CJBig2_Image::setPixel(int32_t x, int32_t y, FX_BOOL v) { if (!m_pData) { return 0; } - FX_INT32 m, n; + int32_t m, n; if(x < 0 || x >= m_nWidth) { return 0; } @@ -94,7 +94,7 @@ FX_INT32 CJBig2_Image::setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v) } return 1; } -void CJBig2_Image::copyLine(FX_INT32 hTo, FX_INT32 hFrom) +void CJBig2_Image::copyLine(int32_t hTo, int32_t hFrom) { if (!m_pData) { return; @@ -112,14 +112,14 @@ void CJBig2_Image::fill(FX_BOOL v) } JBIG2_memset(m_pData, v ? 0xff : 0, m_nStride * m_nHeight); } -FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { if (!m_pData) { return FALSE; } return composeTo_opt2(pDst, x, y, op); } -FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) { if (!m_pData) { return FALSE; @@ -129,10 +129,10 @@ FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig } return composeTo_opt2(pDst, x, y, op, pSrcRect); } -FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { - FX_INT32 w, h, dx, dy; - FX_INT32 i, j; + int32_t w, h, dx, dy; + int32_t i, j; w = m_nWidth; h = m_nHeight; dx = dy = 0; @@ -196,10 +196,10 @@ FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y return TRUE; } -FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { - FX_INT32 x0, x1, y0, y1, xx, yy; - FX_BYTE *pLineSrc, *pLineDst, *srcPtr, *destPtr; + int32_t x0, x1, y0, y1, xx, yy; + uint8_t *pLineSrc, *pLineDst, *srcPtr, *destPtr; FX_DWORD src0, src1, src, dest, s1, s2, m1, m2, m3; FX_BOOL oneByte; if (!m_pData) { @@ -247,7 +247,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc; dest = *destPtr; dest |= (*srcPtr >> s1) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -259,7 +259,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc; dest = *destPtr; dest &= ((0xff00 | *srcPtr) >> s1) | m1; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -271,7 +271,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc; dest = *destPtr; dest ^= (*srcPtr >> s1) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -283,7 +283,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc; dest = *destPtr; dest ^= ((*srcPtr ^ 0xff) >> s1) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -295,7 +295,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc; dest = *destPtr; dest = (dest & ~m3) | ((*srcPtr >> s1) & m3); - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -310,7 +310,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc + (-x >> 3); dest = *destPtr; dest |= *srcPtr & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -322,7 +322,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc + (-x >> 3); dest = *destPtr; dest &= *srcPtr | m1; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -334,7 +334,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc + (-x >> 3); dest = *destPtr; dest ^= *srcPtr & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -346,7 +346,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc + (-x >> 3); dest = *destPtr; dest ^= (*srcPtr ^ 0xff) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -358,7 +358,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, srcPtr = pLineSrc + (-x >> 3); dest = *destPtr; dest = (*srcPtr & m2) | (dest & m1); - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -376,7 +376,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; dest = *destPtr; dest |= src1 >> s1; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; xx = x0 + 8; for (; xx < x1 - 8; xx += 8) { dest = *destPtr; @@ -384,7 +384,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest |= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -395,7 +395,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest |= src & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -408,7 +408,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; dest = *destPtr; dest &= (0xff00 | src1) >> s1; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; xx = x0 + 8; for (; xx < x1 - 8; xx += 8) { dest = *destPtr; @@ -416,7 +416,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest &= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -427,7 +427,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest &= src | m1; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -440,7 +440,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; dest = *destPtr; dest ^= src1 >> s1; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; xx = x0 + 8; for (; xx < x1 - 8; xx += 8) { dest = *destPtr; @@ -448,7 +448,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -459,7 +459,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -472,7 +472,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; dest = *destPtr; dest ^= (src1 ^ 0xff) >> s1; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; xx = x0 + 8; for (; xx < x1 - 8; xx += 8) { dest = *destPtr; @@ -480,7 +480,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src ^ 0xff; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -491,7 +491,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= (src ^ 0xff) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -504,7 +504,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; dest = *destPtr; dest = (dest & (0xff << s2)) | (src1 >> s1); - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; xx = x0 + 8; for (; xx < x1 - 8; xx += 8) { dest = *destPtr; @@ -512,7 +512,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest = src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -523,7 +523,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest = (src & m2) | (dest & m1); - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -544,7 +544,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest |= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -555,7 +555,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest |= src & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -573,7 +573,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest &= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -584,7 +584,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest &= src | m1; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -602,7 +602,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -613,7 +613,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -631,7 +631,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= src ^ 0xff; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -642,7 +642,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest ^= (src ^ 0xff) & m2; - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -660,7 +660,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; dest = src; - *destPtr++ = (FX_BYTE)dest; + *destPtr++ = (uint8_t)dest; } dest = *destPtr; src0 = src1; @@ -671,7 +671,7 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } src = (((src0 << 8) | src1) >> s1) & 0xff; dest = (src & m2) | (dest & m1); - *destPtr = (FX_BYTE)dest; + *destPtr = (uint8_t)dest; pLineDst += pDst->m_nStride; pLineSrc += m_nStride; } @@ -682,24 +682,24 @@ FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } return TRUE; } -FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op) { if (!m_pData) { return FALSE; } return pSrc->composeTo(this, x, y, op); } -FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect) { if (!m_pData) { return FALSE; } return pSrc->composeTo(this, x, y, op, pSrcRect); } -CJBig2_Image *CJBig2_Image::subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h) +CJBig2_Image *CJBig2_Image::subImage_unopt(int32_t x, int32_t y, int32_t w, int32_t h) { CJBig2_Image *pImage; - FX_INT32 i, j; + int32_t i, j; JBIG2_ALLOC(pImage, CJBig2_Image(w, h)); for(j = 0; j < h; j++) { for(i = 0; i < w; i++) { @@ -709,13 +709,13 @@ CJBig2_Image *CJBig2_Image::subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, F return pImage; } #define JBIG2_GETDWORD(buf) ((FX_DWORD)(((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | (buf)[3])) -CJBig2_Image *CJBig2_Image::subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h) +CJBig2_Image *CJBig2_Image::subImage(int32_t x, int32_t y, int32_t w, int32_t h) { CJBig2_Image *pImage; - FX_INT32 m, n, j; - FX_BYTE *pLineSrc, *pLineDst; + int32_t m, n, j; + uint8_t *pLineSrc, *pLineDst; FX_DWORD wTmp; - FX_BYTE *pSrc, *pSrcEnd, *pDst, *pDstEnd; + uint8_t *pSrc, *pSrcEnd, *pDst, *pDstEnd; if (w == 0 || h == 0) { return NULL; } @@ -755,10 +755,10 @@ CJBig2_Image *CJBig2_Image::subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT3 } else { wTmp = JBIG2_GETDWORD(pSrc) << n; } - pDst[0] = (FX_BYTE)(wTmp >> 24); - pDst[1] = (FX_BYTE)(wTmp >> 16); - pDst[2] = (FX_BYTE)(wTmp >> 8); - pDst[3] = (FX_BYTE)wTmp; + pDst[0] = (uint8_t)(wTmp >> 24); + pDst[1] = (uint8_t)(wTmp >> 16); + pDst[2] = (uint8_t)(wTmp >> 8); + pDst[3] = (uint8_t)wTmp; } pLineSrc += m_nStride; pLineDst += pImage->m_nStride; @@ -766,7 +766,7 @@ CJBig2_Image *CJBig2_Image::subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT3 } return pImage; } -void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v) +void CJBig2_Image::expand(int32_t h, FX_BOOL v) { if (!m_pData || h <= m_nHeight) { return; @@ -780,7 +780,7 @@ void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v) return; } //The guaranteed reallocated memory is to be < 4GB (unsigned int). - m_pData = (FX_BYTE*)m_pModule->JBig2_Realloc(m_pData, safeMemSize.ValueOrDie()); + m_pData = (uint8_t*)m_pModule->JBig2_Realloc(m_pData, safeMemSize.ValueOrDie()); //The result of dwHeight * dwStride doesn't overflow after the //checking of safeMemSize. //The same as the result of (dwH - dwHeight) * dwStride) because @@ -789,15 +789,15 @@ void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v) JBIG2_memset(m_pData + dwHeight * dwStride, v ? 0xff : 0, (dwH - dwHeight) * dwStride); m_nHeight = h; } -FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { - FX_INT32 xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0, + int32_t xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0, yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0; FX_DWORD s1 = 0, d1 = 0, d2 = 0, shift = 0, shift1 = 0, shift2 = 0, tmp = 0, tmp1 = 0, tmp2 = 0, maskL = 0, maskR = 0, maskM = 0; - FX_BYTE *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL; + uint8_t *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL; if (!m_pData) { return FALSE; @@ -867,10 +867,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -896,10 +896,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -927,10 +927,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -963,10 +963,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -990,10 +990,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1018,10 +1018,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; @@ -1051,10 +1051,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1078,10 +1078,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1105,10 +1105,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; @@ -1140,10 +1140,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; dp += 4; } for(xx = 0; xx < middleDwords; xx++) { @@ -1166,10 +1166,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1194,10 +1194,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; @@ -1206,12 +1206,12 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, } return 1; } -FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) { - FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft; + int32_t xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft; FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM; - FX_BYTE *lineSrc, *lineDst, *sp, *dp; - FX_INT32 sw, sh; + uint8_t *lineSrc, *lineDst, *sp, *dp; + int32_t sw, sh; if (!m_pData) { return FALSE; } @@ -1290,10 +1290,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -1319,10 +1319,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -1350,10 +1350,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskM) | (tmp1 & maskM); break; } - lineDst[0] = (FX_BYTE)(tmp >> 24); - lineDst[1] = (FX_BYTE)(tmp >> 16); - lineDst[2] = (FX_BYTE)(tmp >> 8); - lineDst[3] = (FX_BYTE)tmp; + lineDst[0] = (uint8_t)(tmp >> 24); + lineDst[1] = (uint8_t)(tmp >> 16); + lineDst[2] = (uint8_t)(tmp >> 8); + lineDst[3] = (uint8_t)tmp; lineSrc += m_nStride; lineDst += pDst->m_nStride; } @@ -1386,10 +1386,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1413,10 +1413,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1441,10 +1441,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; @@ -1474,10 +1474,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1501,10 +1501,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1528,10 +1528,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; @@ -1563,10 +1563,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskL) | (tmp1 & maskL); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; dp += 4; } for(xx = 0; xx < middleDwords; xx++) { @@ -1589,10 +1589,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = tmp1; break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; sp += 4; dp += 4; } @@ -1617,10 +1617,10 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, tmp = (tmp2 & ~maskR) | (tmp1 & maskR); break; } - dp[0] = (FX_BYTE)(tmp >> 24); - dp[1] = (FX_BYTE)(tmp >> 16); - dp[2] = (FX_BYTE)(tmp >> 8); - dp[3] = (FX_BYTE)tmp; + dp[0] = (uint8_t)(tmp >> 24); + dp[1] = (uint8_t)(tmp >> 16); + dp[2] = (uint8_t)(tmp >> 8); + dp[3] = (uint8_t)tmp; } lineSrc += m_nStride; lineDst += pDst->m_nStride; diff --git a/core/src/fxcodec/jbig2/JBig2_Image.h b/core/src/fxcodec/jbig2/JBig2_Image.h index 5d06695c7c..423bebcede 100644 --- a/core/src/fxcodec/jbig2/JBig2_Image.h +++ b/core/src/fxcodec/jbig2/JBig2_Image.h @@ -20,48 +20,48 @@ class CJBig2_Image : public CJBig2_Object { public: - CJBig2_Image(FX_INT32 w, FX_INT32 h); + CJBig2_Image(int32_t w, int32_t h); - CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf); + CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf); CJBig2_Image(CJBig2_Image &im); ~CJBig2_Image(); - FX_BOOL getPixel(FX_INT32 x, FX_INT32 y); + FX_BOOL getPixel(int32_t x, int32_t y); - FX_INT32 setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v); + int32_t setPixel(int32_t x, int32_t y, FX_BOOL v); - void copyLine(FX_INT32 hTo, FX_INT32 hFrom); + void copyLine(int32_t hTo, int32_t hFrom); void fill(FX_BOOL v); - FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op); - FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect); + FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); - FX_BOOL composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op); + FX_BOOL composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - FX_BOOL composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op); + FX_BOOL composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op); - FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect); + FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); - FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op); - FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect); - CJBig2_Image *subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h); + FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op); + FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect); + CJBig2_Image *subImage_unopt(int32_t x, int32_t y, int32_t w, int32_t h); - CJBig2_Image *subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h); + CJBig2_Image *subImage(int32_t x, int32_t y, int32_t w, int32_t h); - void expand(FX_INT32 h, FX_BOOL v); + void expand(int32_t h, FX_BOOL v); public: - FX_INT32 m_nWidth; + int32_t m_nWidth; - FX_INT32 m_nHeight; + int32_t m_nHeight; - FX_INT32 m_nStride; + int32_t m_nStride; - FX_BYTE *m_pData; + uint8_t *m_pData; FX_BOOL m_bNeedFree; }; diff --git a/core/src/fxcodec/jbig2/JBig2_List.h b/core/src/fxcodec/jbig2/JBig2_List.h index 9292724b1e..19f99dec3d 100644 --- a/core/src/fxcodec/jbig2/JBig2_List.h +++ b/core/src/fxcodec/jbig2/JBig2_List.h @@ -13,7 +13,7 @@ class CJBig2_List : public CJBig2_Object { public: - CJBig2_List(FX_INT32 nSize = 8) + CJBig2_List(int32_t nSize = 8) { m_nSize = nSize; m_pArray = (TYPE**)m_pModule->JBig2_Malloc2(sizeof(TYPE*), nSize); @@ -28,7 +28,7 @@ public: void clear() { - FX_INT32 i; + int32_t i; for(i = 0; i < m_nLength; i++) { delete m_pArray[i]; } @@ -45,12 +45,12 @@ public: } - FX_INT32 getLength() + int32_t getLength() { return m_nLength; } - TYPE *getAt(FX_INT32 nIndex) + TYPE *getAt(int32_t nIndex) { return m_pArray[nIndex]; } @@ -60,8 +60,8 @@ public: return m_pArray[m_nLength - 1]; } private: - FX_INT32 m_nSize; + int32_t m_nSize; TYPE **m_pArray; - FX_INT32 m_nLength; + int32_t m_nLength; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_Module.h b/core/src/fxcodec/jbig2/JBig2_Module.h index 711cf4047b..aef31bb49f 100644 --- a/core/src/fxcodec/jbig2/JBig2_Module.h +++ b/core/src/fxcodec/jbig2/JBig2_Module.h @@ -22,7 +22,7 @@ public: virtual void JBig2_Free(FX_LPVOID pMem) = 0; - virtual void JBig2_Assert(FX_INT32 nExpression) {}; + virtual void JBig2_Assert(int32_t nExpression) {}; virtual void JBig2_Error(FX_LPCSTR format, ...) {}; diff --git a/core/src/fxcodec/jbig2/JBig2_Object.cpp b/core/src/fxcodec/jbig2/JBig2_Object.cpp index 2bb267b085..4bb00b897b 100644 --- a/core/src/fxcodec/jbig2/JBig2_Object.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Object.cpp @@ -36,9 +36,9 @@ void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t FX_LPCSTR filename, int line) { void *p; - FX_BYTE *pCur, *pEnd; - p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size); - pCur = (FX_BYTE *)p; + uint8_t *pCur, *pEnd; + p = (uint8_t *)pModule->JBig2_Malloc((FX_DWORD)size); + pCur = (uint8_t *)p; pEnd = pCur + size; for(; pCur < pEnd; pCur += unit_size) { ((CJBig2_Object *)pCur)->m_pModule = pModule; @@ -53,9 +53,9 @@ void CJBig2_Object::operator delete[](void *p, CJBig2_Module *pModule, size_t un void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size) { void *p; - FX_BYTE *pCur, *pEnd; - p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size); - pCur = (FX_BYTE *)p; + uint8_t *pCur, *pEnd; + p = (uint8_t *)pModule->JBig2_Malloc((FX_DWORD)size); + pCur = (uint8_t *)p; pEnd = pCur + size; for(; pCur < pEnd; pCur += unit_size) { ((CJBig2_Object *)pCur)->m_pModule = pModule; diff --git a/core/src/fxcodec/jbig2/JBig2_Page.h b/core/src/fxcodec/jbig2/JBig2_Page.h index d7399bd452..b07eba8a3a 100644 --- a/core/src/fxcodec/jbig2/JBig2_Page.h +++ b/core/src/fxcodec/jbig2/JBig2_Page.h @@ -12,7 +12,7 @@ struct JBig2PageInfo : public CJBig2_Object { m_dwHeight; FX_DWORD m_dwResolutionX, m_dwResolutionY; - FX_BYTE m_cFlags; + uint8_t m_cFlags; FX_BOOL m_bIsStriped; FX_WORD m_wMaxStripeSize; }; diff --git a/core/src/fxcodec/jbig2/JBig2_Segment.h b/core/src/fxcodec/jbig2/JBig2_Segment.h index 33ee721a1b..fe44bc962d 100644 --- a/core/src/fxcodec/jbig2/JBig2_Segment.h +++ b/core/src/fxcodec/jbig2/JBig2_Segment.h @@ -42,19 +42,19 @@ public: FX_DWORD m_dwNumber; union { struct { - FX_BYTE type : 6; - FX_BYTE page_association_size : 1; - FX_BYTE deferred_non_retain : 1; + uint8_t type : 6; + uint8_t page_association_size : 1; + uint8_t deferred_non_retain : 1; } s; - FX_BYTE c; + uint8_t c; } m_cFlags; - FX_INT32 m_nReferred_to_segment_count; + int32_t m_nReferred_to_segment_count; FX_DWORD * m_pReferred_to_segment_numbers; FX_DWORD m_dwPage_association; FX_DWORD m_dwData_length; FX_DWORD m_dwHeader_Length; - FX_BYTE *m_pData; + uint8_t *m_pData; JBig2_SegmentState m_State; JBig2_ResultType m_nResultType; union { diff --git a/core/src/fxcodec/lbmp/fx_bmp.cpp b/core/src/fxcodec/lbmp/fx_bmp.cpp index e868fdeaef..3a6e3816ff 100644 --- a/core/src/fxcodec/lbmp/fx_bmp.cpp +++ b/core/src/fxcodec/lbmp/fx_bmp.cpp @@ -15,15 +15,15 @@ FX_WORD _GetWord_LSBFirst(FX_LPBYTE p) }
void _SetDWord_LSBFirst(FX_LPBYTE p, FX_DWORD v)
{
- p[0] = (FX_BYTE)v;
- p[1] = (FX_BYTE)(v >> 8);
- p[2] = (FX_BYTE)(v >> 16);
- p[3] = (FX_BYTE)(v >> 24);
+ p[0] = (uint8_t)v;
+ p[1] = (uint8_t)(v >> 8);
+ p[2] = (uint8_t)(v >> 16);
+ p[3] = (uint8_t)(v >> 24);
}
void _SetWord_LSBFirst(FX_LPBYTE p, FX_WORD v)
{
- p[0] = (FX_BYTE)v;
- p[1] = (FX_BYTE)(v >> 8);
+ p[0] = (uint8_t)v;
+ p[1] = (uint8_t)(v >> 8);
}
void _bmp_error(bmp_decompress_struct_p bmp_ptr, FX_LPCSTR err_msg)
{
@@ -60,7 +60,7 @@ void _bmp_destroy_decompress(bmp_decompress_struct_pp bmp_ptr_ptr) }
FX_Free(bmp_ptr);
}
-FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
+int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
{
if(bmp_ptr == NULL) {
return 0;
@@ -113,8 +113,8 @@ FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr) bmp_ptr->bitCounts = _GetWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biBitCount);
bmp_ptr->compress_flag = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biCompression);
bmp_ptr->color_used = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biClrUsed);
- bmp_ptr->dpi_x = (FX_INT32)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biXPelsPerMeter);
- bmp_ptr->dpi_y = (FX_INT32)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biYPelsPerMeter);
+ bmp_ptr->dpi_x = (int32_t)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biXPelsPerMeter);
+ bmp_ptr->dpi_y = (int32_t)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biYPelsPerMeter);
if(bmp_ptr->height < 0) {
bmp_ptr->height = -bmp_ptr->height;
bmp_ptr->imgTB_flag = TRUE;
@@ -197,7 +197,7 @@ FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr) FX_Free(bmp_ptr->out_row_buffer);
bmp_ptr->out_row_buffer = NULL;
}
- bmp_ptr->out_row_buffer = FX_Alloc(FX_BYTE, bmp_ptr->out_row_bytes);
+ bmp_ptr->out_row_buffer = FX_Alloc(uint8_t, bmp_ptr->out_row_bytes);
BMP_PTR_NOT_NULL(bmp_ptr->out_row_buffer, bmp_ptr);
FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);
_bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_PAL);
@@ -258,7 +258,7 @@ FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr) }
bmp_ptr->pal_ptr = FX_Alloc(FX_DWORD, bmp_ptr->pal_num);
BMP_PTR_NOT_NULL(bmp_ptr->pal_ptr, bmp_ptr);
- FX_INT32 src_pal_index = 0;
+ int32_t src_pal_index = 0;
if(bmp_ptr->pal_type == BMP_PAL_OLD) {
while(src_pal_index < bmp_ptr->pal_num) {
bmp_ptr->pal_ptr[src_pal_index++] = BMP_PAL_ENCODE(0x00, src_pal_ptr[2], src_pal_ptr[1], src_pal_ptr[0]);
@@ -278,7 +278,7 @@ FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr) }
return 1;
}
-FX_INT32 _bmp_decode_image(bmp_decompress_struct_p bmp_ptr)
+int32_t _bmp_decode_image(bmp_decompress_struct_p bmp_ptr)
{
if(bmp_ptr->decode_status == BMP_D_STATUS_DATA_PRE) {
bmp_ptr->avail_in = 0;
@@ -304,7 +304,7 @@ FX_INT32 _bmp_decode_image(bmp_decompress_struct_p bmp_ptr) _bmp_error(bmp_ptr, "Any Uncontrol Error");
return 0;
}
-FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)
+int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)
{
FX_LPBYTE row_buf = bmp_ptr->out_row_buffer;
FX_LPBYTE des_buf = NULL;
@@ -315,13 +315,13 @@ FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) _bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_DATA);
switch(bmp_ptr->bitCounts) {
case 1: {
- for (FX_INT32 col = 0; col < bmp_ptr->width; col++) {
+ for (int32_t col = 0; col < bmp_ptr->width; col++) {
*row_buf++ = des_buf[col >> 3] & (0x80 >> (col % 8)) ? 0x01 : 0x00;
}
}
break;
case 4: {
- for (FX_INT32 col = 0; col < bmp_ptr->width; col++) {
+ for (int32_t col = 0; col < bmp_ptr->width; col++) {
*row_buf++ = (col & 0x01) ?
(des_buf[col >> 1] & 0x0F) :
((des_buf[col >> 1] & 0xF0) >> 4);
@@ -331,10 +331,10 @@ FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) #ifdef BMP_SUPPORT_BITFIELD
case 16: {
FX_WORD* buf = (FX_WORD*)des_buf;
- FX_BYTE blue_bits = 0;
- FX_BYTE green_bits = 0;
- FX_BYTE red_bits = 0;
- for(FX_INT32 i = 0; i < 16; i++) {
+ uint8_t blue_bits = 0;
+ uint8_t green_bits = 0;
+ uint8_t red_bits = 0;
+ for(int32_t i = 0; i < 16; i++) {
if((bmp_ptr->mask_blue >> i) & 0x01) {
blue_bits++;
}
@@ -350,11 +350,11 @@ FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) blue_bits = 8 - blue_bits;
green_bits -= 8;
red_bits -= 8;
- for (FX_INT32 col = 0; col < bmp_ptr->width; col++) {
+ for (int32_t col = 0; col < bmp_ptr->width; col++) {
*buf = _GetWord_LSBFirst((FX_LPBYTE)buf);
- *row_buf++ = (FX_BYTE)((*buf & bmp_ptr->mask_blue) << blue_bits);
- *row_buf++ = (FX_BYTE)((*buf & bmp_ptr->mask_green) >> green_bits);
- *row_buf++ = (FX_BYTE)((*buf++ & bmp_ptr->mask_red) >> red_bits);
+ *row_buf++ = (uint8_t)((*buf & bmp_ptr->mask_blue) << blue_bits);
+ *row_buf++ = (uint8_t)((*buf & bmp_ptr->mask_green) >> green_bits);
+ *row_buf++ = (uint8_t)((*buf++ & bmp_ptr->mask_red) >> red_bits);
}
}
break;
@@ -373,7 +373,7 @@ FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr) _bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_TAIL);
return 1;
}
-FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
+int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
{
FX_LPBYTE first_byte_ptr = NULL;
FX_LPBYTE second_byte_ptr = NULL;
@@ -419,8 +419,8 @@ FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) bmp_ptr->skip_size = skip_size_org;
return 2;
}
- bmp_ptr->col_num += (FX_INT32)delta_ptr[0];
- FX_INT32 bmp_row_num_next = bmp_ptr->row_num + (FX_INT32)delta_ptr[1];
+ bmp_ptr->col_num += (int32_t)delta_ptr[0];
+ int32_t bmp_row_num_next = bmp_ptr->row_num + (int32_t)delta_ptr[1];
if(bmp_ptr->col_num >= bmp_ptr->out_row_bytes || bmp_row_num_next >= bmp_ptr->height) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt Or Not Supported");
return 0;
@@ -434,7 +434,7 @@ FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) }
break;
default: {
- if((FX_INT32)(*first_byte_ptr) > bmp_ptr->src_row_bytes - bmp_ptr->col_num) {
+ if((int32_t)(*first_byte_ptr) > bmp_ptr->src_row_bytes - bmp_ptr->col_num) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
return 0;
}
@@ -444,7 +444,7 @@ FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) return 2;
}
FXSYS_memcpy32(bmp_ptr->out_row_buffer + bmp_ptr->col_num, second_byte_ptr, *first_byte_ptr);
- bmp_ptr->col_num += (FX_INT32)(*first_byte_ptr);
+ bmp_ptr->col_num += (int32_t)(*first_byte_ptr);
}
}
}
@@ -454,19 +454,19 @@ FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) bmp_ptr->skip_size = skip_size_org;
return 2;
}
- if((FX_INT32)(*first_byte_ptr) > bmp_ptr->src_row_bytes - bmp_ptr->col_num) {
+ if((int32_t)(*first_byte_ptr) > bmp_ptr->src_row_bytes - bmp_ptr->col_num) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
return 0;
}
FXSYS_memset8(bmp_ptr->out_row_buffer + bmp_ptr->col_num, *second_byte_ptr, *first_byte_ptr);
- bmp_ptr->col_num += (FX_INT32)(*first_byte_ptr);
+ bmp_ptr->col_num += (int32_t)(*first_byte_ptr);
}
}
}
_bmp_error(bmp_ptr, "Any Uncontrol Error");
return 0;
}
-FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
+int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
{
FX_LPBYTE first_byte_ptr = NULL;
FX_LPBYTE second_byte_ptr = NULL;
@@ -512,8 +512,8 @@ FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) bmp_ptr->skip_size = skip_size_org;
return 2;
}
- bmp_ptr->col_num += (FX_INT32)delta_ptr[0];
- FX_INT32 bmp_row_num_next = bmp_ptr->row_num + (FX_INT32)delta_ptr[1];
+ bmp_ptr->col_num += (int32_t)delta_ptr[0];
+ int32_t bmp_row_num_next = bmp_ptr->row_num + (int32_t)delta_ptr[1];
if(bmp_ptr->col_num >= bmp_ptr->out_row_bytes || bmp_row_num_next >= bmp_ptr->height) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt Or Not Supported");
return 0;
@@ -527,8 +527,8 @@ FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) }
break;
default: {
- FX_BYTE size = (FX_BYTE)(((FX_WORD)(*first_byte_ptr) + 1) >> 1);
- if((FX_INT32)*first_byte_ptr >= bmp_ptr->out_row_bytes - bmp_ptr->col_num) {
+ uint8_t size = (uint8_t)(((FX_WORD)(*first_byte_ptr) + 1) >> 1);
+ if((int32_t)*first_byte_ptr >= bmp_ptr->out_row_bytes - bmp_ptr->col_num) {
if(size + (bmp_ptr->col_num >> 1) > bmp_ptr->src_row_bytes) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
return 0;
@@ -539,7 +539,7 @@ FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) bmp_ptr->skip_size = skip_size_org;
return 2;
}
- for (FX_BYTE i = 0; i < *first_byte_ptr; i++) {
+ for (uint8_t i = 0; i < *first_byte_ptr; i++) {
if(i & 0x01) {
*(bmp_ptr->out_row_buffer + bmp_ptr->col_num++) = (*second_byte_ptr++ & 0x0F);
} else {
@@ -555,15 +555,15 @@ FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) bmp_ptr->skip_size = skip_size_org;
return 2;
}
- if((FX_INT32)*first_byte_ptr > bmp_ptr->out_row_bytes - bmp_ptr->col_num) {
- FX_BYTE size = (FX_BYTE)(((FX_WORD)(*first_byte_ptr) + 1) >> 1);
+ if((int32_t)*first_byte_ptr > bmp_ptr->out_row_bytes - bmp_ptr->col_num) {
+ uint8_t size = (uint8_t)(((FX_WORD)(*first_byte_ptr) + 1) >> 1);
if(size + (bmp_ptr->col_num >> 1) > bmp_ptr->src_row_bytes) {
_bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
return 0;
}
*first_byte_ptr = bmp_ptr->out_row_bytes - bmp_ptr->col_num - 1;
}
- for (FX_BYTE i = 0; i < *first_byte_ptr; i++) {
+ for (uint8_t i = 0; i < *first_byte_ptr; i++) {
if(i & 0x01) {
*(bmp_ptr->out_row_buffer + bmp_ptr->col_num++) = (*second_byte_ptr & 0x0F);
} else {
@@ -586,7 +586,7 @@ FX_LPBYTE _bmp_read_data(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE* des_buf_pp, bmp_ptr->skip_size += data_size;
return *des_buf_pp;
}
-void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, FX_INT32 status)
+void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status)
{
bmp_ptr->decode_status = status;
bmp_ptr->next_in += bmp_ptr->skip_size;
@@ -679,7 +679,7 @@ static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_ size = bmp_ptr->src_pitch * bmp_ptr->src_row * bmp_ptr->info_header.biBitCount / 16;
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_size);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
if (dst_buf == NULL) {
return;
}
@@ -709,9 +709,9 @@ static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_ dst_pos += 4;
bmp_ptr->file_header.bfOffBits = dst_pos;
}
- FX_BYTE blue_bits = 0;
- FX_BYTE green_bits = 0;
- FX_BYTE red_bits = 0;
+ uint8_t blue_bits = 0;
+ uint8_t green_bits = 0;
+ uint8_t red_bits = 0;
for(i = 0; i < bmp_ptr->info_header.biBitCount; i++) {
if((mask_blue >> i) & 0x01) {
blue_bits++;
@@ -729,11 +729,11 @@ static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_ green_bits -= 8;
red_bits -= 8;
i = 0;
- for (FX_INT32 row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--, i = 0) {
+ for (int32_t row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--, i = 0) {
while (i < bmp_ptr->src_width * bmp_ptr->src_bpp / 8) {
- FX_BYTE b = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
- FX_BYTE g = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
- FX_BYTE r = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
+ uint8_t b = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
+ uint8_t g = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
+ uint8_t r = bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch + i++];
if (bmp_ptr->src_bpp == 32) {
i++;
}
@@ -766,20 +766,20 @@ static void _bmp_encode_rgb(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, F size = dst_pitch * bmp_ptr->src_row;
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_size);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
if (dst_buf == NULL) {
return;
}
FXSYS_memset32(&dst_buf[dst_pos], 0, size);
- for (FX_INT32 row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--) {
+ for (int32_t row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--) {
FXSYS_memcpy32(&dst_buf[dst_pos], &bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch], bmp_ptr->src_pitch);
dst_pos += dst_pitch;
}
dst_size = dst_pos;
}
-static FX_BYTE _bmp_rle8_search(FX_LPCBYTE buf, FX_INT32 len)
+static uint8_t _bmp_rle8_search(FX_LPCBYTE buf, int32_t len)
{
- FX_BYTE num;
+ uint8_t num;
num = 1;
while (num < len) {
if (buf[num - 1] != buf[num] || num == 0xFF) {
@@ -792,21 +792,21 @@ static FX_BYTE _bmp_rle8_search(FX_LPCBYTE buf, FX_INT32 len) static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)
{
FX_DWORD size, dst_pos, index;
- FX_BYTE rle[2] = {0};
+ uint8_t rle[2] = {0};
size = bmp_ptr->src_pitch * bmp_ptr->src_row * 2;
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_size);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
if (dst_buf == NULL) {
return;
}
FXSYS_memset32(&dst_buf[dst_pos], 0, size);
- for (FX_INT32 row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; ) {
+ for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; ) {
index = row_num * bmp_ptr->src_pitch;
rle[0] = _bmp_rle8_search(&bmp_ptr->src_buf[index + i], size - index - i);
rle[1] = bmp_ptr->src_buf[index + i];
- if (i + rle[0] >= (FX_INT32)bmp_ptr->src_pitch) {
- rle[0] = FX_BYTE(bmp_ptr->src_pitch - i);
+ if (i + rle[0] >= (int32_t)bmp_ptr->src_pitch) {
+ rle[0] = uint8_t(bmp_ptr->src_pitch - i);
if (rle[0]) {
dst_buf[dst_pos++] = rle[0];
dst_buf[dst_pos++] = rle[1];
@@ -825,9 +825,9 @@ static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, dst_buf[dst_pos++] = RLE_EOI;
dst_size = dst_pos;
}
-static FX_BYTE _bmp_rle4_search(FX_LPCBYTE buf, FX_INT32 len)
+static uint8_t _bmp_rle4_search(FX_LPCBYTE buf, int32_t len)
{
- FX_BYTE num;
+ uint8_t num;
num = 2;
while (num < len) {
if (buf[num - 2] != buf[num] || num == 0xFF) {
@@ -840,22 +840,22 @@ static FX_BYTE _bmp_rle4_search(FX_LPCBYTE buf, FX_INT32 len) static void _bmp_encode_rle4(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)
{
FX_DWORD size, dst_pos, index;
- FX_BYTE rle[2] = {0};
+ uint8_t rle[2] = {0};
size = bmp_ptr->src_pitch * bmp_ptr->src_row;
dst_pos = bmp_ptr->file_header.bfOffBits;
dst_size += size;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_size);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_size);
if (dst_buf == NULL) {
return;
}
FXSYS_memset32(&dst_buf[dst_pos], 0, size);
- for (FX_INT32 row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; rle[1] = 0) {
+ for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; rle[1] = 0) {
index = row_num * bmp_ptr->src_pitch;
rle[0] = _bmp_rle4_search(&bmp_ptr->src_buf[index + i], size - index - i);
rle[1] |= (bmp_ptr->src_buf[index + i] & 0x0f) << 4;
rle[1] |= bmp_ptr->src_buf[index + i + 1] & 0x0f;
- if (i + rle[0] >= (FX_INT32)bmp_ptr->src_pitch) {
- rle[0] = FX_BYTE(bmp_ptr->src_pitch - i);
+ if (i + rle[0] >= (int32_t)bmp_ptr->src_pitch) {
+ rle[0] = uint8_t(bmp_ptr->src_pitch - i);
if (rle[0]) {
dst_buf[dst_pos++] = rle[0];
dst_buf[dst_pos++] = rle[1];
@@ -882,7 +882,7 @@ FX_BOOL _bmp_encode_image( bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX pal_size = sizeof(FX_DWORD) * bmp_ptr->info_header.biClrUsed;
}
dst_size = head_size + sizeof(FX_DWORD) * bmp_ptr->pal_num;
- dst_buf = FX_TryAlloc(FX_BYTE, dst_size);
+ dst_buf = FX_TryAlloc(uint8_t, dst_size);
if (dst_buf == NULL) {
return FALSE;
}
diff --git a/core/src/fxcodec/lbmp/fx_bmp.h b/core/src/fxcodec/lbmp/fx_bmp.h index b7c3617182..553a1501db 100644 --- a/core/src/fxcodec/lbmp/fx_bmp.h +++ b/core/src/fxcodec/lbmp/fx_bmp.h @@ -47,14 +47,14 @@ typedef struct tagBmpCoreHeader { } BmpCoreHeader, *BmpCoreHeaderPtr;
typedef struct tagBmpInfoHeader {
FX_DWORD biSize;
- FX_INT32 biWidth;
- FX_INT32 biHeight;
+ int32_t biWidth;
+ int32_t biHeight;
FX_WORD biPlanes;
FX_WORD biBitCount;
FX_DWORD biCompression;
FX_DWORD biSizeImage;
- FX_INT32 biXPelsPerMeter;
- FX_INT32 biYPelsPerMeter;
+ int32_t biXPelsPerMeter;
+ int32_t biYPelsPerMeter;
FX_DWORD biClrUsed;
FX_DWORD biClrImportant;
} BmpInfoHeader, *BmpInfoHeaderPtr;
@@ -71,26 +71,26 @@ struct tag_bmp_decompress_struct { BmpFileHeaderPtr bmp_header_ptr;
BmpInfoHeaderPtr bmp_infoheader_ptr;
- FX_INT32 width;
- FX_INT32 height;
+ int32_t width;
+ int32_t height;
FX_DWORD compress_flag;
- FX_INT32 components;
- FX_INT32 src_row_bytes;
- FX_INT32 out_row_bytes;
+ int32_t components;
+ int32_t src_row_bytes;
+ int32_t out_row_bytes;
FX_LPBYTE out_row_buffer;
FX_WORD bitCounts;
FX_DWORD color_used;
FX_BOOL imgTB_flag;
- FX_INT32 pal_num;
- FX_INT32 pal_type;
+ int32_t pal_num;
+ int32_t pal_type;
FX_DWORD* pal_ptr;
FX_DWORD data_size;
FX_DWORD img_data_offset;
FX_DWORD img_ifh_size;
- FX_INT32 row_num;
- FX_INT32 col_num;
- FX_INT32 dpi_x;
- FX_INT32 dpi_y;
+ int32_t row_num;
+ int32_t col_num;
+ int32_t dpi_x;
+ int32_t dpi_y;
#ifdef BMP_SUPPORT_BITFIELD
FX_DWORD mask_red;
FX_DWORD mask_green;
@@ -98,22 +98,22 @@ struct tag_bmp_decompress_struct { #endif
FX_BOOL (*_bmp_get_data_position_fn)(bmp_decompress_struct_p bmp_ptr, FX_DWORD cur_pos);
- void (*_bmp_get_row_fn)(bmp_decompress_struct_p bmp_ptr, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*_bmp_get_row_fn)(bmp_decompress_struct_p bmp_ptr, int32_t row_num, FX_LPBYTE row_buf);
FX_LPBYTE next_in;
FX_DWORD avail_in;
FX_DWORD skip_size;
- FX_INT32 decode_status;
+ int32_t decode_status;
};
void _bmp_error(bmp_decompress_struct_p bmp_ptr, FX_LPCSTR err_msg);
bmp_decompress_struct_p _bmp_create_decompress();
void _bmp_destroy_decompress(bmp_decompress_struct_pp bmp_ptr_ptr);
-FX_INT32 _bmp_read_header(bmp_decompress_struct_p bmp_ptr);
-FX_INT32 _bmp_decode_image(bmp_decompress_struct_p bmp_ptr);
-FX_INT32 _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr);
-FX_INT32 _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr);
-FX_INT32 _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr);
+int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr);
+int32_t _bmp_decode_image(bmp_decompress_struct_p bmp_ptr);
+int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr);
+int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr);
+int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr);
FX_LPBYTE _bmp_read_data(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE* des_buf_pp, FX_DWORD data_size);
-void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, FX_INT32 status);
+void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status);
void _bmp_input_buffer(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE src_buf, FX_DWORD src_size);
FX_DWORD _bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE* avial_buf_ptr);
#define BMP_PTR_NOT_NULL(ptr,bmp_ptr) if(ptr == NULL){ \
@@ -129,13 +129,13 @@ struct tag_bmp_compress_struct { FX_LPBYTE src_buf;
FX_DWORD src_pitch;
FX_DWORD src_row;
- FX_BYTE src_bpp;
+ uint8_t src_bpp;
FX_DWORD src_width;
FX_BOOL src_free;
FX_DWORD* pal_ptr;
FX_WORD pal_num;
#ifdef BMP_SUPPORT_BITFIELD
- FX_BYTE bit_type;
+ uint8_t bit_type;
#endif
};
bmp_compress_struct_p _bmp_create_compress();
diff --git a/core/src/fxcodec/lgif/fx_gif.cpp b/core/src/fxcodec/lgif/fx_gif.cpp index bc6109e88e..1eb4a75f1a 100644 --- a/core/src/fxcodec/lgif/fx_gif.cpp +++ b/core/src/fxcodec/lgif/fx_gif.cpp @@ -14,7 +14,7 @@ FX_DWORD CGifLZWDecoder::GetAvailInput() {
return avail_in;
}
-void CGifLZWDecoder::InitTable(FX_BYTE code_len)
+void CGifLZWDecoder::InitTable(uint8_t code_len)
{
code_size = code_len;
code_clear = 1 << code_size;
@@ -35,7 +35,7 @@ void CGifLZWDecoder::ClearTable() FXSYS_memset32(code_table, 0, sizeof(tag_Table)*GIF_MAX_LZW_CODE);
FXSYS_memset32(stack, 0, GIF_MAX_LZW_CODE);
for (FX_WORD i = 0; i < code_clear; i++) {
- code_table[i].suffix = (FX_BYTE)i;
+ code_table[i].suffix = (uint8_t)i;
}
}
void CGifLZWDecoder::DecodeString(FX_WORD code)
@@ -49,10 +49,10 @@ void CGifLZWDecoder::DecodeString(FX_WORD code) stack[GIF_MAX_LZW_CODE - 1 - stack_size++] = code_table[code].suffix;
code = code_table[code].prefix;
}
- stack[GIF_MAX_LZW_CODE - 1 - stack_size++] = (FX_BYTE)code;
- code_first = (FX_BYTE)code;
+ stack[GIF_MAX_LZW_CODE - 1 - stack_size++] = (uint8_t)code;
+ code_first = (uint8_t)code;
}
-void CGifLZWDecoder::AddCode(FX_WORD prefix_code, FX_BYTE append_char)
+void CGifLZWDecoder::AddCode(FX_WORD prefix_code, uint8_t append_char)
{
if(code_next == GIF_MAX_LZW_CODE) {
return;
@@ -65,7 +65,7 @@ void CGifLZWDecoder::AddCode(FX_WORD prefix_code, FX_BYTE append_char) }
}
}
-FX_INT32 CGifLZWDecoder::Decode(FX_LPBYTE des_buf, FX_DWORD& des_size)
+int32_t CGifLZWDecoder::Decode(FX_LPBYTE des_buf, FX_DWORD& des_size)
{
if(des_size == 0) {
return 3;
@@ -118,7 +118,7 @@ FX_INT32 CGifLZWDecoder::Decode(FX_LPBYTE des_buf, FX_DWORD& des_size) return 0;
} else {
DecodeString(code);
- FX_BYTE append_char = stack[GIF_MAX_LZW_CODE - stack_size];
+ uint8_t append_char = stack[GIF_MAX_LZW_CODE - stack_size];
AddCode(code_old, append_char);
}
}
@@ -150,11 +150,11 @@ static FX_BOOL _gif_grow_buf(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD siz FX_DWORD len_org = dst_len;
while (dst_buf && dst_len < size) {
dst_len <<= 1;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_len);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_len);
}
if (dst_buf == NULL) {
dst_len = size;
- dst_buf = FX_Realloc(FX_BYTE, dst_buf, dst_len);
+ dst_buf = FX_Realloc(uint8_t, dst_buf, dst_len);
if (dst_buf == NULL) {
return FALSE;
}
@@ -164,17 +164,17 @@ static FX_BOOL _gif_grow_buf(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD siz }
return TRUE;
}
-static inline void _gif_cut_index(FX_BYTE& val, FX_DWORD index, FX_BYTE index_bit, FX_BYTE index_bit_use, FX_BYTE bit_use)
+static inline void _gif_cut_index(uint8_t& val, FX_DWORD index, uint8_t index_bit, uint8_t index_bit_use, uint8_t bit_use)
{
FX_DWORD cut = ((1 << (index_bit - index_bit_use)) - 1) << index_bit_use;
val |= ((index & cut) >> index_bit_use) << bit_use;
}
-static inline FX_BYTE _gif_cut_buf(FX_LPCBYTE buf, FX_DWORD& offset, FX_BYTE bit_cut, FX_BYTE& bit_offset, FX_DWORD& bit_num)
+static inline uint8_t _gif_cut_buf(FX_LPCBYTE buf, FX_DWORD& offset, uint8_t bit_cut, uint8_t& bit_offset, FX_DWORD& bit_num)
{
if (bit_cut != 8) {
FX_WORD index = 0;
index |= ((1 << bit_cut) - 1) << (7 - bit_offset);
- FX_BYTE ret = ((index & buf[offset]) >> (7 - bit_offset));
+ uint8_t ret = ((index & buf[offset]) >> (7 - bit_offset));
bit_offset += bit_cut;
if (bit_offset >= 8) {
if (bit_offset > 8) {
@@ -206,7 +206,7 @@ void CGifLZWEncoder::ClearTable() code_table[i].suffix = 0;
}
}
-void CGifLZWEncoder::Start( FX_BYTE code_len, FX_LPCBYTE src_buf, FX_LPBYTE& dst_buf, FX_DWORD& offset)
+void CGifLZWEncoder::Start( uint8_t code_len, FX_LPCBYTE src_buf, FX_LPBYTE& dst_buf, FX_DWORD& offset)
{
code_size = code_len + 1;
src_bit_cut = code_size;
@@ -238,7 +238,7 @@ void CGifLZWEncoder::WriteBlock(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& }
void CGifLZWEncoder::EncodeString( FX_DWORD index, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset )
{
- FX_BYTE index_bit_use;
+ uint8_t index_bit_use;
index_bit_use = 0;
if (index_buf_len == GIF_DATA_BLOCK) {
WriteBlock(dst_buf, dst_len, offset);
@@ -289,7 +289,7 @@ void CGifLZWEncoder::EncodeString( FX_DWORD index, FX_LPBYTE& dst_buf, FX_DWORD& }
FX_BOOL CGifLZWEncoder::Encode( FX_LPCBYTE src_buf, FX_DWORD src_len, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset )
{
- FX_BYTE suffix;
+ uint8_t suffix;
if (setjmp(jmp)) {
return FALSE;
}
@@ -313,7 +313,7 @@ FX_BOOL CGifLZWEncoder::Encode( FX_LPCBYTE src_buf, FX_DWORD src_len, FX_LPBYTE& src_bit_num = 0;
return TRUE;
}
-FX_BOOL CGifLZWEncoder::LookUpInTable( FX_LPCBYTE buf, FX_DWORD& offset, FX_BYTE& bit_offset )
+FX_BOOL CGifLZWEncoder::LookUpInTable( FX_LPCBYTE buf, FX_DWORD& offset, uint8_t& bit_offset )
{
for (FX_WORD i = table_cur; i < index_num; i++) {
if (code_table[i].prefix == code_table[index_num].prefix &&
@@ -336,7 +336,7 @@ void CGifLZWEncoder::Finish(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& off }
gif_decompress_struct_p _gif_create_decompress()
{
- gif_decompress_struct_p gif_ptr = (gif_decompress_struct*)FX_Alloc(FX_BYTE, sizeof(gif_decompress_struct));
+ gif_decompress_struct_p gif_ptr = (gif_decompress_struct*)FX_Alloc(uint8_t, sizeof(gif_decompress_struct));
if(gif_ptr == NULL) {
return NULL;
}
@@ -365,8 +365,8 @@ void _gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr) delete gif_ptr->img_decoder_ptr;
}
if(gif_ptr->img_ptr_arr_ptr != NULL) {
- FX_INT32 size_img_arr = gif_ptr->img_ptr_arr_ptr->GetSize();
- for (FX_INT32 i = 0; i < size_img_arr; i++) {
+ int32_t size_img_arr = gif_ptr->img_ptr_arr_ptr->GetSize();
+ for (int32_t i = 0; i < size_img_arr; i++) {
GifImage* p = gif_ptr->img_ptr_arr_ptr->GetAt(i);
if(p->image_info_ptr != NULL) {
FX_Free(p->image_info_ptr);
@@ -402,8 +402,8 @@ void _gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr) #endif
#ifdef GIF_SUPPORT_PLAIN_TEXT_EXTENSION
if(gif_ptr->pt_ptr_arr_ptr != NULL) {
- FX_INT32 size_pt_arr = gif_ptr->pt_ptr_arr_ptr->GetSize();
- for (FX_INT32 i = 0; i < size_pt_arr; i++) {
+ int32_t size_pt_arr = gif_ptr->pt_ptr_arr_ptr->GetSize();
+ for (int32_t i = 0; i < size_pt_arr; i++) {
GifPlainText* p = gif_ptr->pt_ptr_arr_ptr->GetAt(i);
if(p->gce_ptr != NULL) {
FX_Free(p->gce_ptr);
@@ -423,13 +423,13 @@ void _gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr) }
gif_compress_struct_p _gif_create_compress()
{
- gif_compress_struct_p gif_ptr = (gif_compress_struct*)FX_Alloc(FX_BYTE, sizeof(gif_compress_struct));
+ gif_compress_struct_p gif_ptr = (gif_compress_struct*)FX_Alloc(uint8_t, sizeof(gif_compress_struct));
if (gif_ptr == NULL) {
return NULL;
}
FXSYS_memset32(gif_ptr, 0, sizeof(gif_compress_struct));
gif_ptr->img_encoder_ptr = new CGifLZWEncoder;
- gif_ptr->header_ptr = (GifHeader*)FX_Alloc(FX_BYTE, sizeof(GifHeader));
+ gif_ptr->header_ptr = (GifHeader*)FX_Alloc(uint8_t, sizeof(GifHeader));
if (gif_ptr->header_ptr == NULL) {
delete(gif_ptr->img_encoder_ptr);
FX_Free(gif_ptr);
@@ -437,7 +437,7 @@ gif_compress_struct_p _gif_create_compress() }
FXSYS_memcpy32(gif_ptr->header_ptr->signature, GIF_SIGNATURE, 3);
FXSYS_memcpy32(gif_ptr->header_ptr->version, "89a", 3);
- gif_ptr->lsd_ptr = (GifLSD*)FX_Alloc(FX_BYTE, sizeof(GifLSD));
+ gif_ptr->lsd_ptr = (GifLSD*)FX_Alloc(uint8_t, sizeof(GifLSD));
if (gif_ptr->lsd_ptr == NULL) {
FX_Free(gif_ptr->header_ptr);
delete(gif_ptr->img_encoder_ptr);
@@ -445,7 +445,7 @@ gif_compress_struct_p _gif_create_compress() return NULL;
}
FXSYS_memset32(gif_ptr->lsd_ptr, 0, sizeof(GifLSD));
- gif_ptr->image_info_ptr = (GifImageInfo*)FX_Alloc(FX_BYTE, sizeof(GifImageInfo));
+ gif_ptr->image_info_ptr = (GifImageInfo*)FX_Alloc(uint8_t, sizeof(GifImageInfo));
if (gif_ptr->image_info_ptr == NULL) {
FX_Free(gif_ptr->lsd_ptr);
FX_Free(gif_ptr->header_ptr);
@@ -459,7 +459,7 @@ gif_compress_struct_p _gif_create_compress() FXSYS_memcpy32(gif_ptr->app_authentication, "2.0", 3);
#endif
#ifdef GIF_SUPPORT_GRAPHIC_CONTROL_EXTENSION
- gif_ptr->gce_ptr = (GifGCE*)FX_Alloc(FX_BYTE, sizeof(GifGCE));
+ gif_ptr->gce_ptr = (GifGCE*)FX_Alloc(uint8_t, sizeof(GifGCE));
if (gif_ptr->gce_ptr == NULL) {
FX_Free(gif_ptr->image_info_ptr);
FX_Free(gif_ptr->lsd_ptr);
@@ -470,7 +470,7 @@ gif_compress_struct_p _gif_create_compress() }
#endif
#ifdef GIF_SUPPORT_PLAIN_TEXT_EXTENSION
- gif_ptr->pte_ptr = (GifPTE*)FX_Alloc(FX_BYTE, sizeof(GifPTE));
+ gif_ptr->pte_ptr = (GifPTE*)FX_Alloc(uint8_t, sizeof(GifPTE));
if (gif_ptr->pte_ptr == NULL) {
FX_Free(gif_ptr->gce_ptr);
FX_Free(gif_ptr->image_info_ptr);
@@ -539,7 +539,7 @@ void _gif_error(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg) }
}
void _gif_warn(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg) {}
-FX_INT32 _gif_read_header(gif_decompress_struct_p gif_ptr)
+int32_t _gif_read_header(gif_decompress_struct_p gif_ptr)
{
if(gif_ptr == NULL) {
return 0;
@@ -565,7 +565,7 @@ FX_INT32 _gif_read_header(gif_decompress_struct_p gif_ptr) if(((GifGF*)&gif_lsd_ptr->global_flag)->global_pal) {
gif_ptr->global_pal_num = 2 << ((GifGF*)&gif_lsd_ptr->global_flag)->pal_bits;
ASSERT(sizeof(GifPalette) == 3);
- FX_INT32 global_pal_size = gif_ptr->global_pal_num * 3;
+ int32_t global_pal_size = gif_ptr->global_pal_num * 3;
FX_LPBYTE global_pal_ptr = NULL;
if (_gif_read_data(gif_ptr, &global_pal_ptr, global_pal_size) == NULL) {
gif_ptr->skip_size = skip_size_org;
@@ -577,7 +577,7 @@ FX_INT32 _gif_read_header(gif_decompress_struct_p gif_ptr) FX_Free(gif_ptr->global_pal_ptr);
}
gif_ptr->global_pal_ptr = NULL;
- gif_ptr->global_pal_ptr = (GifPalette*)FX_Alloc(FX_BYTE, global_pal_size);
+ gif_ptr->global_pal_ptr = (GifPalette*)FX_Alloc(uint8_t, global_pal_size);
GIF_PTR_NOT_NULL(gif_ptr->global_pal_ptr, gif_ptr);
FXSYS_memcpy32(gif_ptr->global_pal_ptr, global_pal_ptr, global_pal_size);
}
@@ -587,12 +587,12 @@ FX_INT32 _gif_read_header(gif_decompress_struct_p gif_ptr) gif_ptr->pixel_aspect = gif_lsd_ptr->pixel_aspect;
return 1;
}
-FX_INT32 _gif_get_frame(gif_decompress_struct_p gif_ptr)
+int32_t _gif_get_frame(gif_decompress_struct_p gif_ptr)
{
if(gif_ptr == NULL) {
return 0;
}
- FX_INT32 ret = 1;
+ int32_t ret = 1;
while (TRUE) {
switch(gif_ptr->decode_status) {
case GIF_D_STATUS_TAIL:
@@ -649,7 +649,7 @@ FX_INT32 _gif_get_frame(gif_decompress_struct_p gif_ptr) continue;
#endif
default: {
- FX_INT32 status = GIF_D_STATUS_EXT_UNE;
+ int32_t status = GIF_D_STATUS_EXT_UNE;
#ifndef GIF_SUPPORT_PLAIN_TEXT_EXTENSION
if(*ext_ptr == GIF_BLOCK_PTE) {
status = GIF_D_STATUS_EXT_PTE;
@@ -709,7 +709,7 @@ void _gif_takeover_gce_ptr(gif_decompress_struct_p gif_ptr, GifGCE** gce_ptr_ptr }
#endif
}
-FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr)
+int32_t _gif_decode_extension(gif_decompress_struct_p gif_ptr)
{
FX_LPBYTE data_size_ptr = NULL;
FX_LPBYTE data_ptr = NULL;
@@ -728,7 +728,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) return 2;
}
while(*data_size_ptr != GIF_BLOCK_TERMINAL) {
- FX_BYTE data_size = *data_size_ptr;
+ uint8_t data_size = *data_size_ptr;
if(_gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL ||
_gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) {
gif_ptr->skip_size = skip_size_org;
@@ -743,7 +743,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) FX_Free(gif_ptr->app_data);
gif_ptr->app_data = NULL;
}
- gif_ptr->app_data = FX_Alloc(FX_BYTE, gif_ptr->app_data_size);
+ gif_ptr->app_data = FX_Alloc(uint8_t, gif_ptr->app_data_size);
GIF_PTR_NOT_NULL(gif_ptr->app_data, gif_ptr);
FXSYS_memcpy32(gif_ptr->app_data, FX_LPCBYTE(gif_ae_data_str), gif_ptr->app_data_size);
}
@@ -757,7 +757,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) }
gif_ptr->cmt_data_ptr->Empty();
while(*data_size_ptr != GIF_BLOCK_TERMINAL) {
- FX_BYTE data_size = *data_size_ptr;
+ uint8_t data_size = *data_size_ptr;
if(_gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL ||
_gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) {
gif_ptr->skip_size = skip_size_org;
@@ -779,7 +779,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) GIF_PTR_NOT_NULL(gif_pt_ptr, gif_ptr);
FXSYS_memset32(gif_pt_ptr, 0, sizeof(GifPlainText));
_gif_takeover_gce_ptr(gif_ptr, &gif_pt_ptr->gce_ptr);
- gif_pt_ptr->pte_ptr = (GifPTE*)FX_Alloc(FX_BYTE, sizeof(GifPTE));
+ gif_pt_ptr->pte_ptr = (GifPTE*)FX_Alloc(uint8_t, sizeof(GifPTE));
GIF_PTR_NOT_NULL(gif_pt_ptr->pte_ptr, gif_ptr);
gif_pt_ptr->string_ptr = new CFX_ByteString;
GIF_PTR_NOT_NULL(gif_pt_ptr->string_ptr, gif_ptr);
@@ -809,7 +809,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) return 2;
}
while(*data_size_ptr != GIF_BLOCK_TERMINAL) {
- FX_BYTE data_size = *data_size_ptr;
+ uint8_t data_size = *data_size_ptr;
if(_gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL ||
_gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) {
gif_ptr->skip_size = skip_size_org;
@@ -841,7 +841,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) return 2;
}
if(gif_ptr->gce_ptr == NULL) {
- gif_ptr->gce_ptr = (GifGCE*)FX_Alloc(FX_BYTE, sizeof(GifGCE));
+ gif_ptr->gce_ptr = (GifGCE*)FX_Alloc(uint8_t, sizeof(GifGCE));
GIF_PTR_NOT_NULL(gif_ptr->gce_ptr, gif_ptr);
}
gif_ptr->gce_ptr->block_size = gif_gce_ptr->block_size;
@@ -877,7 +877,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) _gif_save_decoding_status(gif_ptr, GIF_D_STATUS_SIG);
return 1;
}
-FX_INT32 _gif_decode_image_info(gif_decompress_struct_p gif_ptr)
+int32_t _gif_decode_image_info(gif_decompress_struct_p gif_ptr)
{
if(gif_ptr->width == 0 || gif_ptr->height == 0) {
_gif_error(gif_ptr, "No Image Header Info");
@@ -889,10 +889,10 @@ FX_INT32 _gif_decode_image_info(gif_decompress_struct_p gif_ptr) if(_gif_read_data(gif_ptr, (FX_LPBYTE*)&gif_img_info_ptr, 9) == NULL) {
return 2;
}
- GifImage* gif_image_ptr = (GifImage*)FX_Alloc(FX_BYTE, sizeof(GifImage));
+ GifImage* gif_image_ptr = (GifImage*)FX_Alloc(uint8_t, sizeof(GifImage));
GIF_PTR_NOT_NULL(gif_image_ptr, gif_ptr);
FXSYS_memset32(gif_image_ptr, 0, sizeof(GifImage));
- gif_image_ptr->image_info_ptr = (GifImageInfo*)FX_Alloc(FX_BYTE, sizeof(GifImageInfo));
+ gif_image_ptr->image_info_ptr = (GifImageInfo*)FX_Alloc(uint8_t, sizeof(GifImageInfo));
GIF_PTR_NOT_NULL(gif_image_ptr->image_info_ptr, gif_ptr);
gif_image_ptr->image_info_ptr->left = _GetWord_LSBFirst((FX_LPBYTE)&gif_img_info_ptr->left);
gif_image_ptr->image_info_ptr->top = _GetWord_LSBFirst((FX_LPBYTE)&gif_img_info_ptr->top);
@@ -914,7 +914,7 @@ FX_INT32 _gif_decode_image_info(gif_decompress_struct_p gif_ptr) GifLF* gif_img_info_lf_ptr = (GifLF*)&gif_img_info_ptr->local_flag;
if(gif_img_info_lf_ptr->local_pal) {
ASSERT(sizeof(GifPalette) == 3);
- FX_INT32 loc_pal_size = (2 << gif_img_info_lf_ptr->pal_bits) * 3;
+ int32_t loc_pal_size = (2 << gif_img_info_lf_ptr->pal_bits) * 3;
FX_LPBYTE loc_pal_ptr = NULL;
if(_gif_read_data(gif_ptr, &loc_pal_ptr, loc_pal_size) == NULL) {
gif_ptr->skip_size = skip_size_org;
@@ -955,7 +955,7 @@ FX_INT32 _gif_decode_image_info(gif_decompress_struct_p gif_ptr) _gif_save_decoding_status(gif_ptr, GIF_D_STATUS_IMG_DATA);
return 1;
}
-FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num)
+int32_t _gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num)
{
if(gif_ptr == NULL ||
frame_num < 0 ||
@@ -973,10 +973,10 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) FX_Free(gif_image_ptr->image_row_buf);
gif_image_ptr->image_row_buf = NULL;
}
- gif_image_ptr->image_row_buf = FX_Alloc(FX_BYTE, gif_img_row_bytes);
+ gif_image_ptr->image_row_buf = FX_Alloc(uint8_t, gif_img_row_bytes);
GIF_PTR_NOT_NULL(gif_image_ptr->image_row_buf, gif_ptr);
GifGCE* gif_img_gce_ptr = gif_image_ptr->image_gce_ptr;
- FX_INT32 loc_pal_num = ((GifLF*)&gif_image_ptr->image_info_ptr->local_flag)->local_pal ?
+ int32_t loc_pal_num = ((GifLF*)&gif_image_ptr->image_info_ptr->local_flag)->local_pal ?
(2 << ((GifLF*)&gif_image_ptr->image_info_ptr->local_flag)->pal_bits) : 0;
gif_ptr->avail_in = 0;
if(gif_img_gce_ptr == NULL) {
@@ -1002,11 +1002,11 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) gif_image_ptr->image_info_ptr->width,
gif_image_ptr->image_info_ptr->height,
loc_pal_num, gif_image_ptr->local_pal_ptr,
- (FX_INT32)gif_image_ptr->image_gce_ptr->delay_time,
+ (int32_t)gif_image_ptr->image_gce_ptr->delay_time,
(FX_BOOL)((GifCEF*)&gif_image_ptr->image_gce_ptr->gce_flag)->user_input,
((GifCEF*)&gif_image_ptr->image_gce_ptr->gce_flag)->transparency ?
- (FX_INT32)gif_image_ptr->image_gce_ptr->trans_index : -1,
- (FX_INT32)((GifCEF*)&gif_image_ptr->image_gce_ptr->gce_flag)->disposal_method,
+ (int32_t)gif_image_ptr->image_gce_ptr->trans_index : -1,
+ (int32_t)((GifCEF*)&gif_image_ptr->image_gce_ptr->gce_flag)->disposal_method,
(FX_BOOL)((GifLF*)&gif_image_ptr->image_info_ptr->local_flag)->interlace
);
if(!bRes) {
@@ -1041,7 +1041,7 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) _gif_save_decoding_status(gif_ptr, GIF_D_STATUS_IMG_DATA);
gif_ptr->img_row_offset += gif_ptr->img_row_avail_size;
gif_ptr->img_row_avail_size = gif_img_row_bytes - gif_ptr->img_row_offset;
- FX_INT32 ret = img_decoder_ptr->Decode(gif_image_ptr->image_row_buf + gif_ptr->img_row_offset, gif_ptr->img_row_avail_size);
+ int32_t ret = img_decoder_ptr->Decode(gif_image_ptr->image_row_buf + gif_ptr->img_row_offset, gif_ptr->img_row_avail_size);
if(ret == 0) {
FX_Free(gif_image_ptr->image_row_buf);
gif_image_ptr->image_row_buf = NULL;
@@ -1079,7 +1079,7 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) if(((GifLF*)&gif_image_ptr->image_info_ptr->local_flag)->interlace) {
gif_ptr->_gif_get_row_fn(gif_ptr, gif_image_ptr->image_row_num, gif_image_ptr->image_row_buf);
gif_image_ptr->image_row_num += s_gif_interlace_step[gif_ptr->img_pass_num];
- if(gif_image_ptr->image_row_num >= (FX_INT32)gif_image_ptr->image_info_ptr->height) {
+ if(gif_image_ptr->image_row_num >= (int32_t)gif_image_ptr->image_info_ptr->height) {
gif_ptr->img_pass_num++;
gif_image_ptr->image_row_num = s_gif_interlace_step[gif_ptr->img_pass_num] / 2;
}
@@ -1104,7 +1104,7 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) _gif_error(gif_ptr, "Decode Image Data Error");
return 0;
}
-void _gif_save_decoding_status(gif_decompress_struct_p gif_ptr, FX_INT32 status)
+void _gif_save_decoding_status(gif_decompress_struct_p gif_ptr, int32_t status)
{
gif_ptr->decode_status = status;
gif_ptr->next_in += gif_ptr->skip_size;
@@ -1137,7 +1137,7 @@ FX_DWORD _gif_get_avail_input(gif_decompress_struct_p gif_ptr, FX_LPBYTE* avial_ }
return gif_ptr->avail_in;
}
-FX_INT32 _gif_get_frame_num(gif_decompress_struct_p gif_ptr)
+int32_t _gif_get_frame_num(gif_decompress_struct_p gif_ptr)
{
return gif_ptr->img_ptr_arr_ptr->GetSize();
}
@@ -1147,7 +1147,7 @@ static FX_BOOL _gif_write_header( gif_compress_struct_p gif_ptr, FX_LPBYTE& dst_ return TRUE;
}
dst_len = sizeof(GifHeader) + sizeof(GifLSD) + sizeof(GifGF);
- dst_buf = FX_TryAlloc(FX_BYTE, dst_len);
+ dst_buf = FX_TryAlloc(uint8_t, dst_len);
if (dst_buf == NULL) {
return FALSE;
}
@@ -1188,7 +1188,7 @@ void interlace_buf(FX_LPCBYTE buf, FX_DWORD pitch, FX_DWORD height) } else {
j = 3;
}
- temp = FX_Alloc(FX_BYTE, pitch);
+ temp = FX_Alloc(uint8_t, pitch);
if (temp == NULL) {
return;
}
@@ -1213,7 +1213,7 @@ static void _gif_write_block_data(FX_LPCBYTE src_buf, FX_DWORD src_len, FX_LPBYT src_offset += GIF_DATA_BLOCK;
src_len -= GIF_DATA_BLOCK;
}
- dst_buf[dst_offset++] = (FX_BYTE)src_len;
+ dst_buf[dst_offset++] = (uint8_t)src_len;
FXSYS_memcpy32(&dst_buf[dst_offset], &src_buf[src_offset], src_len);
dst_offset += src_len;
}
@@ -1260,7 +1260,7 @@ static FX_BOOL _gif_write_data( gif_compress_struct_p gif_ptr, FX_LPBYTE& dst_bu if (lf.interlace) {
interlace_buf(gif_ptr->src_buf, gif_ptr->src_pitch, gif_ptr->image_info_ptr->height);
}
- FX_BYTE code_bit = lf.pal_bits;
+ uint8_t code_bit = lf.pal_bits;
if (lf.local_pal == 0) {
GifGF& gf = (GifGF&)gif_ptr->lsd_ptr->global_flag;
code_bit = gf.pal_bits;
diff --git a/core/src/fxcodec/lgif/fx_gif.h b/core/src/fxcodec/lgif/fx_gif.h index 09c63e20f6..10aaf5f98f 100644 --- a/core/src/fxcodec/lgif/fx_gif.h +++ b/core/src/fxcodec/lgif/fx_gif.h @@ -10,7 +10,7 @@ extern FX_WORD _GetWord_LSBFirst(FX_LPBYTE p);
extern void _SetWord_LSBFirst(FX_LPBYTE p, FX_WORD v);
-extern void _BpcConvert(FX_LPCBYTE src_buf, FX_DWORD src_len, FX_INT32 src_bpc, FX_INT32 dst_bpc,
+extern void _BpcConvert(FX_LPCBYTE src_buf, FX_DWORD src_len, int32_t src_bpc, int32_t dst_bpc,
FX_LPBYTE& dst_buf, FX_DWORD& dst_len);
#define GIF_SUPPORT_COMMENT_EXTENSION
#define GIF_SUPPORT_GRAPHIC_CONTROL_EXTENSION
@@ -39,17 +39,17 @@ extern void _BpcConvert(FX_LPCBYTE src_buf, FX_DWORD src_len, FX_INT32 src_bpc, #define GIF_D_STATUS_IMG_DATA 0x0A
#pragma pack(1)
typedef struct tagGifGF {
- FX_BYTE pal_bits : 3;
- FX_BYTE sort_flag : 1;
- FX_BYTE color_resolution : 3;
- FX_BYTE global_pal : 1;
+ uint8_t pal_bits : 3;
+ uint8_t sort_flag : 1;
+ uint8_t color_resolution : 3;
+ uint8_t global_pal : 1;
} GifGF;
typedef struct tagGifLF {
- FX_BYTE pal_bits : 3;
- FX_BYTE reserved : 2;
- FX_BYTE sort_flag : 1;
- FX_BYTE interlace : 1;
- FX_BYTE local_pal : 1;
+ uint8_t pal_bits : 3;
+ uint8_t reserved : 2;
+ uint8_t sort_flag : 1;
+ uint8_t interlace : 1;
+ uint8_t local_pal : 1;
} GifLF;
typedef struct tagGifHeader {
char signature[3];
@@ -58,9 +58,9 @@ typedef struct tagGifHeader { typedef struct tagGifLSD {
FX_WORD width;
FX_WORD height;
- FX_BYTE global_flag;
- FX_BYTE bc_index;
- FX_BYTE pixel_aspect;
+ uint8_t global_flag;
+ uint8_t bc_index;
+ uint8_t pixel_aspect;
} GifLSD;
typedef struct tagGifImageInfo {
FX_WORD left;
@@ -68,50 +68,50 @@ typedef struct tagGifImageInfo { FX_WORD width;
FX_WORD height;
- FX_BYTE local_flag;
+ uint8_t local_flag;
} GifImageInfo;
typedef struct tagGifCEF {
- FX_BYTE transparency : 1;
- FX_BYTE user_input : 1;
- FX_BYTE disposal_method : 3;
- FX_BYTE reserved : 3;
+ uint8_t transparency : 1;
+ uint8_t user_input : 1;
+ uint8_t disposal_method : 3;
+ uint8_t reserved : 3;
} GifCEF;
typedef struct tagGifGCE {
- FX_BYTE block_size;
- FX_BYTE gce_flag;
+ uint8_t block_size;
+ uint8_t gce_flag;
FX_WORD delay_time;
- FX_BYTE trans_index;
+ uint8_t trans_index;
} GifGCE;
typedef struct tagGifPTE {
- FX_BYTE block_size;
+ uint8_t block_size;
FX_WORD grid_left;
FX_WORD grid_top;
FX_WORD grid_width;
FX_WORD grid_height;
- FX_BYTE char_width;
- FX_BYTE char_height;
+ uint8_t char_width;
+ uint8_t char_height;
- FX_BYTE fc_index;
- FX_BYTE bc_index;
+ uint8_t fc_index;
+ uint8_t bc_index;
} GifPTE;
typedef struct tagGifAE {
- FX_BYTE block_size;
- FX_BYTE app_identify[8];
- FX_BYTE app_authentication[3];
+ uint8_t block_size;
+ uint8_t app_identify[8];
+ uint8_t app_authentication[3];
} GifAE;
typedef struct tagGifPalette {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
} GifPalette;
#pragma pack()
typedef struct tagGifImage {
GifGCE* image_gce_ptr;
GifPalette* local_pal_ptr;
GifImageInfo* image_info_ptr;
- FX_BYTE image_code_size;
+ uint8_t image_code_size;
FX_DWORD image_data_pos;
FX_LPBYTE image_row_buf;
- FX_INT32 image_row_num;
+ int32_t image_row_num;
} GifImage;
typedef struct tagGifPlainText {
GifGCE* gce_ptr;
@@ -123,30 +123,30 @@ class CGifLZWDecoder public:
struct tag_Table {
FX_WORD prefix;
- FX_BYTE suffix;
+ uint8_t suffix;
};
CGifLZWDecoder(FX_LPSTR error_ptr = NULL)
{
err_msg_ptr = error_ptr;
}
- void InitTable(FX_BYTE code_len);
+ void InitTable(uint8_t code_len);
- FX_INT32 Decode(FX_LPBYTE des_buf, FX_DWORD& des_size);
+ int32_t Decode(FX_LPBYTE des_buf, FX_DWORD& des_size);
void Input(FX_LPBYTE src_buf, FX_DWORD src_size);
FX_DWORD GetAvailInput();
private:
void ClearTable();
- void AddCode(FX_WORD prefix_code, FX_BYTE append_char);
+ void AddCode(FX_WORD prefix_code, uint8_t append_char);
void DecodeString(FX_WORD code);
- FX_BYTE code_size;
- FX_BYTE code_size_cur;
+ uint8_t code_size;
+ uint8_t code_size_cur;
FX_WORD code_clear;
FX_WORD code_end;
FX_WORD code_next;
- FX_BYTE code_first;
- FX_BYTE stack[GIF_MAX_LZW_CODE];
+ uint8_t code_first;
+ uint8_t stack[GIF_MAX_LZW_CODE];
FX_WORD stack_size;
tag_Table code_table[GIF_MAX_LZW_CODE];
FX_WORD code_old;
@@ -154,7 +154,7 @@ private: FX_LPBYTE next_in;
FX_DWORD avail_in;
- FX_BYTE bits_left;
+ uint8_t bits_left;
FX_DWORD code_store;
FX_LPSTR err_msg_ptr;
@@ -164,38 +164,38 @@ class CGifLZWEncoder public:
struct tag_Table {
FX_WORD prefix;
- FX_BYTE suffix;
+ uint8_t suffix;
};
CGifLZWEncoder();
~CGifLZWEncoder();
- void Start(FX_BYTE code_len, FX_LPCBYTE src_buf, FX_LPBYTE& dst_buf, FX_DWORD& offset);
+ void Start(uint8_t code_len, FX_LPCBYTE src_buf, FX_LPBYTE& dst_buf, FX_DWORD& offset);
FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_len, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
void Finish(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
private:
void ClearTable();
- FX_BOOL LookUpInTable(FX_LPCBYTE buf, FX_DWORD& offset, FX_BYTE& bit_offset);
+ FX_BOOL LookUpInTable(FX_LPCBYTE buf, FX_DWORD& offset, uint8_t& bit_offset);
void EncodeString(FX_DWORD index, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
void WriteBlock(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
jmp_buf jmp;
FX_DWORD src_offset;
- FX_BYTE src_bit_offset;
- FX_BYTE src_bit_cut;
+ uint8_t src_bit_offset;
+ uint8_t src_bit_cut;
FX_DWORD src_bit_num;
- FX_BYTE code_size;
+ uint8_t code_size;
FX_WORD code_clear;
FX_WORD code_end;
FX_WORD index_num;
- FX_BYTE bit_offset;
- FX_BYTE index_bit_cur;
- FX_BYTE index_buf[GIF_DATA_BLOCK];
- FX_BYTE index_buf_len;
+ uint8_t bit_offset;
+ uint8_t index_bit_cur;
+ uint8_t index_buf[GIF_DATA_BLOCK];
+ uint8_t index_buf_len;
tag_Table code_table[GIF_MAX_LZW_CODE];
FX_WORD table_cur;
};
typedef struct tag_gif_decompress_struct gif_decompress_struct;
typedef gif_decompress_struct *gif_decompress_struct_p;
typedef gif_decompress_struct_p *gif_decompress_struct_pp;
-static FX_INT32 s_gif_interlace_step[4] = {8, 8, 4, 2};
+static int32_t s_gif_interlace_step[4] = {8, 8, 4, 2};
struct tag_gif_decompress_struct {
jmp_buf jmpbuf;
FX_LPSTR err_ptr;
@@ -204,32 +204,32 @@ struct tag_gif_decompress_struct { int width;
int height;
GifPalette* global_pal_ptr;
- FX_INT32 global_pal_num;
- FX_BYTE global_sort_flag;
- FX_BYTE global_color_resolution;
+ int32_t global_pal_num;
+ uint8_t global_sort_flag;
+ uint8_t global_color_resolution;
- FX_BYTE bc_index;
- FX_BYTE pixel_aspect;
+ uint8_t bc_index;
+ uint8_t pixel_aspect;
CGifLZWDecoder* img_decoder_ptr;
FX_DWORD img_row_offset;
FX_DWORD img_row_avail_size;
- FX_BYTE img_pass_num;
+ uint8_t img_pass_num;
CFX_ArrayTemplate<GifImage*>* img_ptr_arr_ptr;
- FX_LPBYTE (*_gif_ask_buf_for_pal_fn)(gif_decompress_struct_p gif_ptr, FX_INT32 pal_size);
+ FX_LPBYTE (*_gif_ask_buf_for_pal_fn)(gif_decompress_struct_p gif_ptr, int32_t pal_size);
FX_LPBYTE next_in;
FX_DWORD avail_in;
- FX_INT32 decode_status;
+ int32_t decode_status;
FX_DWORD skip_size;
void (*_gif_record_current_position_fn)(gif_decompress_struct_p gif_ptr, FX_DWORD* cur_pos_ptr);
- void (*_gif_get_row_fn)(gif_decompress_struct_p gif_ptr, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*_gif_get_row_fn)(gif_decompress_struct_p gif_ptr, int32_t row_num, FX_LPBYTE row_buf);
FX_BOOL (*_gif_get_record_position_fn)(gif_decompress_struct_p gif_ptr, FX_DWORD cur_pos,
- FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace);
+ int32_t left, int32_t top, int32_t width, int32_t height,
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace);
#ifdef GIF_SUPPORT_APPLICATION_EXTENSION
- FX_BYTE app_identify[8];
- FX_BYTE app_authentication[3];
+ uint8_t app_identify[8];
+ uint8_t app_authentication[3];
FX_DWORD app_data_size;
FX_LPBYTE app_data;
#endif
@@ -262,8 +262,8 @@ struct tag_gif_compress_struct { GifImageInfo* image_info_ptr;
CGifLZWEncoder* img_encoder_ptr;
#ifdef GIF_SUPPORT_APPLICATION_EXTENSION
- FX_BYTE app_identify[8];
- FX_BYTE app_authentication[3];
+ uint8_t app_identify[8];
+ uint8_t app_authentication[3];
FX_DWORD app_data_size;
FX_LPBYTE app_data;
#endif
@@ -289,15 +289,15 @@ gif_decompress_struct_p _gif_create_decompress(); void _gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr);
gif_compress_struct_p _gif_create_compress();
void _gif_destroy_compress(gif_compress_struct_pp gif_ptr_ptr);
-FX_INT32 _gif_read_header(gif_decompress_struct_p gif_ptr);
-FX_INT32 _gif_get_frame(gif_decompress_struct_p gif_ptr);
-FX_INT32 _gif_get_frame_num(gif_decompress_struct_p gif_ptr);
-FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr);
-FX_INT32 _gif_decode_image_info(gif_decompress_struct_p gif_ptr);
+int32_t _gif_read_header(gif_decompress_struct_p gif_ptr);
+int32_t _gif_get_frame(gif_decompress_struct_p gif_ptr);
+int32_t _gif_get_frame_num(gif_decompress_struct_p gif_ptr);
+int32_t _gif_decode_extension(gif_decompress_struct_p gif_ptr);
+int32_t _gif_decode_image_info(gif_decompress_struct_p gif_ptr);
void _gif_takeover_gce_ptr(gif_decompress_struct_p gif_ptr, GifGCE** gce_ptr_ptr);
-FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num);
+int32_t _gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num);
FX_LPBYTE _gif_read_data(gif_decompress_struct_p gif_ptr, FX_LPBYTE* des_buf_pp, FX_DWORD data_size);
-void _gif_save_decoding_status(gif_decompress_struct_p gif_ptr, FX_INT32 status);
+void _gif_save_decoding_status(gif_decompress_struct_p gif_ptr, int32_t status);
void _gif_input_buffer(gif_decompress_struct_p gif_ptr, FX_LPBYTE src_buf, FX_DWORD src_size);
FX_DWORD _gif_get_avail_input(gif_decompress_struct_p gif_ptr, FX_LPBYTE* avial_buf_ptr);
void interlace_buf(FX_LPCBYTE buf, FX_DWORD width, FX_DWORD height);
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h index 86e46eb5a0..99a5cf3c4e 100644 --- a/core/src/fxcrt/extension.h +++ b/core/src/fxcrt/extension.h @@ -198,7 +198,7 @@ public: ~CFX_MemoryStream() { if (m_dwFlags & FX_MEMSTREAM_TakeOver) { - for (FX_INT32 i = 0; i < m_Blocks.GetSize(); i++) { + for (int32_t i = 0; i < m_Blocks.GetSize(); i++) { FX_Free((FX_LPBYTE)m_Blocks[i]); } } @@ -308,7 +308,7 @@ public: } } size_t nRead = FX_MIN(size, m_nCurSize - m_nCurPos); - if (!ReadBlock(buffer, (FX_INT32)m_nCurPos, nRead)) { + if (!ReadBlock(buffer, (int32_t)m_nCurPos, nRead)) { return 0; } return nRead; @@ -331,10 +331,10 @@ public: if (m_nCurPos > m_nTotalSize) { m_nTotalSize = (m_nCurPos + m_nGrowSize - 1) / m_nGrowSize * m_nGrowSize; if (m_Blocks.GetSize() < 1) { - void* block = FX_Alloc(FX_BYTE, m_nTotalSize); + void* block = FX_Alloc(uint8_t, m_nTotalSize); m_Blocks.Add(block); } else { - m_Blocks[0] = FX_Realloc(FX_BYTE, m_Blocks[0], m_nTotalSize); + m_Blocks[0] = FX_Realloc(uint8_t, m_Blocks[0], m_nTotalSize); } if (!m_Blocks[0]) { m_Blocks.RemoveAll(); @@ -385,7 +385,7 @@ public: { if (m_dwFlags & FX_MEMSTREAM_Consecutive) { if (m_Blocks.GetSize() < 1) { - FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, FX_MAX(nInitSize, 4096)); + FX_LPBYTE pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096)); m_Blocks.Add(pBlock); } m_nGrowSize = FX_MAX(nGrowSize, 4096); @@ -438,11 +438,11 @@ protected: if (size <= m_nTotalSize) { return TRUE; } - FX_INT32 iCount = m_Blocks.GetSize(); + int32_t iCount = m_Blocks.GetSize(); size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize; - m_Blocks.SetSize(m_Blocks.GetSize() + (FX_INT32)size); + m_Blocks.SetSize(m_Blocks.GetSize() + (int32_t)size); while (size --) { - FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, m_nGrowSize); + FX_LPBYTE pBlock = FX_Alloc(uint8_t, m_nGrowSize); m_Blocks.SetAt(iCount ++, pBlock); m_nTotalSize += m_nGrowSize; } @@ -469,7 +469,7 @@ typedef struct _FX_MTRANDOMCONTEXT { } FX_MTRANDOMCONTEXT, * FX_LPMTRANDOMCONTEXT; typedef FX_MTRANDOMCONTEXT const * FX_LPCMTRANDOMCONTEXT; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount); +FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount); #endif #ifdef __cplusplus } diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp index dd5d1d81bd..81c86542c7 100644 --- a/core/src/fxcrt/fx_arabic.cpp +++ b/core/src/fxcrt/fx_arabic.cpp @@ -214,8 +214,8 @@ FX_LPCARBFORMTABLE FX_GetArabicFormTable(FX_WCHAR unicode) } FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef) { - static const FX_INT32 s_iAlefCount = sizeof(gs_FX_AlefTable) / sizeof(FX_ARAALEF); - for (FX_INT32 iStart = 0; iStart < s_iAlefCount; iStart ++) { + static const int32_t s_iAlefCount = sizeof(gs_FX_AlefTable) / sizeof(FX_ARAALEF); + for (int32_t iStart = 0; iStart < s_iAlefCount; iStart ++) { const FX_ARAALEF &v = gs_FX_AlefTable[iStart]; if (v.wAlef == alef) { return v.wIsolated; @@ -225,8 +225,8 @@ FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef) } FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda) { - static const FX_INT32 s_iShaddaCount = sizeof(gs_FX_ShaddaTable) / sizeof(FX_ARASHADDA); - for (FX_INT32 iStart = 0; iStart < s_iShaddaCount; iStart ++) { + static const int32_t s_iShaddaCount = sizeof(gs_FX_ShaddaTable) / sizeof(FX_ARASHADDA); + for (int32_t iStart = 0; iStart < s_iShaddaCount; iStart ++) { const FX_ARASHADDA &v = gs_FX_ShaddaTable[iStart]; if (v.wShadda == shadda) { return v.wIsolated; @@ -307,7 +307,7 @@ FX_LPCARBFORMTABLE CFX_ArabicChar::ParseChar(const CFX_Char *pTC, FX_WCHAR &wCha } return pFT; } -void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCount) +void FX_BidiReverseString(CFX_WideString &wsText, int32_t iStart, int32_t iCount) { FXSYS_assert(iStart > -1 && iStart < wsText.GetLength()); FXSYS_assert(iCount >= 0 && iStart + iCount <= wsText.GetLength()); @@ -321,15 +321,15 @@ void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCou *pEnd -- = wch; } } -void FX_BidiSetDeferredRun(CFX_Int32Array &values, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue) +void FX_BidiSetDeferredRun(CFX_Int32Array &values, int32_t iStart, int32_t iCount, int32_t iValue) { FXSYS_assert(iStart > -1 && iStart <= values.GetSize()); FXSYS_assert(iStart - iCount > -1); - for (FX_INT32 i = iStart - 1; i >= iStart - iCount; i --) { + for (int32_t i = iStart - 1; i >= iStart - iCount; i --) { values.SetAt(i, iValue); } } -const FX_INT32 gc_FX_BidiNTypes[] = { +const int32_t gc_FX_BidiNTypes[] = { FX_BIDICLASS_N, FX_BIDICLASS_L, FX_BIDICLASS_R, @@ -354,25 +354,25 @@ const FX_INT32 gc_FX_BidiNTypes[] = { void FX_BidiClassify(const CFX_WideString &wsText, CFX_Int32Array &classes, FX_BOOL bWS) { FXSYS_assert(wsText.GetLength() == classes.GetSize()); - FX_INT32 iCount = wsText.GetLength(); + int32_t iCount = wsText.GetLength(); FX_LPCWSTR pwsStart = (FX_LPCWSTR)wsText; FX_WCHAR wch; - FX_INT32 iCls; + int32_t iCls; if (bWS) { - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { wch = *pwsStart ++; iCls = ((gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS); classes.SetAt(i, iCls); } } else { - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { wch = *pwsStart ++; iCls = ((gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS); classes.SetAt(i, gc_FX_BidiNTypes[iCls]); } } } -FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iNest) +int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, int32_t iStart, int32_t iCount, int32_t iNest) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL && iNest >= 0); FXSYS_assert(classes.GetSize() == levels.GetSize()); @@ -382,10 +382,10 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In return 0; } #if 0 - FX_INT32 iLastNest = iNest; + int32_t iLastNest = iNest; #endif - FX_INT32 iSize = classes.GetSize(); - FX_INT32 i = iStart, iCur, iCls; + int32_t iSize = classes.GetSize(); + int32_t i = iStart, iCur, iCls; for (; i < iSize && iCount > 0; i ++, iCount --) { iCur = iCls = classes.GetAt(i); #if 0 @@ -396,7 +396,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In iCls = FX_BIDICLASS_BN; iNest ++; if (FX_BidiGreaterEven(iBaseLevel) <= MAX_LEVEL) { - FX_INT32 iLevel = FX_BidiGreaterEven(iBaseLevel); + int32_t iLevel = FX_BidiGreaterEven(iBaseLevel); levels.SetAt(i, iLevel); i += FX_BidiResolveExplicit(iLevel, (iCls == FX_BIDICLASS_LRE ? FX_BIDICLASS_N : FX_BIDICLASS_L), @@ -415,7 +415,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In iCls = FX_BIDICLASS_BN; iNest ++; if (FX_BidiGreaterOdd(iBaseLevel) <= MAX_LEVEL) { - FX_INT32 iLevel = FX_BidiGreaterOdd(iBaseLevel); + int32_t iLevel = FX_BidiGreaterOdd(iBaseLevel); levels.SetAt(i, iLevel); i += FX_BidiResolveExplicit(iLevel, (iCls == FX_BIDICLASS_RLE ? FX_BIDICLASS_N : FX_BIDICLASS_R), @@ -452,7 +452,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In } return i - iStart; } -const FX_INT32 gc_FX_BidiWeakStates[][10] = { +const int32_t gc_FX_BidiWeakStates[][10] = { {FX_BWSao, FX_BWSxl, FX_BWSxr, FX_BWScn, FX_BWScn, FX_BWSxa, FX_BWSxa, FX_BWSao, FX_BWSao, FX_BWSao}, {FX_BWSro, FX_BWSxl, FX_BWSxr, FX_BWSra, FX_BWSre, FX_BWSxa, FX_BWSxr, FX_BWSro, FX_BWSro, FX_BWSrt}, {FX_BWSlo, FX_BWSxl, FX_BWSxr, FX_BWSla, FX_BWSle, FX_BWSxa, FX_BWSxl, FX_BWSlo, FX_BWSlo, FX_BWSlt}, @@ -474,7 +474,7 @@ const FX_INT32 gc_FX_BidiWeakStates[][10] = { {FX_BWSro, FX_BWSxl, FX_BWSxr, FX_BWSra, FX_BWSre, FX_BWSxa, FX_BWSret, FX_BWSro, FX_BWSro, FX_BWSret}, {FX_BWSlo, FX_BWSxl, FX_BWSxr, FX_BWSla, FX_BWSle, FX_BWSxa, FX_BWSlet, FX_BWSlo, FX_BWSlo, FX_BWSlet}, }; -const FX_INT32 gc_FX_BidiWeakActions[][10] = { +const int32_t gc_FX_BidiWeakActions[][10] = { {FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxA, FX_BWAxxR, FX_BWAxxR, FX_BWAxxN, FX_BWAxxN, FX_BWAxxN}, {FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxE, FX_BWAxxR, FX_BWAxxR, FX_BWAxxN, FX_BWAxxN, FX_BWAxIx}, {FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxL, FX_BWAxxR, FX_BWAxxL, FX_BWAxxN, FX_BWAxxN, FX_BWAxIx}, @@ -496,18 +496,18 @@ const FX_INT32 gc_FX_BidiWeakActions[][10] = { {FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxE, FX_BWAxxR, FX_BWAxxE, FX_BWAxxN, FX_BWAxxN, FX_BWAxxE}, {FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxL, FX_BWAxxR, FX_BWAxxL, FX_BWAxxN, FX_BWAxxN, FX_BWAxxL}, }; -void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels) +void FX_BidiResolveWeak(int32_t iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); FXSYS_assert(classes.GetSize() == levels.GetSize()); - FX_INT32 iSize = classes.GetSize(); + int32_t iSize = classes.GetSize(); if (iSize < 1) { return; } iSize --; - FX_INT32 iLevelCur = iBaseLevel; - FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl; - FX_INT32 i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction; + int32_t iLevelCur = iBaseLevel; + int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl; + int32_t i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction; for (; i <= iSize; i ++) { iClsCur = classes.GetAt(i); #if 0 @@ -517,7 +517,7 @@ void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32A iClsCur = FX_BidiDirection(iLevelCur); classes.SetAt(i, iClsCur); } else if (i < iSize) { - FX_INT32 iLevelNext, iLevelNew; + int32_t iLevelNext, iLevelNew; iClsNew = classes.GetAt(i + 1); iLevelNext = levels.GetAt(i + 1); if (iClsNew != FX_BIDICLASS_BN && iLevelCur != iLevelNext) { @@ -565,7 +565,7 @@ void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32A FX_BidiSetDeferredRun(classes, i, iCount, iClsRun); } } -const FX_INT32 gc_FX_BidiNeutralStates[][5] = { +const int32_t gc_FX_BidiNeutralStates[][5] = { {FX_BNSrn, FX_BNSl, FX_BNSr, FX_BNSr, FX_BNSr}, {FX_BNSln, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl}, {FX_BNSrn, FX_BNSl, FX_BNSr, FX_BNSr, FX_BNSr}, @@ -573,7 +573,7 @@ const FX_INT32 gc_FX_BidiNeutralStates[][5] = { {FX_BNSna, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl}, {FX_BNSna, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl}, }; -const FX_INT32 gc_FX_BidiNeutralActions[][5] = { +const int32_t gc_FX_BidiNeutralActions[][5] = { {FX_BNAIn, 0, 0, 0, 0 }, {FX_BNAIn, 0, 0, 0, FX_BCL }, {FX_BNAIn, FX_BNAEn, FX_BNARn, FX_BNARn, FX_BNARn }, @@ -581,7 +581,7 @@ const FX_INT32 gc_FX_BidiNeutralActions[][5] = { {FX_BNAIn, 0, 0, 0, FX_BCL }, {FX_BNAIn, FX_BNAEn, FX_BNARn, FX_BNARn, FX_BNAEn }, }; -FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel) +int32_t FX_BidiGetDeferredNeutrals(int32_t iAction, int32_t iLevel) { iAction = (iAction >> 4) & 0xF; if (iAction == (FX_BIDINEUTRALACTION_En >> 4)) { @@ -590,7 +590,7 @@ FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel) return iAction; } } -FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction) +int32_t FX_BidiGetResolvedNeutrals(int32_t iAction) { iAction = (iAction & 0xF); if (iAction == FX_BIDINEUTRALACTION_In) { @@ -599,18 +599,18 @@ FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction) return iAction; } } -void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels) +void FX_BidiResolveNeutrals(int32_t iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); FXSYS_assert(classes.GetSize() == levels.GetSize()); - FX_INT32 iSize = classes.GetSize(); + int32_t iSize = classes.GetSize(); if (iSize < 1) { return; } iSize --; - FX_INT32 iLevel = iBaseLevel; - FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl; - FX_INT32 i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction; + int32_t iLevel = iBaseLevel; + int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl; + int32_t i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction; for (; i <= iSize; i ++) { iClsCur = classes.GetAt(i); if (iClsCur == FX_BIDICLASS_BN) { @@ -642,20 +642,20 @@ void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const FX_BidiSetDeferredRun(classes, i, iCount, iClsRun); } } -const FX_INT32 gc_FX_BidiAddLevel[][4] = { +const int32_t gc_FX_BidiAddLevel[][4] = { {0, 1, 2, 2}, {1, 0, 1, 1}, }; void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &levels) { FXSYS_assert(classes.GetSize() == levels.GetSize()); - FX_INT32 iSize = classes.GetSize(); + int32_t iSize = classes.GetSize(); if (iSize < 1) { return; } iSize --; - FX_INT32 iCls, iLevel; - for (FX_INT32 i = 0; i <= iSize; i ++) { + int32_t iCls, iLevel; + for (int32_t i = 0; i <= iSize; i ++) { iCls = classes.GetAt(i); if (iCls == FX_BIDICLASS_BN) { continue; @@ -666,17 +666,17 @@ void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &level levels.SetAt(i, iLevel); } } -void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels) +void FX_BidiResolveWhitespace(int32_t iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); FXSYS_assert(classes.GetSize() == levels.GetSize()); - FX_INT32 iSize = classes.GetSize(); + int32_t iSize = classes.GetSize(); if (iSize < 1) { return; } iSize --; - FX_INT32 iLevel = iBaseLevel; - FX_INT32 i = 0, iCount = 0; + int32_t iLevel = iBaseLevel; + int32_t i = 0, iCount = 0; for (; i <= iSize; i ++) { switch(classes.GetAt(i)) { case FX_BIDICLASS_WS: @@ -709,17 +709,17 @@ void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes FX_BidiSetDeferredRun(levels, i, iCount, iBaseLevel); } } -FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, FX_INT32 iStart, FX_BOOL bReverse) +int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, int32_t iStart, FX_BOOL bReverse) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); FXSYS_assert(wsText.GetLength() == levels.GetSize()); FXSYS_assert(iStart >= 0 && iStart < wsText.GetLength()); - FX_INT32 iSize = wsText.GetLength(); + int32_t iSize = wsText.GetLength(); if (iSize < 1) { return 0; } bReverse = bReverse || FX_IsOdd(iBaseLevel); - FX_INT32 i = iStart, iLevel; + int32_t i = iStart, iLevel; for (; i < iSize; i ++) { if ((iLevel = levels.GetAt(i)) == iBaseLevel) { continue; @@ -729,28 +729,28 @@ FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const } i += FX_BidiReorderLevel(iBaseLevel + 1, wsText, levels, i, bReverse) - 1; } - FX_INT32 iCount = i - iStart; + int32_t iCount = i - iStart; if (bReverse && iCount > 1) { FX_BidiReverseString(wsText, iStart, iCount); } return iCount; } -void FX_BidiReorder(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels) +void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels) { FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); FXSYS_assert(wsText.GetLength() == levels.GetSize()); - FX_INT32 iSize = wsText.GetLength(); + int32_t iSize = wsText.GetLength(); if (iSize < 1) { return; } - FX_INT32 i = 0; + int32_t i = 0; while (i < iSize) { i += FX_BidiReorderLevel(iBaseLevel, wsText, levels, i, FALSE); } } -void FX_BidiLine(CFX_WideString &wsText, FX_INT32 iBaseLevel) +void FX_BidiLine(CFX_WideString &wsText, int32_t iBaseLevel) { - FX_INT32 iLength = wsText.GetLength(); + int32_t iLength = wsText.GetLength(); if (iLength < 2) { return; } @@ -772,12 +772,12 @@ template<class baseType> class CFX_BidiLineTemplate { public: - void FX_BidiReverseString(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iStart, FX_INT32 iCount) + void FX_BidiReverseString(CFX_ArrayTemplate<baseType> &chars, int32_t iStart, int32_t iCount) { FXSYS_assert(iStart > -1 && iStart < chars.GetSize()); FXSYS_assert(iCount >= 0 && iStart + iCount <= chars.GetSize()); baseType *pStart, *pEnd; - FX_INT32 iEnd = iStart + iCount - 1, iTemp; + int32_t iEnd = iStart + iCount - 1, iTemp; while (iStart < iEnd) { pStart = chars.GetDataPtr(iStart ++); pEnd = chars.GetDataPtr(iEnd --); @@ -786,41 +786,41 @@ public: pEnd->m_iBidiPos = iTemp; } } - void FX_BidiSetDeferredRun(CFX_ArrayTemplate<baseType> &chars, FX_BOOL bClass, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue) + void FX_BidiSetDeferredRun(CFX_ArrayTemplate<baseType> &chars, FX_BOOL bClass, int32_t iStart, int32_t iCount, int32_t iValue) { FXSYS_assert(iStart > -1 && iStart <= chars.GetSize()); FXSYS_assert(iStart - iCount > -1); baseType *pTC; - FX_INT32 iLast = iStart - iCount; + int32_t iLast = iStart - iCount; if (bClass) { - for (FX_INT32 i = iStart - 1; i >= iLast; i --) { + for (int32_t i = iStart - 1; i >= iLast; i --) { pTC = chars.GetDataPtr(i); - pTC->m_iBidiClass = (FX_INT16)iValue; + pTC->m_iBidiClass = (int16_t)iValue; } } else { - for (FX_INT32 i = iStart - 1; i >= iLast; i --) { + for (int32_t i = iStart - 1; i >= iLast; i --) { pTC = chars.GetDataPtr(i); - pTC->m_iBidiLevel = (FX_INT16)iValue; + pTC->m_iBidiLevel = (int16_t)iValue; } } } - void FX_BidiClassify(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_BOOL bWS) + void FX_BidiClassify(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, FX_BOOL bWS) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); baseType *pTC; if (bWS) { - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); - pTC->m_iBidiClass = (FX_INT16)(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; + pTC->m_iBidiClass = (int16_t)(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; } } else { - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); - pTC->m_iBidiClass = (FX_INT16)gc_FX_BidiNTypes[(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS]; + pTC->m_iBidiClass = (int16_t)gc_FX_BidiNTypes[(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS]; } } } - void FX_BidiResolveExplicit(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiResolveExplicit(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); @@ -828,12 +828,12 @@ public: return; } baseType *pTC; - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); - pTC->m_iBidiLevel = (FX_INT16)iBaseLevel; + pTC->m_iBidiLevel = (int16_t)iBaseLevel; } } - void FX_BidiResolveWeak(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiResolveWeak(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); iCount --; @@ -841,20 +841,20 @@ public: return; } baseType *pTC, *pTCNext; - FX_INT32 iLevelCur = iBaseLevel; - FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl; - FX_INT32 i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; + int32_t iLevelCur = iBaseLevel; + int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl; + int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; for (; i <= iCount; i ++) { pTC = chars.GetDataPtr(i); iClsCur = pTC->m_iBidiClass; if (iClsCur == FX_BIDICLASS_BN) { - pTC->m_iBidiLevel = (FX_INT16)iLevelCur; + pTC->m_iBidiLevel = (int16_t)iLevelCur; if (i == iCount && iLevelCur != iBaseLevel) { iClsCur = FX_BidiDirection(iLevelCur); - pTC->m_iBidiClass = (FX_INT16)iClsCur; + pTC->m_iBidiClass = (int16_t)iClsCur; } else if (i < iCount) { pTCNext = chars.GetDataPtr(i + 1); - FX_INT32 iLevelNext, iLevelNew; + int32_t iLevelNext, iLevelNew; iClsNew = pTCNext->m_iBidiClass; iLevelNext = pTCNext->m_iBidiLevel; if (iClsNew != FX_BIDICLASS_BN && iLevelCur != iLevelNext) { @@ -862,9 +862,9 @@ public: if (iLevelCur > iLevelNew) { iLevelNew = iLevelCur; } - pTC->m_iBidiLevel = (FX_INT16)iLevelNew; + pTC->m_iBidiLevel = (int16_t)iLevelNew; iClsCur = FX_BidiDirection(iLevelNew); - pTC->m_iBidiClass = (FX_INT16)iClsCur; + pTC->m_iBidiClass = (int16_t)iClsCur; iLevelCur = iLevelNext; } else { if (iNum > 0) { @@ -888,7 +888,7 @@ public: } iClsNew = FX_BidiGetResolvedType(iAction); if (iClsNew != FX_BIDIWEAKACTION_XX) { - pTC->m_iBidiClass = (FX_INT16)iClsNew; + pTC->m_iBidiClass = (int16_t)iClsNew; } if (FX_BIDIWEAKACTION_IX & iAction) { iNum ++; @@ -903,7 +903,7 @@ public: } } } - void FX_BidiResolveNeutrals(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiResolveNeutrals(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); @@ -912,9 +912,9 @@ public: return; } baseType *pTC; - FX_INT32 iLevel = iBaseLevel; - FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl; - FX_INT32 i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; + int32_t iLevel = iBaseLevel; + int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl; + int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; for (; i <= iCount; i ++) { pTC = chars.GetDataPtr(i); iClsCur = pTC->m_iBidiClass; @@ -933,7 +933,7 @@ public: } iClsNew = FX_BidiGetResolvedNeutrals(iAction); if (iClsNew != FX_BIDICLASS_N) { - pTC->m_iBidiClass = (FX_INT16)iClsNew; + pTC->m_iBidiClass = (int16_t)iClsNew; } if (FX_BIDINEUTRALACTION_In & iAction) { iNum ++; @@ -949,12 +949,12 @@ public: } } } - void FX_BidiResolveImplicit(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount) + void FX_BidiResolveImplicit(CFX_ArrayTemplate<baseType> &chars, int32_t iCount) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); baseType *pTC; - FX_INT32 iCls, iLevel; - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCls, iLevel; + for (int32_t i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); iCls = pTC->m_iBidiClass; if (iCls == FX_BIDICLASS_BN) { @@ -963,10 +963,10 @@ public: FXSYS_assert(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL); iLevel = pTC->m_iBidiLevel; iLevel += gc_FX_BidiAddLevel[FX_IsOdd(iLevel)][iCls - 1]; - pTC->m_iBidiLevel = (FX_INT16)iLevel; + pTC->m_iBidiLevel = (int16_t)iLevel; } } - void FX_BidiResolveWhitespace(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiResolveWhitespace(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); @@ -974,8 +974,8 @@ public: return; } iCount --; - FX_INT32 iLevel = iBaseLevel; - FX_INT32 i = 0, iNum = 0; + int32_t iLevel = iBaseLevel; + int32_t i = 0, iNum = 0; baseType *pTC; for (; i <= iCount; i ++) { pTC = chars.GetDataPtr(i); @@ -989,7 +989,7 @@ public: case FX_BIDICLASS_RLO: case FX_BIDICLASS_PDF: case FX_BIDICLASS_BN: - pTC->m_iBidiLevel = (FX_INT16)iLevel; + pTC->m_iBidiLevel = (int16_t)iLevel; iNum ++; break; case FX_BIDICLASS_S: @@ -997,7 +997,7 @@ public: if (iNum > 0) { FX_BidiSetDeferredRun(chars, FALSE, i, iNum, iBaseLevel); } - pTC->m_iBidiLevel = (FX_INT16)iBaseLevel; + pTC->m_iBidiLevel = (int16_t)iBaseLevel; iNum = 0; break; default: @@ -1010,7 +1010,7 @@ public: FX_BidiSetDeferredRun(chars, FALSE, i, iNum, iBaseLevel); } } - FX_INT32 FX_BidiReorderLevel(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel, FX_INT32 iStart, FX_BOOL bReverse) + int32_t FX_BidiReorderLevel(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel, int32_t iStart, FX_BOOL bReverse) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); @@ -1020,7 +1020,7 @@ public: } baseType *pTC; bReverse = bReverse || FX_IsOdd(iBaseLevel); - FX_INT32 i = iStart, iLevel; + int32_t i = iStart, iLevel; for (; i < iCount; i ++) { pTC = chars.GetDataPtr(i); if ((iLevel = pTC->m_iBidiLevel) == iBaseLevel) { @@ -1031,26 +1031,26 @@ public: } i += FX_BidiReorderLevel(chars, iCount, iBaseLevel + 1, i, bReverse) - 1; } - FX_INT32 iNum = i - iStart; + int32_t iNum = i - iStart; if (bReverse && iNum > 1) { FX_BidiReverseString(chars, iStart, iNum); } return iNum; } - void FX_BidiReorder(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiReorder(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FX_INT32 i = 0; + int32_t i = 0; while (i < iCount) { i += FX_BidiReorderLevel(chars, iCount, iBaseLevel, i, FALSE); } } - void FX_BidiPosition(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount) + void FX_BidiPosition(CFX_ArrayTemplate<baseType> &chars, int32_t iCount) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); baseType *pTC; - FX_INT32 i = 0; + int32_t i = 0; while (i < iCount) { pTC = chars.GetDataPtr(i); pTC = chars.GetDataPtr(pTC->m_iBidiPos); @@ -1058,7 +1058,7 @@ public: } } - void FX_BidiLine(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) + void FX_BidiLine(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel) { FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); if (iCount < 2) { @@ -1075,12 +1075,12 @@ public: FX_BidiPosition(chars, iCount); } }; -void FX_BidiLine(CFX_TxtCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) +void FX_BidiLine(CFX_TxtCharArray &chars, int32_t iCount, int32_t iBaseLevel) { CFX_BidiLineTemplate<CFX_TxtChar> blt; blt.FX_BidiLine(chars, iCount, iBaseLevel); } -void FX_BidiLine(CFX_RTFCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel) +void FX_BidiLine(CFX_RTFCharArray &chars, int32_t iCount, int32_t iBaseLevel) { CFX_BidiLineTemplate<CFX_RTFChar> blt; blt.FX_BidiLine(chars, iCount, iBaseLevel); @@ -1102,8 +1102,8 @@ CFX_BidiChar::CFX_BidiChar() FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch) { FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch]; - FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; - FX_INT32 iContext = 0; + int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; + int32_t iContext = 0; switch (iBidiCls) { case FX_BIDICLASS_L: case FX_BIDICLASS_AN: @@ -1147,7 +1147,7 @@ FX_BOOL CFX_BidiChar::EndChar() m_iLastCount = m_iCurCount - m_iLastStart; return m_iLastCount > 0; } -FX_INT32 CFX_BidiChar::GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) +int32_t CFX_BidiChar::GetBidiInfo(int32_t &iStart, int32_t &iCount) { iStart = m_iLastStart; iCount = m_iLastCount; diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h index 66e8bc8000..27e519367a 100644 --- a/core/src/fxcrt/fx_arabic.h +++ b/core/src/fxcrt/fx_arabic.h @@ -26,8 +26,8 @@ public: protected: FX_LPCARBFORMTABLE ParseChar(const CFX_Char *pTC, FX_WCHAR &wChar, FX_CHARTYPE &eType) const; }; -void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCount); -void FX_BidiSetDeferredRun(CFX_Int32Array &values, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue); +void FX_BidiReverseString(CFX_WideString &wsText, int32_t iStart, int32_t iCount); +void FX_BidiSetDeferredRun(CFX_Int32Array &values, int32_t iStart, int32_t iCount, int32_t iValue); #define FX_BCON FX_BIDICLASS_ON #define FX_BCL FX_BIDICLASS_L #define FX_BCR FX_BIDICLASS_R @@ -52,7 +52,7 @@ void FX_BidiClassify(const CFX_WideString &wsText, CFX_Int32Array &classes, FX_B #define FX_BIDIMAXLEVEL 61 #define FX_BidiGreaterEven(a) (FX_IsOdd(a) ? ((a) + 1) : ((a) + 2)) #define FX_BidiGreaterOdd(a) (FX_IsOdd(a) ? ((a) + 2) : ((a) + 1)) -FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iNest = 0); +int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, int32_t iStart, int32_t iCount, int32_t iNest = 0); #define FX_BidiDirection(a) (FX_IsOdd(a) ? FX_BIDICLASS_R : FX_BIDICLASS_L) enum FX_BIDIWEAKSTATE { FX_BIDIWEAKSTATE_xa = 0, @@ -144,7 +144,7 @@ enum FX_BIDIWEAKACTION { #define FX_BWALxx FX_BIDIWEAKACTION_Lxx #define FX_BidiGetDeferredType(a) (((a) >> 4) & 0x0F) #define FX_BidiGetResolvedType(a) ((a) & 0x0F) -void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels); +void FX_BidiResolveWeak(int32_t iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels); enum FX_BIDINEUTRALSTATE { FX_BIDINEUTRALSTATE_r = 0, FX_BIDINEUTRALSTATE_l, @@ -173,13 +173,13 @@ enum FX_BIDINEUTRALACTION { #define FX_BNALn FX_BIDINEUTRALACTION_Ln #define FX_BNAIn FX_BIDINEUTRALACTION_In #define FX_BNALnL FX_BIDINEUTRALACTION_LnL -FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel); -FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction); -void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels); +int32_t FX_BidiGetDeferredNeutrals(int32_t iAction, int32_t iLevel); +int32_t FX_BidiGetResolvedNeutrals(int32_t iAction); +void FX_BidiResolveNeutrals(int32_t iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels); void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &levels); -void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels); -FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, FX_INT32 iStart, FX_BOOL bReverse = FALSE); -void FX_BidiReorder(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels); +void FX_BidiResolveWhitespace(int32_t iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels); +int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, int32_t iStart, FX_BOOL bReverse = FALSE); +void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels); class CFX_BidiChar final : public IFX_BidiChar { public: @@ -194,18 +194,18 @@ public: } virtual FX_BOOL AppendChar(FX_WCHAR wch) override; virtual FX_BOOL EndChar() override; - virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) override; + virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) override; virtual void Reset() override; private: ~CFX_BidiChar() { } - FX_BOOL m_bSeparateNeutral; - FX_INT32 m_iCurStart; - FX_INT32 m_iCurCount; - FX_INT32 m_iCurBidi; - FX_INT32 m_iLastBidi; - FX_INT32 m_iLastStart; - FX_INT32 m_iLastCount; + FX_BOOL m_bSeparateNeutral; + int32_t m_iCurStart; + int32_t m_iCurCount; + int32_t m_iCurBidi; + int32_t m_iLastBidi; + int32_t m_iLastStart; + int32_t m_iLastCount; }; #endif // CORE_SRC_FXCRT_FX_ARABIC_H_ diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp index 43a5417c00..315c83e53a 100644 --- a/core/src/fxcrt/fx_basic_array.cpp +++ b/core/src/fxcrt/fx_basic_array.cpp @@ -38,7 +38,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize) m_nSize = m_nMaxSize = 0; return FALSE; } - m_pData = FX_Alloc(FX_BYTE, totalSize.ValueOrDie()); + m_pData = FX_Alloc(uint8_t, totalSize.ValueOrDie()); m_nSize = m_nMaxSize = nNewSize; } else if (nNewSize <= m_nMaxSize) { if (nNewSize > m_nSize) { @@ -52,7 +52,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize) if (!totalSize.IsValid() || nNewMax < m_nSize) { return FALSE; } - FX_LPBYTE pNewData = FX_Realloc(FX_BYTE, m_pData, totalSize.ValueOrDie()); + FX_LPBYTE pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie()); if (pNewData == NULL) { return FALSE; } @@ -185,7 +185,7 @@ void* CFX_BaseSegmentedArray::Add() if (m_DataSize % m_SegmentSize) { return GetAt(m_DataSize ++); } - void* pSegment = FX_Alloc2D(FX_BYTE, m_UnitSize, m_SegmentSize); + void* pSegment = FX_Alloc2D(uint8_t, m_UnitSize, m_SegmentSize); if (m_pIndex == NULL) { m_pIndex = pSegment; m_DataSize ++; @@ -315,8 +315,8 @@ void CFX_BaseSegmentedArray::Delete(int index, int count) } int i; for (i = index; i < m_DataSize - count; i ++) { - FX_BYTE* pSrc = (FX_BYTE*)GetAt(i + count); - FX_BYTE* pDest = (FX_BYTE*)GetAt(i); + uint8_t* pSrc = (uint8_t*)GetAt(i + count); + uint8_t* pDest = (uint8_t*)GetAt(i); for (int j = 0; j < m_UnitSize; j ++) { pDest[j] = pSrc[j]; } diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp index 2377a6d624..78698fc6d0 100644 --- a/core/src/fxcrt/fx_basic_bstring.cpp +++ b/core/src/fxcrt/fx_basic_bstring.cpp @@ -72,7 +72,7 @@ CFX_ByteString::StringData* CFX_ByteString::StringData::Create(int nLen) int usableSize = totalSize - overhead; FXSYS_assert(usableSize >= nLen); - void* pData = FX_Alloc(FX_BYTE, totalSize); + void* pData = FX_Alloc(uint8_t, totalSize); return new (pData) StringData(nLen, usableSize); } CFX_ByteString::~CFX_ByteString() @@ -284,11 +284,11 @@ bool CFX_ByteString::EqualNoCase(FX_BSTR str) const FX_LPCBYTE pThat = str.GetPtr(); for (FX_STRSIZE i = 0; i < len; i ++) { if ((*pThis) != (*pThat)) { - FX_BYTE bThis = *pThis; + uint8_t bThis = *pThis; if (bThis >= 'A' && bThis <= 'Z') { bThis += 'a' - 'A'; } - FX_BYTE bThat = *pThat; + uint8_t bThat = *pThat; if (bThat >= 'A' && bThat <= 'Z') { bThat += 'a' - 'A'; } @@ -645,7 +645,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList) case 'X': case 'o': if (nModifier & FORCE_INT64) { - va_arg(argList, FX_INT64); + va_arg(argList, int64_t); } else { va_arg(argList, int); } @@ -936,7 +936,7 @@ CFX_WideString CFX_ByteString::UTF8Decode() const { CFX_UTF8Decoder decoder; for (FX_STRSIZE i = 0; i < GetLength(); i ++) { - decoder.Input((FX_BYTE)m_pData->m_String[i]); + decoder.Input((uint8_t)m_pData->m_String[i]); } return decoder.GetResult(); } @@ -969,9 +969,9 @@ int CFX_ByteString::Compare(FX_BSTR str) const int that_len = str.GetLength(); int min_len = this_len < that_len ? this_len : that_len; for (int i = 0; i < min_len; i ++) { - if ((FX_BYTE)m_pData->m_String[i] < str.GetAt(i)) { + if ((uint8_t)m_pData->m_String[i] < str.GetAt(i)) { return -1; - } else if ((FX_BYTE)m_pData->m_String[i] > str.GetAt(i)) { + } else if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) { return 1; } } diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp index 06ba9413a5..7d45a43128 100644 --- a/core/src/fxcrt/fx_basic_buffer.cpp +++ b/core/src/fxcrt/fx_basic_buffer.cpp @@ -18,7 +18,7 @@ CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size) , m_DataSize(size) , m_AllocSize(size) { - m_pBuffer = FX_Alloc(FX_BYTE, size); + m_pBuffer = FX_Alloc(uint8_t, size); } CFX_BinaryBuf::~CFX_BinaryBuf() { @@ -84,9 +84,9 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size) new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step; FX_LPBYTE pNewBuffer = m_pBuffer; if (pNewBuffer) { - pNewBuffer = FX_Realloc(FX_BYTE, m_pBuffer, new_size); + pNewBuffer = FX_Realloc(uint8_t, m_pBuffer, new_size); } else { - pNewBuffer = FX_Alloc(FX_BYTE, new_size); + pNewBuffer = FX_Alloc(uint8_t, new_size); } m_pBuffer = pNewBuffer; m_AllocSize = new_size; @@ -126,7 +126,7 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE siz } m_DataSize += size; } -void CFX_BinaryBuf::AppendFill(FX_BYTE byte, FX_STRSIZE count) +void CFX_BinaryBuf::AppendFill(uint8_t byte, FX_STRSIZE count) { ExpandBuf(count); if (!m_pBuffer) { @@ -242,7 +242,7 @@ CFX_WideStringC CFX_WideTextBuf::GetWideString() const { return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR)); } -CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BYTE i) +CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (uint8_t i) { if (m_pStream) { m_pStream->WriteBlock(&i, 1); @@ -325,7 +325,7 @@ FX_BOOL CFX_ArchiveLoader::IsEOF() { return m_LoadingPos >= m_LoadingSize; } -CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_BYTE& i) +CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (uint8_t& i) { if (m_LoadingPos >= m_LoadingSize) { return *this; @@ -447,13 +447,13 @@ FX_BOOL IFX_BufferArchive::Flush() m_Length = 0; return bRet; } -FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size) +int32_t IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size) { if (!pBuf || size < 1) { return 0; } if (!m_pBuffer) { - m_pBuffer = FX_Alloc(FX_BYTE, m_BufSize); + m_pBuffer = FX_Alloc(uint8_t, m_BufSize); } FX_LPBYTE buffer = (FX_LPBYTE)pBuf; FX_STRSIZE temp_size = (FX_STRSIZE)size; @@ -469,19 +469,19 @@ FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size) temp_size -= buf_size; buffer += buf_size; } - return (FX_INT32)size; + return (int32_t)size; } -FX_INT32 IFX_BufferArchive::AppendByte(FX_BYTE byte) +int32_t IFX_BufferArchive::AppendByte(uint8_t byte) { return AppendBlock(&byte, 1); } -FX_INT32 IFX_BufferArchive::AppendDWord(FX_DWORD i) +int32_t IFX_BufferArchive::AppendDWord(FX_DWORD i) { char buf[32]; FXSYS_itoa(i, buf, 10); return AppendBlock(buf, (size_t)FXSYS_strlen(buf)); } -FX_INT32 IFX_BufferArchive::AppendString(FX_BSTR lpsz) +int32_t IFX_BufferArchive::AppendString(FX_BSTR lpsz) { return AppendBlock(lpsz.GetPtr(), lpsz.GetLength()); } diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp index 8e7bb3e751..496b1443d1 100644 --- a/core/src/fxcrt/fx_basic_coords.cpp +++ b/core/src/fxcrt/fx_basic_coords.cpp @@ -430,7 +430,7 @@ FX_FLOAT CFX_Matrix::TransformXDistance(FX_FLOAT dx) const FX_FLOAT fx = a * dx, fy = b * dx; return FXSYS_sqrt(fx * fx + fy * fy); } -FX_INT32 CFX_Matrix::TransformXDistance(FX_INT32 dx) const +int32_t CFX_Matrix::TransformXDistance(int32_t dx) const { FX_FLOAT fx = a * dx, fy = b * dx; return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy)); @@ -440,7 +440,7 @@ FX_FLOAT CFX_Matrix::TransformYDistance(FX_FLOAT dy) const FX_FLOAT fx = c * dy, fy = d * dy; return FXSYS_sqrt(fx * fx + fy * fy); } -FX_INT32 CFX_Matrix::TransformYDistance(FX_INT32 dy) const +int32_t CFX_Matrix::TransformYDistance(int32_t dy) const { FX_FLOAT fx = c * dy, fy = d * dy; return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy)); @@ -450,7 +450,7 @@ FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy; return FXSYS_sqrt(fx * fx + fy * fy); } -FX_INT32 CFX_Matrix::TransformDistance(FX_INT32 dx, FX_INT32 dy) const +int32_t CFX_Matrix::TransformDistance(int32_t dx, int32_t dy) const { FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy; return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy)); @@ -472,11 +472,11 @@ void CFX_Matrix::TransformVector(CFX_Vector &v) const v.x = FXSYS_round(fx); v.y = FXSYS_round(fy); } -void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const +void CFX_Matrix::TransformPoints(CFX_Point *points, int32_t iCount) const { FXSYS_assert(iCount > 0); FX_FLOAT fx, fy; - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { fx = a * points->x + c * points->y + e; fy = b * points->x + d * points->y + f; points->x = FXSYS_round(fx); @@ -484,11 +484,11 @@ void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const points ++; } } -void CFX_Matrix::TransformPoints(CFX_PointF *points, FX_INT32 iCount) const +void CFX_Matrix::TransformPoints(CFX_PointF *points, int32_t iCount) const { FXSYS_assert(iCount > 0); FX_FLOAT fx, fy; - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { fx = a * points->x + c * points->y + e; fy = b * points->x + d * points->y + f; points->x = fx, points->y = fy; @@ -501,7 +501,7 @@ void CFX_Matrix::TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const FX_FLOAT fy = b * x + d * y + f; x = fx, y = fy; } -void CFX_Matrix::TransformPoint(FX_INT32 &x, FX_INT32 &y) const +void CFX_Matrix::TransformPoint(int32_t &x, int32_t &y) const { FX_FLOAT fx = a * x + c * y + e; FX_FLOAT fy = b * x + d * y + f; diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp index 93c71ce660..caa99926a6 100644 --- a/core/src/fxcrt/fx_basic_gcc.cpp +++ b/core/src/fxcrt/fx_basic_gcc.cpp @@ -58,29 +58,29 @@ STR_T FXSYS_IntToStr(T value, STR_T string, int radix) #ifdef __cplusplus extern "C" { #endif -FX_INT32 FXSYS_atoi(FX_LPCSTR str) +int32_t FXSYS_atoi(FX_LPCSTR str) { - return FXSYS_StrToInt<FX_INT32, FX_LPCSTR>(str); + return FXSYS_StrToInt<int32_t, FX_LPCSTR>(str); } -FX_INT32 FXSYS_wtoi(FX_LPCWSTR str) +int32_t FXSYS_wtoi(FX_LPCWSTR str) { - return FXSYS_StrToInt<FX_INT32, FX_LPCWSTR>(str); + return FXSYS_StrToInt<int32_t, FX_LPCWSTR>(str); } -FX_INT64 FXSYS_atoi64(FX_LPCSTR str) +int64_t FXSYS_atoi64(FX_LPCSTR str) { - return FXSYS_StrToInt<FX_INT64, FX_LPCSTR>(str); + return FXSYS_StrToInt<int64_t, FX_LPCSTR>(str); } -FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str) +int64_t FXSYS_wtoi64(FX_LPCWSTR str) { - return FXSYS_StrToInt<FX_INT64, FX_LPCWSTR>(str); + return FXSYS_StrToInt<int64_t, FX_LPCWSTR>(str); } -FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix) +FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix) { - return FXSYS_IntToStr<FX_INT64, FX_LPSTR>(value, str, radix); + return FXSYS_IntToStr<int64_t, FX_LPSTR>(value, str, radix); } -FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix) +FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix) { - return FXSYS_IntToStr<FX_INT64, FX_LPWSTR>(value, str, radix); + return FXSYS_IntToStr<int64_t, FX_LPWSTR>(value, str, radix); } #ifdef __cplusplus } @@ -194,7 +194,7 @@ int FXSYS_wcsicmp(const FX_WCHAR *dst, const FX_WCHAR *src) } char* FXSYS_itoa(int value, char* string, int radix) { - return FXSYS_IntToStr<FX_INT32, FX_LPSTR>(value, string, radix); + return FXSYS_IntToStr<int32_t, FX_LPSTR>(value, string, radix); } #ifdef __cplusplus } diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp index 7fca42acde..c0c394583e 100644 --- a/core/src/fxcrt/fx_basic_maps.cpp +++ b/core/src/fxcrt/fx_basic_maps.cpp @@ -42,7 +42,7 @@ CFX_MapPtrToPtr::~CFX_MapPtrToPtr() } FX_DWORD CFX_MapPtrToPtr::HashKey(void* key) const { - return ((FX_DWORD)(FX_UINTPTR)key) >> 4; + return ((FX_DWORD)(uintptr_t)key) >> 4; } void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const { @@ -377,10 +377,10 @@ FX_BOOL CFX_MapByteStringToPtr::RemoveKey(FX_BSTR key) return FALSE; } struct _CompactString { - FX_BYTE m_CompactLen; - FX_BYTE m_LenHigh; - FX_BYTE m_LenLow; - FX_BYTE m_Unused; + uint8_t m_CompactLen; + uint8_t m_LenHigh; + uint8_t m_LenLow; + uint8_t m_Unused; FX_LPBYTE m_pBuffer; }; static void _CompactStringRelease(_CompactString* pCompact) @@ -405,14 +405,14 @@ static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int static void _CompactStringStore(_CompactString* pCompact, FX_LPCBYTE pStr, int len) { if (len < (int)sizeof(_CompactString)) { - pCompact->m_CompactLen = (FX_BYTE)len; + pCompact->m_CompactLen = (uint8_t)len; FXSYS_memcpy32(&pCompact->m_LenHigh, pStr, len); return; } pCompact->m_CompactLen = 0xff; pCompact->m_LenHigh = len / 256; pCompact->m_LenLow = len % 256; - pCompact->m_pBuffer = FX_Alloc(FX_BYTE, len); + pCompact->m_pBuffer = FX_Alloc(uint8_t, len); FXSYS_memcpy32(pCompact->m_pBuffer, pStr, len); } static CFX_ByteStringC _CompactStringGet(_CompactString* pCompact) @@ -449,7 +449,7 @@ FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition() const for (int i = 0; i < size; i ++) { _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i); if (pKey->m_CompactLen != 0xfe) { - return (FX_POSITION)(FX_UINTPTR)(i + 1); + return (FX_POSITION)(uintptr_t)(i + 1); } } return NULL; @@ -459,7 +459,7 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteS if (rNextPosition == NULL) { return; } - int index = (int)(FX_UINTPTR)rNextPosition - 1; + int index = (int)(uintptr_t)rNextPosition - 1; _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index); rKey = _CompactStringGet(pKey); rValue = *(void**)(pKey + 1); @@ -468,7 +468,7 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteS while (index < size) { pKey = (_CompactString*)m_Buffer.GetAt(index); if (pKey->m_CompactLen != 0xfe) { - rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1); + rNextPosition = (FX_POSITION)(uintptr_t)(index + 1); return; } index ++; @@ -480,7 +480,7 @@ FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) cons if (rNextPosition == NULL) { return NULL; } - int index = (int)(FX_UINTPTR)rNextPosition - 1; + int index = (int)(uintptr_t)rNextPosition - 1; _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index); FX_LPVOID rValue = *(void**)(pKey + 1); index ++; @@ -488,7 +488,7 @@ FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) cons while (index < size) { pKey = (_CompactString*)m_Buffer.GetAt(index); if (pKey->m_CompactLen != 0xfe) { - rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1); + rNextPosition = (FX_POSITION)(uintptr_t)(index + 1); return rValue; } index ++; @@ -601,7 +601,7 @@ void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWOR if (pos == 0) { return; } - FX_DWORD index = ((FX_DWORD)(FX_UINTPTR)pos) - 1; + FX_DWORD index = ((FX_DWORD)(uintptr_t)pos) - 1; FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair); _DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer(); key = buf[index].key; @@ -609,7 +609,7 @@ void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWOR if (index == count - 1) { pos = 0; } else { - pos = (FX_POSITION)((FX_UINTPTR)pos + 1); + pos = (FX_POSITION)((uintptr_t)pos + 1); } } void CFX_CMapDWordToDWord::SetAt(FX_DWORD key, FX_DWORD value) diff --git a/core/src/fxcrt/fx_basic_memmgr.cpp b/core/src/fxcrt/fx_basic_memmgr.cpp index 63c609daec..a381fa4ef5 100644 --- a/core/src/fxcrt/fx_basic_memmgr.cpp +++ b/core/src/fxcrt/fx_basic_memmgr.cpp @@ -63,7 +63,7 @@ void* CFX_GrowOnlyPool::Alloc(size_t size) pTrunk = pTrunk->m_pNext; } size_t alloc_size = size > m_TrunkSize ? size : m_TrunkSize; - pTrunk = (_FX_GrowOnlyTrunk*)FX_Alloc(FX_BYTE, sizeof(_FX_GrowOnlyTrunk) + alloc_size); + pTrunk = (_FX_GrowOnlyTrunk*)FX_Alloc(uint8_t, sizeof(_FX_GrowOnlyTrunk) + alloc_size); pTrunk->m_Size = alloc_size; pTrunk->m_Allocated = size; pTrunk->m_pNext = (_FX_GrowOnlyTrunk*)m_pFirstTrunk; diff --git a/core/src/fxcrt/fx_basic_plex.cpp b/core/src/fxcrt/fx_basic_plex.cpp index 78319bd5da..802429600a 100644 --- a/core/src/fxcrt/fx_basic_plex.cpp +++ b/core/src/fxcrt/fx_basic_plex.cpp @@ -8,7 +8,7 @@ #include "plex.h" CFX_Plex* CFX_Plex::Create(CFX_Plex*& pHead, FX_DWORD nMax, FX_DWORD cbElement) { - CFX_Plex* p = (CFX_Plex*)FX_Alloc(FX_BYTE, sizeof(CFX_Plex) + nMax * cbElement); + CFX_Plex* p = (CFX_Plex*)FX_Alloc(uint8_t, sizeof(CFX_Plex) + nMax * cbElement); p->pNext = pHead; pHead = p; return p; @@ -17,7 +17,7 @@ void CFX_Plex::FreeDataChain() { CFX_Plex* p = this; while (p != NULL) { - FX_BYTE* bytes = (FX_BYTE*)p; + uint8_t* bytes = (uint8_t*)p; CFX_Plex* pNext = p->pNext; FX_Free(bytes); p = pNext; diff --git a/core/src/fxcrt/fx_basic_utf.cpp b/core/src/fxcrt/fx_basic_utf.cpp index f52b83efda..1422b7abd4 100644 --- a/core/src/fxcrt/fx_basic_utf.cpp +++ b/core/src/fxcrt/fx_basic_utf.cpp @@ -14,7 +14,7 @@ void CFX_UTF8Decoder::AppendChar(FX_DWORD ch) { m_Buffer.AppendChar((FX_WCHAR)ch); } -void CFX_UTF8Decoder::Input(FX_BYTE byte) +void CFX_UTF8Decoder::Input(uint8_t byte) { if (byte < 0x80) { m_PendingBytes = 0; @@ -65,7 +65,7 @@ void CFX_UTF8Encoder::Input(FX_WCHAR unicode) } else { nbytes = 6; } - static FX_BYTE prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; + static uint8_t prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; int order = 1 << ((nbytes - 1) * 6); int code = unicode; m_Buffer.AppendChar(prefix[nbytes - 2] | (code / order)); diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp index be736f1b21..615b297421 100644 --- a/core/src/fxcrt/fx_basic_util.cpp +++ b/core/src/fxcrt/fx_basic_util.cpp @@ -187,22 +187,22 @@ void FXSYS_vsnprintf(char *str, size_t size, const char* fmt, va_list ap) } #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 -static FX_BOOL FX_IsDigit(FX_BYTE ch) +static FX_BOOL FX_IsDigit(uint8_t ch) { return (ch >= '0' && ch <= '9') ? TRUE : FALSE; } -static FX_BOOL FX_IsXDigit(FX_BYTE ch) +static FX_BOOL FX_IsXDigit(uint8_t ch) { return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? TRUE : FALSE; } -static FX_BYTE FX_MakeUpper(FX_BYTE ch) +static uint8_t FX_MakeUpper(uint8_t ch) { if (ch < 'a' || ch > 'z') { return ch; } return ch - 32; } -static int FX_HexToI(FX_BYTE ch) +static int FX_HexToI(uint8_t ch) { ch = FX_MakeUpper(ch); return FX_IsDigit(ch) ? (ch - '0') : (ch - 55); @@ -237,7 +237,7 @@ CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl) int nByte = bsUri.GetLength(); for (int j = 0; j < nByte; j++) { rUrl += '%'; - FX_BYTE code = bsUri.GetAt(j); + uint8_t code = bsUri.GetAt(j); rUrl += arDigits[code >> 4]; rUrl += arDigits[code & 0x0F]; } @@ -268,7 +268,7 @@ CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI) CFX_ByteString bsUri = wsURI.UTF8Encode(); int nLength = bsUri.GetLength(); for (int i = 0; i < nLength; i++) { - FX_BYTE code = bsUri.GetAt(i); + uint8_t code = bsUri.GetAt(i); if (code > 0x7F || url_encodeTable[code] == 1) { rURI += '%'; rURI += arDigits[code >> 4]; diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index 09e64e0c72..aeb366338e 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -33,7 +33,7 @@ CFX_WideString::StringData* CFX_WideString::StringData::Create(int nLen) int usableLen = (totalSize - overhead) / sizeof(FX_WCHAR); FXSYS_assert(usableLen >= nLen); - void* pData = FX_Alloc(FX_BYTE, iSize.ValueOrDie()); + void* pData = FX_Alloc(uint8_t, iSize.ValueOrDie()); return new (pData) StringData(nLen, usableLen); } CFX_WideString::~CFX_WideString() @@ -911,7 +911,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList) case 'X': case 'o': if (nModifier & FORCE_INT64) { - va_arg(argList, FX_INT64); + va_arg(argList, int64_t); } else { va_arg(argList, int); } @@ -1068,7 +1068,7 @@ static const CFX_CharMap g_DefaultGBKMapper = {&_DefMap_GetWideString, &_DefMap_ static const CFX_CharMap g_DefaultJISMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetJISCodePage}; static const CFX_CharMap g_DefaultUHCMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetUHCCodePage}; static const CFX_CharMap g_DefaultBig5Mapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetBig5CodePage}; -CFX_CharMap* CFX_CharMap::GetDefaultMapper(FX_INT32 codepage) +CFX_CharMap* CFX_CharMap::GetDefaultMapper(int32_t codepage) { switch (codepage) { case 0: diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp index 876cf47548..9490f3603c 100644 --- a/core/src/fxcrt/fx_extension.cpp +++ b/core/src/fxcrt/fx_extension.cpp @@ -151,25 +151,25 @@ FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) { return FXSYS_log(x) / FXSYS_log(b); } -FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) +FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength, int32_t *pUsedLen) { FXSYS_assert(pcsStr != NULL); if (iLength < 0) { - iLength = (FX_INT32)FXSYS_strlen(pcsStr); + iLength = (int32_t)FXSYS_strlen(pcsStr); } CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen); } -FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) +FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength, int32_t *pUsedLen) { FXSYS_assert(pwsStr != NULL); if (iLength < 0) { - iLength = (FX_INT32)FXSYS_wcslen(pwsStr); + iLength = (int32_t)FXSYS_wcslen(pwsStr); } if (iLength == 0) { return 0.0f; } - FX_INT32 iUsedLen = 0; + int32_t iUsedLen = 0; FX_BOOL bNegtive = FALSE; switch (pwsStr[iUsedLen]) { case '-': @@ -214,7 +214,7 @@ FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count) } return dstStr; } -FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) +int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) { FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); FX_WCHAR wch1 = 0, wch2 = 0; @@ -227,7 +227,7 @@ FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) } return wch1 - wch2; } -FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) +int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) { FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); FX_CHAR ch1 = 0, ch2 = 0; @@ -240,11 +240,11 @@ FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) } return ch1 - ch2; } -FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase) +FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase) { FXSYS_assert(pStr != NULL); if (iLength < 0) { - iLength = (FX_INT32)FXSYS_strlen(pStr); + iLength = (int32_t)FXSYS_strlen(pStr); } FX_LPCSTR pStrEnd = pStr + iLength; FX_DWORD dwHashCode = 0; @@ -259,11 +259,11 @@ FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgno } return dwHashCode; } -FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase) +FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase) { FXSYS_assert(pStr != NULL); if (iLength < 0) { - iLength = (FX_INT32)FXSYS_wcslen(pStr); + iLength = (int32_t)FXSYS_wcslen(pStr); } FX_LPCWSTR pStrEnd = pStr + iLength; FX_DWORD dwHashCode = 0; @@ -333,7 +333,7 @@ void FX_Random_MT_Close(FX_LPVOID pContext) FXSYS_assert(pContext != NULL); FX_Free(pContext); } -void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount) +void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount) { FX_DWORD dwSeed; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ @@ -349,7 +349,7 @@ void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount) } FX_Random_MT_Close(pContext); } -void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount) +void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ SYSTEMTIME st1, st2; @@ -370,7 +370,7 @@ void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount) } } #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount) +FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount) { HCRYPTPROV hCP = NULL; if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) { @@ -381,7 +381,7 @@ FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount) return TRUE; } #endif -void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount) +void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ FX_GenerateCryptoRandom(pBuffer, iCount); @@ -408,15 +408,15 @@ void FX_GUID_CreateV4(FX_LPGUID pGUID) #else
FX_Random_GenerateMT((FX_LPDWORD)pGUID, 4);
#endif
- FX_BYTE &b = ((FX_LPBYTE)pGUID)[6];
+ uint8_t &b = ((FX_LPBYTE)pGUID)[6];
b = (b & 0x0F) | 0x40;
}
FX_LPCSTR gs_FX_pHexChars = "0123456789ABCDEF";
void FX_GUID_ToString(FX_LPCGUID pGUID, CFX_ByteString &bsStr, FX_BOOL bSeparator)
{
FX_LPSTR pBuf = bsStr.GetBuffer(40);
- FX_BYTE b;
- for (FX_INT32 i = 0; i < 16; i ++) {
+ uint8_t b;
+ for (int32_t i = 0; i < 16; i ++) {
b = ((FX_LPCBYTE)pGUID)[i];
*pBuf ++ = gs_FX_pHexChars[b >> 4];
*pBuf ++ = gs_FX_pHexChars[b & 0x0F];
diff --git a/core/src/fxcrt/fx_unicode.cpp b/core/src/fxcrt/fx_unicode.cpp index aac6142ce4..0117c1ffc5 100644 --- a/core/src/fxcrt/fx_unicode.cpp +++ b/core/src/fxcrt/fx_unicode.cpp @@ -29,7 +29,7 @@ FX_BOOL FX_IsCombinationChar(FX_WCHAR wch) FX_BOOL FX_IsBidiChar(FX_WCHAR wch) { FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch]; - FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; + int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; return (FX_BIDICLASS_R == iBidiCls || FX_BIDICLASS_AL == iBidiCls); } FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical) diff --git a/core/src/fxcrt/fx_xml_composer.cpp b/core/src/fxcrt/fx_xml_composer.cpp index 97c5dfd130..7858290f9a 100644 --- a/core/src/fxcrt/fx_xml_composer.cpp +++ b/core/src/fxcrt/fx_xml_composer.cpp @@ -11,7 +11,7 @@ void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX if (bsFullName.IsEmpty()) { return; } - FX_INT32 iStart = 0; + int32_t iStart = 0; for (; iStart < bsFullName.GetLength(); iStart ++) { if (bsFullName.GetAt(iStart) == ':') { break; diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp index 8049a5587e..040fefab63 100644 --- a/core/src/fxcrt/fx_xml_parser.cpp +++ b/core/src/fxcrt/fx_xml_parser.cpp @@ -70,7 +70,7 @@ FX_BOOL CXML_Parser::IsEOF() #define FXCRTM_XML_CHARTYPE_HexLowerLetter 0x40 #define FXCRTM_XML_CHARTYPE_HexUpperLetter 0x60 #define FXCRTM_XML_CHARTYPE_HexChar 0x60 -FX_BYTE g_FXCRT_XML_ByteTypes[256] = { +uint8_t g_FXCRT_XML_ByteTypes[256] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, @@ -88,27 +88,27 @@ FX_BYTE g_FXCRT_XML_ByteTypes[256] = { 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x01, 0x01, }; -FX_BOOL g_FXCRT_XML_IsWhiteSpace(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsWhiteSpace(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_SpaceChar) != 0; } -FX_BOOL g_FXCRT_XML_IsLetter(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsLetter(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Letter) != 0; } -FX_BOOL g_FXCRT_XML_IsDigital(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsDigital(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Digital) != 0; } -FX_BOOL g_FXCRT_XML_IsNameIntro(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsNameIntro(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameIntro) != 0; } -FX_BOOL g_FXCRT_XML_IsNameChar(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsNameChar(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar) != 0; } -FX_BOOL g_FXCRT_XML_IsHexChar(FX_BYTE ch) +FX_BOOL g_FXCRT_XML_IsHexChar(uint8_t ch) { return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar) != 0; } @@ -135,7 +135,7 @@ void CXML_Parser::GetName(CFX_ByteString &space, CFX_ByteString &name) return; } CFX_ByteTextBuf buf; - FX_BYTE ch; + uint8_t ch; do { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex]; @@ -162,7 +162,7 @@ void CXML_Parser::SkipLiterals(FX_BSTR str) if (IsEOF()) { return; } - FX_INT32 i = 0, iLen = str.GetLength(); + int32_t i = 0, iLen = str.GetLength(); do { while (m_dwIndex < m_dwBufferSize) { if (str.GetAt(i) != m_pBuffer[m_dwIndex ++]) { @@ -194,8 +194,8 @@ FX_DWORD CXML_Parser::GetCharRef() if (IsEOF()) { return 0; } - FX_BYTE ch; - FX_INT32 iState = 0; + uint8_t ch; + int32_t iState = 0; CFX_ByteTextBuf buf; FX_DWORD code = 0; do { @@ -252,7 +252,7 @@ FX_DWORD CXML_Parser::GetCharRef() iState = 10; break; } - FX_BYTE nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar; + uint8_t nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar; if (nHex) { if (nHex == FXCRTM_XML_CHARTYPE_HexDigital) { code = (code << 4) + ch - '0'; @@ -282,7 +282,7 @@ void CXML_Parser::GetAttrValue(CFX_WideString &value) return; } CFX_UTF8Decoder decoder; - FX_BYTE mark = 0, ch = 0; + uint8_t mark = 0, ch = 0; do { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex]; @@ -323,8 +323,8 @@ void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOO return; } bEndTag = FALSE; - FX_BYTE ch; - FX_INT32 iState = bStartTag ? 1 : 0; + uint8_t ch; + int32_t iState = bStartTag ? 1 : 0; do { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex]; @@ -422,7 +422,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag if (IsEOF()) { return pElement; } - FX_BYTE ch = m_pBuffer[m_dwIndex ++]; + uint8_t ch = m_pBuffer[m_dwIndex ++]; if (ch == '/') { m_dwIndex ++; m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex; @@ -440,7 +440,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag CFX_UTF8Decoder decoder; CFX_WideTextBuf content; FX_BOOL bCDATA = FALSE; - FX_INT32 iState = 0; + int32_t iState = 0; do { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex ++]; @@ -604,7 +604,7 @@ void CXML_Element::Empty() void CXML_Element::RemoveChildren() { for (int i = 0; i < m_Children.GetSize(); i += 2) { - ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i); + ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i); if (type == Content) { CXML_Content* content = (CXML_Content*)m_Children.GetAt(i + 1); delete content; @@ -726,13 +726,13 @@ CXML_Element::ChildType CXML_Element::GetChildType(FX_DWORD index) const if (index >= (FX_DWORD)m_Children.GetSize()) { return Invalid; } - return (ChildType)(FX_UINTPTR)m_Children.GetAt(index); + return (ChildType)(uintptr_t)m_Children.GetAt(index); } CFX_WideString CXML_Element::GetContent(FX_DWORD index) const { index <<= 1; if (index >= (FX_DWORD)m_Children.GetSize() || - (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) { + (ChildType)(uintptr_t)m_Children.GetAt(index) != Content) { return CFX_WideString(); } CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1); @@ -745,7 +745,7 @@ CXML_Element* CXML_Element::GetElement(FX_DWORD index) const { index <<= 1; if (index >= (FX_DWORD)m_Children.GetSize() || - (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Element) { + (ChildType)(uintptr_t)m_Children.GetAt(index) != Element) { return NULL; } return (CXML_Element*)m_Children.GetAt(index + 1); @@ -754,7 +754,7 @@ FX_DWORD CXML_Element::CountElements(FX_BSTR space, FX_BSTR tag) const { int count = 0; for (int i = 0; i < m_Children.GetSize(); i += 2) { - ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i); + ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i); if (type != Element) { continue; } @@ -771,7 +771,7 @@ CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) co return NULL; } for (int i = 0; i < m_Children.GetSize(); i += 2) { - ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i); + ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i); if (type != Element) { continue; } @@ -788,7 +788,7 @@ CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) co FX_DWORD CXML_Element::FindElement(CXML_Element *pChild) const { for (int i = 0; i < m_Children.GetSize(); i += 2) { - if ((ChildType)(FX_UINTPTR)m_Children.GetAt(i) == Element && + if ((ChildType)(uintptr_t)m_Children.GetAt(i) == Element && (CXML_Element*)m_Children.GetAt(i + 1) == pChild) { return (FX_DWORD)(i >> 1); } diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp index 0781ba436c..74affbe4b9 100644 --- a/core/src/fxcrt/fxcrt_platforms.cpp +++ b/core/src/fxcrt/fxcrt_platforms.cpp @@ -168,7 +168,7 @@ FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) return FALSE; } FX_FILESIZE num = 0; - FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768); + FX_LPBYTE pBuffer = FX_Alloc(uint8_t, 32768); while (num = src.Read(pBuffer, 32768)) { if (dst.Write(pBuffer, num) != num) { break; diff --git a/core/src/fxcrt/fxcrt_posix.cpp b/core/src/fxcrt/fxcrt_posix.cpp index 5bc2dd44d2..701c910551 100644 --- a/core/src/fxcrt/fxcrt_posix.cpp +++ b/core/src/fxcrt/fxcrt_posix.cpp @@ -11,7 +11,7 @@ IFXCRT_FileAccess* FXCRT_FileAccess_Create() { return FX_NEW CFXCRT_FileAccess_Posix; } -void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMasks) +void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, int32_t &nFlags, int32_t &nMasks) { nFlags = O_BINARY | O_LARGEFILE; if (dwModes & FX_FILEMODE_ReadOnly) { @@ -38,7 +38,7 @@ FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_BSTR fileName, FX_DWORD dwMode) if (m_nFD > -1) { return FALSE; } - FX_INT32 nFlags, nMasks; + int32_t nFlags, nMasks; FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks); m_nFD = open(fileName.GetCStr(), nFlags, nMasks); return m_nFD > -1; @@ -164,7 +164,7 @@ FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst) return FALSE; } size_t num = 0; - FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768); + FX_LPBYTE pBuffer = FX_Alloc(uint8_t, 32768); num = src.Read(pBuffer, 32768); while (num) { if (dst.Write(pBuffer, num) != num) { diff --git a/core/src/fxcrt/fxcrt_posix.h b/core/src/fxcrt/fxcrt_posix.h index 8c716cd6d6..0b4509ec73 100644 --- a/core/src/fxcrt/fxcrt_posix.h +++ b/core/src/fxcrt/fxcrt_posix.h @@ -29,7 +29,7 @@ public: virtual FX_BOOL Flush(); virtual FX_BOOL Truncate(FX_FILESIZE szFile); protected: - FX_INT32 m_nFD; + int32_t m_nFD; }; #endif diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h index 7cfeec95f7..4155a39ffa 100644 --- a/core/src/fxcrt/xml_int.h +++ b/core/src/fxcrt/xml_int.h @@ -107,7 +107,7 @@ public: } m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart); if (!m_pBuffer) { - m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize); + m_pBuffer = FX_Alloc(uint8_t, m_dwSize); } return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize); } diff --git a/core/src/fxge/agg/agg23/fx_agg_driver.cpp b/core/src/fxge/agg/agg23/fx_agg_driver.cpp index 5944332fd8..978756cd64 100644 --- a/core/src/fxge/agg/agg23/fx_agg_driver.cpp +++ b/core/src/fxge/agg/agg23/fx_agg_driver.cpp @@ -411,7 +411,7 @@ public: } else { src_alpha = m_Alpha; } - FX_BYTE dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255; + uint8_t dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (m_bFullCover) { @@ -485,7 +485,7 @@ public: dest_scan += 2; continue; } - FX_BYTE cover = cover_scan[col]; + uint8_t cover = cover_scan[col]; dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], src_alpha, cover); *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover); dest_scan ++; @@ -544,7 +544,7 @@ public: } else { int index = 0; if (m_pDevice->GetPalette() == NULL) { - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; } else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) { @@ -582,7 +582,7 @@ public: dest_scan += col_start / 8; int index = 0; if (m_pDevice->GetPalette() == NULL) { - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; } else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) { @@ -637,7 +637,7 @@ public: *dest_scan = m_Gray; *dest_extra_alpha_scan = m_Alpha; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -696,7 +696,7 @@ public: if (src_alpha == 255) { *(FX_DWORD*)dest_scan = m_Color; } else { - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_ratio); @@ -739,7 +739,7 @@ public: dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -812,13 +812,13 @@ public: } if (src_alpha) { if (src_alpha == 255) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; - *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; + *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; continue; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -902,9 +902,9 @@ public: if (src_alpha) { if (src_alpha == 255) { *(FX_CMYK*)dest_scan = m_Color; - *dest_extra_alpha_scan = (FX_BYTE)m_Alpha; + *dest_extra_alpha_scan = (uint8_t)m_Alpha; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -1038,13 +1038,13 @@ public: m_Gray = 255; } else { if (pIccTransform) { - FX_BYTE gray; + uint8_t gray; color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); pIccModule->TranslateScanline(pIccTransform, &gray, (FX_LPCBYTE)&color, 1); m_Gray = gray; } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Gray = FXRGB2GRAY(r, g, b); @@ -1089,7 +1089,7 @@ public: } } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Color = FXARGB_MAKE(m_Alpha, r, g, b); @@ -1201,7 +1201,7 @@ void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb) if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) { return; } - FX_LPBYTE pos = (FX_BYTE*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8; + FX_LPBYTE pos = (uint8_t*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8; if (pBitmap->GetFormat() == FXDIB_Argb) { FXARGB_SETRGBORDERDIB(pos, ArgbGamma(argb)); } else { @@ -1224,7 +1224,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid int Bpp = pBitmap->GetBPP() / 8; FX_BOOL bAlpha = pBitmap->HasAlpha(); int dib_argb = FXARGB_TOBGRORDERDIB(argb); - FX_BYTE* pBuffer = pBitmap->GetBuffer(); + uint8_t* pBuffer = pBitmap->GetBuffer(); if (src_alpha == 255) { for (int row = rect.top; row < rect.bottom; row ++) { FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp; @@ -1250,13 +1250,13 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp; if (bAlpha) { for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio); @@ -1295,7 +1295,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t FXDIB_Format dest_format = pBitmap->GetFormat(); FXDIB_Format src_format = pSrcBitmap->GetFormat(); int pitch = pBitmap->GetPitch(); - FX_BYTE* buffer = pBitmap->GetBuffer(); + uint8_t* buffer = pBitmap->GetBuffer(); if (dest_format == src_format) { for (int row = 0; row < height; row ++) { FX_LPBYTE dest_scan = buffer + (dest_top + row) * pitch + dest_left * Bpp; @@ -1322,7 +1322,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t if (src_format == FXDIB_Rgb32) { for (int row = 0; row < height; row ++) { FX_LPBYTE dest_scan = dest_buf + row * pitch; - FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4; + FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4; for (int col = 0; col < width; col ++) { *dest_scan++ = src_scan[2]; *dest_scan++ = src_scan[1]; @@ -1336,8 +1336,8 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t } else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) { if (src_format == FXDIB_Rgb) { for (int row = 0; row < height; row ++) { - FX_BYTE* dest_scan = (FX_BYTE*)(dest_buf + row * pitch); - FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3; + uint8_t* dest_scan = (uint8_t*)(dest_buf + row * pitch); + FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3; if (src_format == FXDIB_Argb) { for (int col = 0; col < width; col ++) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, FX_GAMMA(src_scan[0]), FX_GAMMA(src_scan[1]), FX_GAMMA(src_scan[2]))); @@ -1368,9 +1368,9 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t ASSERT(FALSE); } } -FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, FX_BYTE alpha) +FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk), r, g, b); return ArgbEncode(alpha, r, g, b); diff --git a/core/src/fxge/android/fpf_skiafont.cpp b/core/src/fxge/android/fpf_skiafont.cpp index 97eeb2f683..290d989851 100644 --- a/core/src/fxge/android/fpf_skiafont.cpp +++ b/core/src/fxge/android/fpf_skiafont.cpp @@ -53,7 +53,7 @@ CFX_WideString CFPF_SkiaFont::GetPsName() } return CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face)); } -FX_INT32 CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode) +int32_t CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode) { if (!m_Face) { return wUnicode; @@ -63,7 +63,7 @@ FX_INT32 CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode) } return FXFT_Get_Char_Index(m_Face, wUnicode); } -FX_INT32 CFPF_SkiaFont::GetGlyphWidth(FX_INT32 iGlyphIndex) +int32_t CFPF_SkiaFont::GetGlyphWidth(int32_t iGlyphIndex) { if (!m_Face) { return 0; @@ -73,21 +73,21 @@ FX_INT32 CFPF_SkiaFont::GetGlyphWidth(FX_INT32 iGlyphIndex) } return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriAdvance(m_Face)); } -FX_INT32 CFPF_SkiaFont::GetAscent() const +int32_t CFPF_SkiaFont::GetAscent() const { if (!m_Face) { return 0; } return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Ascender(m_Face)); } -FX_INT32 CFPF_SkiaFont::GetDescent() const +int32_t CFPF_SkiaFont::GetDescent() const { if (!m_Face) { return 0; } return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face)); } -FX_BOOL CFPF_SkiaFont::GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox) +FX_BOOL CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) { if (!m_Face) { return FALSE; @@ -107,8 +107,8 @@ FX_BOOL CFPF_SkiaFont::GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox) } FXFT_BBox cbox; FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox); - FX_INT32 x_ppem = m_Face->size->metrics.x_ppem; - FX_INT32 y_ppem = m_Face->size->metrics.y_ppem; + int32_t x_ppem = m_Face->size->metrics.x_ppem; + int32_t y_ppem = m_Face->size->metrics.y_ppem; rtBBox.left = FPF_EM_ADJUST(x_ppem, cbox.xMin); rtBBox.right = FPF_EM_ADJUST(x_ppem, cbox.xMax); rtBBox.top = FPF_EM_ADJUST(y_ppem, cbox.yMax); @@ -138,14 +138,14 @@ FX_BOOL CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox) rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMax(m_Face)); return TRUE; } -FX_INT32 CFPF_SkiaFont::GetHeight() const +int32_t CFPF_SkiaFont::GetHeight() const { if (!m_Face) { return 0; } return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Height(m_Face)); } -FX_INT32 CFPF_SkiaFont::GetItalicAngle() const +int32_t CFPF_SkiaFont::GetItalicAngle() const { if (!m_Face) { return 0; @@ -166,7 +166,7 @@ FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWOR } return dwSize; } -FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset) +FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset) { if (!pFontMgr || !pFontDes) { return FALSE; diff --git a/core/src/fxge/android/fpf_skiafont.h b/core/src/fxge/android/fpf_skiafont.h index 135c830c95..72b569fe2e 100644 --- a/core/src/fxge/android/fpf_skiafont.h +++ b/core/src/fxge/android/fpf_skiafont.h @@ -28,30 +28,30 @@ public: { return m_dwStyle; } - virtual FX_BYTE GetCharset() const + virtual uint8_t GetCharset() const { return m_uCharset; } - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode); - virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex); + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode); + virtual int32_t GetGlyphWidth(int32_t iGlyphIndex); - virtual FX_INT32 GetAscent() const; - virtual FX_INT32 GetDescent() const; + virtual int32_t GetAscent() const; + virtual int32_t GetDescent() const; - virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox); + virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox); virtual FX_BOOL GetBBox(FX_RECT &rtBBox); - virtual FX_INT32 GetHeight() const; - virtual FX_INT32 GetItalicAngle() const; + virtual int32_t GetHeight() const; + virtual int32_t GetItalicAngle() const; virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize); - FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset); + FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset); protected: CFPF_SkiaFontMgr *m_pFontMgr; CFPF_SkiaFontDescriptor *m_pFontDes; FXFT_Face m_Face; FX_DWORD m_dwStyle; - FX_BYTE m_uCharset; + uint8_t m_uCharset; FX_DWORD m_dwRefCount; }; #endif diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp index a9bef8a2b8..6b27f073e5 100644 --- a/core/src/fxge/android/fpf_skiafontmgr.cpp +++ b/core/src/fxge/android/fpf_skiafontmgr.cpp @@ -64,10 +64,10 @@ static const FPF_SKIAFONTMAP g_SkiaFontmap[] = { }; FX_DWORD FPF_SkiaGetSubstFont(FX_DWORD dwHash) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP); + int32_t iStart = 0; + int32_t iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP); while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FPF_LPCSKIAFONTMAP pItem = &g_SkiaFontmap[iMid]; if (dwHash < pItem->dwFamily) { iEnd = iMid - 1; @@ -88,10 +88,10 @@ static const FPF_SKIAFONTMAP g_SkiaSansFontMap[] = { }; FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP); + int32_t iStart = 0; + int32_t iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP); while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FPF_LPCSKIAFONTMAP pItem = &g_SkiaSansFontMap[iMid]; if (dwHash < pItem->dwFamily) { iEnd = iMid - 1; @@ -103,7 +103,7 @@ FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash) } return 0; } -static FX_UINT32 FPF_GetHashCode_StringA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE) +static uint32_t FPF_GetHashCode_StringA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE) { if (!pStr) { return 0; @@ -112,7 +112,7 @@ static FX_UINT32 FPF_GetHashCode_StringA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BO iLength = FXSYS_strlen(pStr); } FX_LPCSTR pStrEnd = pStr + iLength; - FX_UINT32 uHashCode = 0; + uint32_t uHashCode = 0; if (bIgnoreCase) { while (pStr < pStrEnd) { uHashCode = 31 * uHashCode + FXSYS_tolower(*pStr++); @@ -145,7 +145,7 @@ enum FPF_SKIACHARSET { FPF_SKIACHARSET_PC = 1 << 17, FPF_SKIACHARSET_OEM = 1 << 18, }; -static FX_DWORD FPF_SkiaGetCharset(FX_BYTE uCharset) +static FX_DWORD FPF_SkiaGetCharset(uint8_t uCharset) { switch (uCharset) { case FXFONT_ANSI_CHARSET: @@ -184,9 +184,9 @@ static FX_DWORD FPF_SkiaGetCharset(FX_BYTE uCharset) static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily) { FX_DWORD dwHash = 0; - FX_INT32 iLength = bsfamily.GetLength(); + int32_t iLength = bsfamily.GetLength(); FX_LPCSTR pBuffer = bsfamily.GetCStr(); - for (FX_INT32 i = 0; i < iLength; i++) { + for (int32_t i = 0; i < iLength; i++) { FX_CHAR ch = pBuffer[i]; if (ch == ' ' || ch == '-' || ch == ',') { continue; @@ -195,7 +195,7 @@ static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily) } return dwHash; } -static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset) +static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset) { CFX_ByteString bsFont(bsFamily); if (dwStyle & FXFONT_BOLD) { @@ -210,7 +210,7 @@ static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYT bsFont += uCharset; return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE); } -static FX_BOOL FPF_SkiaIsCJK(FX_BYTE uCharset) +static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset) { return (uCharset == FXFONT_GB2312_CHARSET) || (uCharset == FXFONT_CHINESEBIG5_CHARSET) || (uCharset == FXFONT_HANGEUL_CHARSET) || (uCharset == FXFONT_SHIFTJIS_CHARSET); @@ -243,7 +243,7 @@ CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr() } } m_FamilyFonts.RemoveAll(); - for (FX_INT32 i = m_FontFaces.GetUpperBound(); i >= 0; i--) { + for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) { CFPF_SkiaFontDescriptor *pFont = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(i); if (pFont) { delete pFont; @@ -279,11 +279,11 @@ void CFPF_SkiaFontMgr::LoadPrivateFont(FX_BSTR bsFileName) void CFPF_SkiaFontMgr::LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer) { } -IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch) +IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, uint8_t uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch) { FX_DWORD dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset); IFPF_Font *pFont = NULL; - if (m_FamilyFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) { + if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { if (pFont) { return pFont->Retain(); } @@ -297,16 +297,16 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, } else if (uCharset == FXFONT_ANSI_CHARSET && (dwMatch & FPF_MATCHFONT_REPLACEANSI)) { uCharset = FXFONT_DEFAULT_CHARSET; } - FX_INT32 nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 + FPF_SKIAMATCHWEIGHT_2 * 2; - FX_INT32 nItem = -1; - FX_INT32 nMax = -1; - FX_INT32 nGlyphNum = 0; - for (FX_INT32 i = m_FontFaces.GetUpperBound(); i >= 0; i--) { + int32_t nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 + FPF_SKIAMATCHWEIGHT_2 * 2; + int32_t nItem = -1; + int32_t nMax = -1; + int32_t nGlyphNum = 0; + for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) { CFPF_SkiaPathFont *pFontDes = (CFPF_SkiaPathFont*)m_FontFaces.ElementAt(i); if(!(pFontDes->m_dwCharsets & FPF_SkiaGetCharset(uCharset))) { continue; } - FX_INT32 nFind = 0; + int32_t nFind = 0; FX_DWORD dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily); if (dwFaceName == dwSysFontName) { nFind += FPF_SKIAMATCHWEIGHT_NAME1; @@ -352,20 +352,27 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, } if (nItem > -1) { CFPF_SkiaFontDescriptor *pFontDes = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(nItem); +<<<<<<< HEAD CFPF_SkiaFont *pFont = FX_NEW CFPF_SkiaFont; if (pFont) { if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); return pFont->Retain(); } pFont->Release(); pFont = NULL; +======= + CFPF_SkiaFont *pFont = new CFPF_SkiaFont; + if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); + return pFont->Retain(); +>>>>>>> bb17868... Use stdint.h types throughout PDFium. } return pFont; } return NULL; } -FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceIndex) +FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, int32_t iFaceIndex) { if (!pFileRead) { return NULL; @@ -392,7 +399,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceI FXFT_Set_Pixel_Sizes(face, 0, 64); return face; } -FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex ) +FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, int32_t iFaceIndex ) { if (bsFile.IsEmpty()) { return NULL; @@ -410,7 +417,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex ) FXFT_Set_Pixel_Sizes(face, 0, 64); return face; } -FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, FX_INT32 iFaceIndex ) +FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, int32_t iFaceIndex ) { if (!pBuffer || szBuffer < 1) { return NULL; @@ -512,7 +519,7 @@ static FX_DWORD FPF_SkiaGetFaceCharset(TT_OS2 *pOS2) { FX_DWORD dwCharset = 0; if (pOS2) { - for (FX_INT32 i = 0; i < 32; i++) { + for (int32_t i = 0; i < 32; i++) { if (pOS2->ulCodePageRange1 & (1 << i)) { dwCharset |= g_FPFSkiaFontCharsets[i]; } @@ -542,7 +549,7 @@ void CFPF_SkiaFontMgr::ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor *pFont pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; } if (pOS2->panose[0] == 2) { - FX_BYTE uSerif = pOS2->panose[1]; + uint8_t uSerif = pOS2->panose[1]; if ((uSerif > 1 && uSerif < 10) || uSerif > 13) { pFontDesc->m_dwStyle |= FXFONT_SERIF; } diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h index 3c072fa186..44d427f8af 100644 --- a/core/src/fxge/android/fpf_skiafontmgr.h +++ b/core/src/fxge/android/fpf_skiafontmgr.h @@ -22,7 +22,7 @@ public: FX_Free(m_pFamily); } } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; } @@ -31,16 +31,16 @@ public: if (m_pFamily) { FX_Free(m_pFamily); } - FX_INT32 iSize = FXSYS_strlen(pFamily); + int32_t iSize = FXSYS_strlen(pFamily); m_pFamily = FX_Alloc(FX_CHAR, iSize + 1); FXSYS_memcpy32(m_pFamily, pFamily, iSize * sizeof(FX_CHAR)); m_pFamily[iSize] = 0; } FX_LPSTR m_pFamily; FX_DWORD m_dwStyle; - FX_INT32 m_iFaceIndex; + int32_t m_iFaceIndex; FX_DWORD m_dwCharsets; - FX_INT32 m_iGlyphNum; + int32_t m_iGlyphNum; }; class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { @@ -52,7 +52,7 @@ public: FX_Free(m_pPath); } } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Path; } @@ -61,7 +61,7 @@ public: if (m_pPath) { FX_Free(m_pPath); } - FX_INT32 iSize = FXSYS_strlen(pPath); + int32_t iSize = FXSYS_strlen(pPath); m_pPath = FX_Alloc(FX_CHAR, iSize + 1); FXSYS_memcpy32(m_pPath, pPath, iSize * sizeof(FX_CHAR)); m_pPath[iSize] = 0; @@ -72,7 +72,7 @@ class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor { public: CFPF_SkiaFileFont() : m_pFile(NULL) {} - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_File; } @@ -82,7 +82,7 @@ class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor { public: CFPF_SkiaBufferFont() : m_pBuffer(NULL), m_szBuffer(0) {} - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Buffer; } @@ -100,10 +100,10 @@ public: virtual void LoadPrivateFont(FX_BSTR bsFileName); virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer); - virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0); - FXFT_Face GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceIndex = 0); - FXFT_Face GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex = 0); - FXFT_Face GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, FX_INT32 iFaceIndex = 0); + virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, uint8_t uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0); + FXFT_Face GetFontFace(IFX_FileRead *pFileRead, int32_t iFaceIndex = 0); + FXFT_Face GetFontFace(FX_BSTR bsFile, int32_t iFaceIndex = 0); + FXFT_Face GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, int32_t iFaceIndex = 0); protected: void ScanPath(FX_BSTR path); void ScanFile(FX_BSTR file); diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 2466ecbc9a..6cd880603a 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -56,7 +56,7 @@ public: FX_FLOAT fontSize, FX_WORD* glyphIndices, CGPoint* glyphPositions, - FX_INT32 chars, + int32_t chars, FX_ARGB argb, CFX_AffineMatrix* matrix = NULL); void saveGraphicsState(void* graphics); @@ -81,7 +81,7 @@ public: class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { public: - CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass); + CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass); virtual ~CFX_QuartzDeviceDriver(); virtual int GetDeviceCaps(int caps_id); @@ -176,15 +176,15 @@ protected: CGContextRef _context; CGAffineTransform _foxitDevice2User; CGAffineTransform _user2FoxitDevice; - FX_INT32 m_saveCount; + int32_t m_saveCount; - FX_INT32 _width; - FX_INT32 _height; - FX_INT32 _bitsPerPixel; - FX_INT32 _deviceClass; - FX_INT32 _renderCaps; - FX_INT32 _horzSize; - FX_INT32 _vertSize; + int32_t _width; + int32_t _height; + int32_t _bitsPerPixel; + int32_t _deviceClass; + int32_t _renderCaps; + int32_t _horzSize; + int32_t _vertSize; }; class CFX_FontProvider final : public IFX_FileRead { @@ -239,10 +239,10 @@ private: int _tableCount; int _totalSize; }; -FX_UINT32 FX_GetHashCode( FX_LPCSTR pStr); +uint32_t FX_GetHashCode( FX_LPCSTR pStr); FX_DWORD FX_IOSGetMatchFamilyNameHashcode(FX_LPCSTR pFontName); -FX_UINT32 FX_IOSGetFamilyNamesCount(); -FX_LPCSTR FX_IOSGetFamilyName( FX_UINT32 uIndex); +uint32_t FX_IOSGetFamilyNamesCount(); +FX_LPCSTR FX_IOSGetFamilyName( uint32_t uIndex); #endif #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index 050d8744bd..fa63d22028 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -81,7 +81,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, FX_FLOAT fontSize, FX_WORD* glyphIndices, CGPoint* glyphPositions, - FX_INT32 charsCount, + int32_t charsCount, FX_ARGB argb, CFX_AffineMatrix* matrix ) { @@ -102,7 +102,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, matrix->f)); CGContextSetTextMatrix(context, m); } - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(argb, a, r, g, b); CGContextSetRGBFillColor(context, r / 255.f, @@ -166,7 +166,7 @@ static CGContextRef createContextWithBitmap(CFX_DIBitmap* pBitmap) CGColorSpaceRelease(colorSpace); return context; } -CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass) +CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass) { m_saveCount = 0; _context = context; @@ -438,7 +438,7 @@ FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect, } CGRect rect_fx = CGRectMake(rect->left, rect->top, rect->Width(), rect->Height()); CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User); - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(fillArgb, a, r, g, b); CGContextSetRGBFillColor(_context, r / 255.f, @@ -470,7 +470,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, pt = CGPointApplyAffineTransform(CGPointMake(x2, y2), _foxitDevice2User); x2 = pt.x; y2 = pt.y; - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(argb, a, r, g, b); CGContextSetRGBStrokeColor(_context, r / 255.f, @@ -496,8 +496,8 @@ FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect) return TRUE; } FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap, - FX_INT32 left, - FX_INT32 top, + int32_t left, + int32_t top, void* pIccTransform, FX_BOOL bDEdge) { @@ -656,9 +656,9 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, for (int row = 0; row < pBitmap1->GetHeight(); row ++) { FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row); for (int col = 0; col < pBitmap1->GetWidth(); col ++) { - pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f); - pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f); - pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f); + pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f); + pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f); + pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f); pScanline += 4; } } @@ -781,9 +781,9 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, for (int row = 0; row < pBitmap1->GetHeight(); row ++) { FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row); for (int col = 0; col < pBitmap1->GetWidth(); col ++) { - pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f); - pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f); - pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f); + pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f); + pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f); + pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f); pScanline += 4; } } @@ -844,7 +844,7 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars CGContextSetTextMatrix(_context, matrix_cg); CGContextSetFont(_context, (CGFontRef)pFont->m_pPlatformFont); CGContextSetFontSize(_context, FXSYS_fabs(font_size)); - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(argb, a, r, g, b); CGContextSetRGBFillColor(_context, r / 255.f, @@ -897,7 +897,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, SaveState(); CGContextSetTextDrawingMode(_context, kCGTextFillClip); FX_BOOL ret = FALSE; - FX_INT32 i = 0; + int32_t i = 0; while (i < nChars) { if (pCharPos[i].m_bGlyphAdjust || font_size < 0) { if (i > 0) { @@ -992,7 +992,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, delete[] dashArray; #endif } - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(argb, a, r, g, b); CGContextSetRGBStrokeColor(_context, r / 255.f, @@ -1002,7 +1002,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, } void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb) { - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(argb, a, r, g, b); CGContextSetRGBFillColor(_context, r / 255.f, @@ -1012,10 +1012,10 @@ void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb) } void CFX_QuartzDeviceDriver::setPathToContext(const CFX_PathData* pathData) { - FX_INT32 count = pathData->GetPointCount(); + int32_t count = pathData->GetPointCount(); FX_PATHPOINT* points = pathData->GetPoints(); CGContextBeginPath(_context); - for (FX_INT32 i = 0; i < count; i ++) { + for (int32_t i = 0; i < count; i ++) { switch (points[i].m_Flag & FXPT_TYPE) { case FXPT_MOVETO: CGContextMoveToPoint(_context, points[i].m_PointX, points[i].m_PointY); @@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext() { return m_pContext; } -FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, FX_INT32 nDeviceClass) +FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) { if (m_pContext) { CGContextRelease(m_pContext); @@ -1118,9 +1118,9 @@ FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap) SetDeviceDriver(pDriver); return TRUE; } -FX_BOOL CFX_QuartzDevice::Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format) +FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format) { - if ((FX_BYTE)format < 32) { + if ((uint8_t)format < 32) { return FALSE; } CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index e385bc9ffe..970325a2d4 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -7,7 +7,7 @@ #include "../../../include/fxge/fx_ge.h" #include "../../../include/fxcodec/fx_codec.h" #include "dib_int.h" -const FX_BYTE g_GammaRamp[256] = { +const uint8_t g_GammaRamp[256] = { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, @@ -25,7 +25,7 @@ const FX_BYTE g_GammaRamp[256] = { 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255, }; -const FX_BYTE g_GammaInverse[256] = { +const uint8_t g_GammaInverse[256] = { 0, 13, 22, 28, 34, 38, 42, 46, 50, 53, 56, 59, 61, 64, 66, 69, 71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119, @@ -43,7 +43,7 @@ const FX_BYTE g_GammaInverse[256] = { 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255, }; -const FX_BYTE _color_sqrt[256] = { +const uint8_t _color_sqrt[256] = { 0x00, 0x03, 0x07, 0x0B, 0x0F, 0x12, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32, 0x35, 0x37, 0x3A, 0x3C, 0x3F, 0x41, 0x43, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56, 0x57, 0x59, 0x5B, 0x5C, 0x5E, 0x60, 0x61, 0x63, 0x64, 0x65, 0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D, @@ -227,7 +227,7 @@ static _RGB _SetSat(_RGB color, int s) } return color; } -void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, FX_BYTE* dest_scan, int results[3]) +void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, uint8_t* dest_scan, int results[3]) { _RGB src, back, result; src.red = src_scan[2]; @@ -262,7 +262,7 @@ inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } - FX_BYTE back_alpha = *dest_scan; + uint8_t back_alpha = *dest_scan; if (!back_alpha) { *dest_scan = src_alpha; } else if (src_alpha) { @@ -279,7 +279,7 @@ void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } - FX_BYTE back_alpha = *dest_scan; + uint8_t back_alpha = *dest_scan; if (!back_alpha) { *dest_scan = src_alpha; } else if (src_alpha) { @@ -312,7 +312,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe int blended_color; if (src_alpha_scan) { for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dst_alpha_scan; + uint8_t back_alpha = *dst_alpha_scan; if (back_alpha == 0) { int src_alpha = *src_alpha_scan++; if (clip_scan) { @@ -331,7 +331,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe src_scan += 3; continue; } - FX_BYTE src_alpha = *src_alpha_scan++; + uint8_t src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -343,7 +343,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha); int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan); - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -360,7 +360,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } } else for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dst_alpha_scan; + uint8_t back_alpha = *dst_alpha_scan; if (back_alpha == 0) { int src_alpha = src_scan[3]; if (clip_scan) { @@ -379,7 +379,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe src_scan += 4; continue; } - FX_BYTE src_alpha = src_scan[3]; + uint8_t src_alpha = src_scan[3]; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -391,7 +391,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha); int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan); - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -406,7 +406,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } if (src_alpha_scan) { for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dst_alpha_scan; + uint8_t back_alpha = *dst_alpha_scan; if (back_alpha == 0) { int src_alpha = *src_alpha_scan++; if (clip_scan) { @@ -425,7 +425,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe src_scan += 3; continue; } - FX_BYTE src_alpha = *src_alpha_scan++; + uint8_t src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -437,7 +437,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha); int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan); - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -450,7 +450,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } } else for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dst_alpha_scan; + uint8_t back_alpha = *dst_alpha_scan; if (back_alpha == 0) { int src_alpha = src_scan[3]; if (clip_scan) { @@ -469,7 +469,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe src_scan += 4; continue; } - FX_BYTE src_alpha = src_scan[3]; + uint8_t src_alpha = src_scan[3]; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -481,7 +481,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe } *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha); int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan); - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -498,7 +498,7 @@ inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in FX_LPCBYTE src_alpha_scan, void* pIccTransform) { ICodec_IccModule* pIccModule = NULL; - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } @@ -589,7 +589,7 @@ inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int void* pIccTransform) { ICodec_IccModule* pIccModule = NULL; - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } @@ -665,10 +665,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B src_scan += src_Bpp; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -707,10 +707,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; - FX_BYTE gray; + uint8_t gray; if (pIccTransform) { pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1); } else { @@ -728,7 +728,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; if (dest_alpha_scan == NULL) { if (src_alpha_scan == NULL) { - FX_BYTE back_alpha = 0; + uint8_t back_alpha = 0; for (int col = 0; col < pixel_count; col ++) { back_alpha = dest_scan[3]; if (back_alpha == 0) { @@ -742,7 +742,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_scan += 4; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = src_scan[3]; } else { @@ -753,7 +753,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -776,7 +776,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel } } else { for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255; @@ -789,7 +789,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_alpha_scan ++; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = *src_alpha_scan ++; } else { @@ -800,7 +800,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_scan += 3; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -824,7 +824,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel } else { if (src_alpha_scan) { for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255; @@ -842,7 +842,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_alpha_scan ++; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = *src_alpha_scan ++; } else { @@ -854,7 +854,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -875,7 +875,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel } } else { for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * src_scan[3] / 255; @@ -893,7 +893,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel src_scan ++; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = src_scan[3]; } else { @@ -905,7 +905,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -936,7 +936,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca int src_gap = src_Bpp - 3; if (dest_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { if (src_Bpp == 4) { FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); @@ -964,7 +964,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca } } else { for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { *dest_scan++ = *src_scan++; *dest_scan++ = *src_scan++; @@ -998,7 +998,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr if (dest_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { int src_alpha = *clip_scan ++; - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { *dest_scan++ = *src_scan++; *dest_scan++ = *src_scan++; @@ -1012,7 +1012,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr src_scan += src_Bpp; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -1033,7 +1033,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr } else { for (int col = 0; col < width; col ++) { int src_alpha = *clip_scan ++; - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { *dest_scan++ = *src_scan++; *dest_scan++ = *src_scan++; @@ -1048,7 +1048,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr src_scan += src_Bpp; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -1088,7 +1088,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; for (int color = 0; color < 3; color ++) { @@ -1117,7 +1117,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; for (int color = 0; color < 3; color ++) { @@ -1161,7 +1161,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca int dest_gap = dest_Bpp - 3; if (src_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -1188,7 +1188,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca } } else { for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255; } else { @@ -1220,7 +1220,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s int dest_gap = dest_Bpp - 3; if (src_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -1249,7 +1249,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s } } else { for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255; } else { @@ -1306,7 +1306,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src int dest_gap = dest_Bpp - 3; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha = *clip_scan ++; + uint8_t src_alpha = *clip_scan ++; if (src_alpha == 0) { dest_scan += dest_Bpp; src_scan += src_Bpp; @@ -1396,7 +1396,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < pixel_count; col ++) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1); - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * src_scan[3] / 255; @@ -1414,7 +1414,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, src_scan += 4; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = src_scan[3]; } else { @@ -1427,7 +1427,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -1527,7 +1527,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBY int dest_gap = dest_Bpp - 3; for (int col = 0; col < width; col ++) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1); - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -1566,7 +1566,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPC int dest_gap = dest_Bpp - 3; for (int col = 0; col < width; col ++) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1); - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -1669,7 +1669,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; int src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; @@ -1689,7 +1689,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; int src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; @@ -1707,7 +1707,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; if (bNonseparableBlend) { blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan; } @@ -1723,7 +1723,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; if (clip_scan && clip_scan[col] < 255) { *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]); } else { @@ -1743,9 +1743,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; src_scan ++; - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { int src_alpha = *src_alpha_scan ++; if (clip_scan) { @@ -1759,7 +1759,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan dest_alpha_scan ++; continue; } - FX_BYTE src_alpha = *src_alpha_scan++; + uint8_t src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -1781,9 +1781,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; src_scan ++; - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { int src_alpha = *src_alpha_scan ++; if (clip_scan) { @@ -1797,7 +1797,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan dest_alpha_scan ++; continue; } - FX_BYTE src_alpha = *src_alpha_scan++; + uint8_t src_alpha = *src_alpha_scan++; if (clip_scan) { src_alpha = clip_scan[col] * src_alpha / 255; } @@ -1817,7 +1817,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; src_scan ++; if (clip_scan == NULL || clip_scan[col] == 255) { *dest_scan++ = gray; @@ -1831,7 +1831,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -1844,7 +1844,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = pPalette[*src_scan]; + uint8_t gray = pPalette[*src_scan]; src_scan ++; if (clip_scan == NULL || clip_scan[col] == 255) { *dest_scan++ = gray; @@ -1858,7 +1858,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio); @@ -1875,7 +1875,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; + uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; if (bNonseparableBlend) { blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan; } @@ -1890,7 +1890,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; + uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; if (clip_scan && clip_scan[col] < 255) { *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]); } else { @@ -1909,7 +1909,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; + uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; if (clip_scan == NULL || clip_scan[col] == 255) { *dest_scan++ = gray; *dest_alpha_scan ++ = 255; @@ -1922,7 +1922,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { @@ -1935,7 +1935,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan return; } for (int col = 0; col < pixel_count; col ++) { - FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; + uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; if (clip_scan == NULL || clip_scan[col] == 255) { *dest_scan++ = gray; *dest_alpha_scan ++ = 255; @@ -1948,7 +1948,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio); @@ -1968,7 +1968,7 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE sr int src_g = FXARGB_G(argb); int src_b = FXARGB_B(argb); src_scan ++; - FX_BYTE src_alpha = 0; + uint8_t src_alpha = 0; if (clip_scan) { src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255; } else { @@ -2069,7 +2069,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s int src_r = FXARGB_R(argb); int src_g = FXARGB_G(argb); int src_b = FXARGB_B(argb); - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255; @@ -2081,7 +2081,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s src_alpha_scan ++; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = *src_alpha_scan ++; } else { @@ -2091,7 +2091,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2123,7 +2123,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2147,7 +2147,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan int src_r = FXARGB_R(argb); int src_g = FXARGB_G(argb); int src_b = FXARGB_B(argb); - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255; @@ -2161,7 +2161,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan src_alpha_scan ++; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = *src_alpha_scan++; } else { @@ -2172,7 +2172,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2204,7 +2204,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2251,7 +2251,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2300,7 +2300,7 @@ void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan continue; } int back_alpha = *dest_alpha_scan; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio); @@ -2321,7 +2321,7 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m } else { src_alpha = mask_alpha * src_scan[col] / 255; } - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); dest_scan += 4; @@ -2331,12 +2331,12 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2379,7 +2379,7 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m } else { src_alpha = mask_alpha * src_scan[col] / 255; } - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { *dest_scan ++ = src_b; *dest_scan ++ = src_g; @@ -2392,12 +2392,12 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2447,7 +2447,7 @@ void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma } if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2486,7 +2486,7 @@ void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m } else { src_alpha = mask_alpha * src_scan[col] / 255; } - FX_BYTE back_alpha = *dest_scan; + uint8_t back_alpha = *dest_scan; if (!back_alpha) { *dest_scan = src_alpha; } else if (src_alpha) { @@ -2522,7 +2522,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int } else { src_alpha = mask_alpha * src_scan[col] / 255; } - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { *dest_scan ++ = src_gray; *dest_alpha_scan ++ = src_alpha; @@ -2533,7 +2533,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio); @@ -2564,18 +2564,18 @@ void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma } else { src_alpha = mask_alpha; } - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2636,7 +2636,7 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma } else { src_alpha = mask_alpha; } - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { *dest_scan ++ = src_b; *dest_scan ++ = src_g; @@ -2644,12 +2644,12 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma *dest_alpha_scan ++ = mask_alpha; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2714,7 +2714,7 @@ void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mas } if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; + uint8_t src_scan[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -2757,7 +2757,7 @@ void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma } else { src_alpha = mask_alpha; } - FX_BYTE back_alpha = *dest_scan; + uint8_t back_alpha = *dest_scan; if (!back_alpha) { *dest_scan = src_alpha; } else if (src_alpha) { @@ -2802,7 +2802,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m } else { src_alpha = mask_alpha; } - FX_BYTE back_alpha = *dest_alpha_scan; + uint8_t back_alpha = *dest_alpha_scan; if (back_alpha == 0) { *dest_scan ++ = src_gray; *dest_alpha_scan ++ = src_alpha; @@ -2813,7 +2813,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m dest_alpha_scan ++; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio); @@ -2825,7 +2825,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc int blended_colors[3]; FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < pixel_count; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { if (clip_scan) { int src_alpha = clip_scan[col] * src_scan[3] / 255; @@ -2840,7 +2840,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc src_scan += 4; continue; } - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan == NULL) { src_alpha = src_scan[3]; } else { @@ -2851,11 +2851,11 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc src_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -2883,7 +2883,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { if (src_Bpp == 4) { FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); @@ -2896,7 +2896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP } dest_scan[3] = 0xff; if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -2919,7 +2919,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP int blended_colors[3]; FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -2931,7 +2931,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP continue; } if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -2968,7 +2968,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -2990,7 +2990,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan) { for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha; + uint8_t src_alpha; if (clip_scan) { src_alpha = src_scan[3] * (*clip_scan++) / 255; } else { @@ -3035,7 +3035,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { int src_alpha = *clip_scan ++; - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { dest_scan[2] = FX_GAMMA(*src_scan++); dest_scan[1] = FX_GAMMA(*src_scan++); @@ -3049,11 +3049,11 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, src_scan += src_Bpp; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -3078,14 +3078,14 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, F FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { - FX_BYTE src_alpha = *clip_scan ++; + uint8_t src_alpha = *clip_scan ++; if (src_alpha == 0) { dest_scan += dest_Bpp; src_scan += src_Bpp; continue; } if (bNonseparableBlend) { - FX_BYTE dest_scan_o[3]; + uint8_t dest_scan_o[3]; dest_scan_o[0] = dest_scan[2]; dest_scan_o[1] = dest_scan[1]; dest_scan_o[2] = dest_scan[0]; @@ -3124,7 +3124,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; for (int color = 0; color < 3; color ++) { @@ -3247,7 +3247,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio); @@ -3298,7 +3298,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, continue; } int back_alpha = dest_scan[3]; - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio); @@ -3317,7 +3317,7 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr } else { src_alpha = mask_alpha * src_scan[col] / 255; } - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); dest_scan += 4; @@ -3327,13 +3327,13 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; - FX_BYTE dest_scan_o[3]; + uint8_t src_scan[3]; + uint8_t dest_scan_o[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -3378,8 +3378,8 @@ void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src } if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; - FX_BYTE dest_scan_o[3]; + uint8_t src_scan[3]; + uint8_t dest_scan_o[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -3429,19 +3429,19 @@ void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src } else { src_alpha = mask_alpha; } - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b)); dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; - FX_BYTE dest_scan_o[3]; + uint8_t src_scan[3]; + uint8_t dest_scan_o[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -3501,8 +3501,8 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_ } if (blend_type >= FXDIB_BLEND_NONSEPARABLE) { int blended_colors[3]; - FX_BYTE src_scan[3]; - FX_BYTE dest_scan_o[3]; + uint8_t src_scan[3]; + uint8_t dest_scan_o[3]; src_scan[0] = src_b; src_scan[1] = src_g; src_scan[2] = src_r; @@ -3559,7 +3559,7 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0]; } else { if (alpha_flag >> 8) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(mask_red, mask_green, mask_blue, mask_black, r, g, b); mask_red = FXRGB2GRAY(r, g, b); @@ -3600,7 +3600,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB if (pSrcPalette) { if ((dest_format & 0xff) == 8) { int pal_count = 1 << (src_format & 0xff); - FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count); + FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count); pDestPalette = (FX_DWORD*)gray_pal; for (int i = 0; i < pal_count; i ++) { FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]); @@ -3618,7 +3618,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB } } else { int pal_count = 1 << (src_format & 0xff); - FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count); + FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count); if (pal_count == 2) { gray_pal[0] = 0; gray_pal[1] = 255; @@ -3643,12 +3643,12 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB if (pSrcPalette) { if ((dest_format & 0xff) == 8) { int pal_count = 1 << (src_format & 0xff); - FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count); + FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count); pDestPalette = (FX_DWORD*)gray_pal; if (isSrcCmyk) { for (int i = 0; i < pal_count; i ++) { FX_CMYK cmyk = pSrcPalette[i]; - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk), r, g, b); *gray_pal ++ = FXRGB2GRAY(r, g, b); @@ -3666,7 +3666,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB } else { for (int i = 0; i < palsize; i ++) { FX_CMYK cmyk = pSrcPalette[i]; - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk), r, g, b); pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b); @@ -3676,7 +3676,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB } else { if ((dest_format & 0xff) == 8) { int pal_count = 1 << (src_format & 0xff); - FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count); + FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count); if (pal_count == 2) { gray_pal[0] = 0; gray_pal[1] = 255; @@ -3700,7 +3700,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB if (isSrcCmyk != isDstCmyk) { for (int i = 0; i < palsize; i ++) { FX_CMYK cmyk = pDestPalette[i]; - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk), r, g, b); pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b); @@ -3727,7 +3727,7 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor() FX_Free(m_pCacheScanline); } } -FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette, +FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform) { m_SrcFormat = src_format; @@ -3861,7 +3861,7 @@ void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCB } else { int dest_Size = width * dest_Bpp + 4; if (dest_Size > m_CacheSize) { - m_pCacheScanline = FX_Realloc(FX_BYTE, m_pCacheScanline, dest_Size); + m_pCacheScanline = FX_Realloc(uint8_t, m_pCacheScanline, dest_Size); if (!m_pCacheScanline) { return; } @@ -4158,7 +4158,7 @@ FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int if (width == 0 || height == 0) { return TRUE; } - int src_alpha = (FX_BYTE)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color); + int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color); if (src_alpha == 0) { return TRUE; } @@ -4214,19 +4214,19 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX } FX_LPBYTE color_p = (FX_LPBYTE)&dst_color; if (m_bpp == 8) { - FX_BYTE gray = 255; + uint8_t gray = 255; if (!IsAlphaMask()) { if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1); } else { if (alpha_flag >> 8) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(color_p[0], color_p[1], color_p[2], color_p[3], r, g, b); gray = FXRGB2GRAY(r, g, b); } else { - gray = (FX_BYTE)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]); + gray = (uint8_t)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]); } } if (IsCmykImage()) { @@ -4245,13 +4245,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX } return TRUE; } else if (m_bpp == 1) { - ASSERT(!IsCmykImage() && (FX_BYTE)(alpha_flag >> 8) == 0); + ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0); int left_shift = rect.left % 8; int right_shift = rect.right % 8; int width = rect.right / 8 - rect.left / 8; int index = 0; if (m_pPalette == NULL) { - index = ((FX_BYTE)color == 0xff) ? 1 : 0; + index = ((uint8_t)color == 0xff) ? 1 : 0; } else { for (int i = 0; i < 2; i ++) if (m_pPalette[i] == color) { @@ -4259,10 +4259,10 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX } } for (int row = rect.top; row < rect.bottom; row ++) { - FX_BYTE* dest_scan_top = (FX_BYTE*)GetScanline(row) + rect.left / 8; - FX_BYTE* dest_scan_top_r = (FX_BYTE*)GetScanline(row) + rect.right / 8; - FX_BYTE left_flag = *dest_scan_top & (255 << (8 - left_shift)); - FX_BYTE right_flag = *dest_scan_top_r & (255 >> right_shift); + uint8_t* dest_scan_top = (uint8_t*)GetScanline(row) + rect.left / 8; + uint8_t* dest_scan_top_r = (uint8_t*)GetScanline(row) + rect.right / 8; + uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift)); + uint8_t right_flag = *dest_scan_top_r & (255 >> right_shift); if (width) { FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1); if (!index) { @@ -4298,7 +4298,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX } } if(!IsCmykImage()) { - color_p[3] = (FX_BYTE)src_alpha; + color_p[3] = (uint8_t)src_alpha; } int Bpp = m_bpp / 8; FX_BOOL bAlpha = HasAlpha(); @@ -4330,13 +4330,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX if (bAlpha) { if (bArgb) { for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], color_p[1], color_p[0])); dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[0], alpha_ratio); dest_scan ++; @@ -4349,14 +4349,14 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX } else { FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left; for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = *dest_scan_alpha; + uint8_t back_alpha = *dest_scan_alpha; if (back_alpha == 0) { *dest_scan_alpha++ = src_alpha; FXSYS_memcpy32(dest_scan, color_p, Bpp); dest_scan += Bpp; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; *dest_scan_alpha ++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; for(int comps = 0; comps < Bpp; comps ++) { @@ -4437,14 +4437,14 @@ FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_form return FALSE; } if (m_bVertical) { - m_pScanlineV = FX_Alloc(FX_BYTE, m_pBitmap->GetBPP() / 8 * width + 4); - m_pClipScanV = FX_Alloc(FX_BYTE, m_pBitmap->GetHeight()); + m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4); + m_pClipScanV = FX_Alloc(uint8_t, m_pBitmap->GetHeight()); if (m_pBitmap->m_pAlphaMask) { - m_pScanlineAlphaV = FX_Alloc(FX_BYTE, width + 4); + m_pScanlineAlphaV = FX_Alloc(uint8_t, width + 4); } } if (m_BitmapAlpha < 255) { - m_pAddClipScan = FX_Alloc(FX_BYTE, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth()); + m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth()); } return TRUE; } diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp index 7ab2417a57..b4fdd3a1ba 100644 --- a/core/src/fxge/dib/fx_dib_convert.cpp +++ b/core/src/fxge/dib/fx_dib_convert.cpp @@ -117,7 +117,7 @@ public: { return m_aLut; } - FX_INT32 Getlut()const + int32_t Getlut()const { return m_lut; } @@ -159,11 +159,11 @@ void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r) _Qsort(alut, clut, pI + 1, r); } } -void _ColorDecode(FX_DWORD pal_v, FX_BYTE& r, FX_BYTE& g, FX_BYTE& b) +void _ColorDecode(FX_DWORD pal_v, uint8_t& r, uint8_t& g, uint8_t& b) { - r = (FX_BYTE)((pal_v & 0xf00) >> 4); - g = (FX_BYTE)(pal_v & 0x0f0); - b = (FX_BYTE)((pal_v & 0x00f) << 4); + r = (uint8_t)((pal_v & 0xf00) >> 4); + g = (uint8_t)(pal_v & 0x0f0); + b = (uint8_t)((pal_v & 0x00f) << 4); } void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type, FX_DWORD* win_mac_pal, FX_DWORD lut) { @@ -176,7 +176,7 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type lut_offset += 256; } FX_DWORD color = cLut[lut_offset]; - FX_BYTE r, g, b; + uint8_t r, g, b; _ColorDecode(color, r, g, b); dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000; aLut[lut_offset] = row; @@ -187,15 +187,15 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type if (lut_offset < 0) { lut_offset += 256; } - FX_BYTE r, g, b; + uint8_t r, g, b; _ColorDecode(cLut[lut_offset], r, g, b); int error, min_error = 1000000; int c_index = 0; for (col = 0; col < 256; col++) { FX_DWORD p_color = win_mac_pal[col]; - int d_r = r - (FX_BYTE)(p_color >> 16); - int d_g = g - (FX_BYTE)(p_color >> 8); - int d_b = b - (FX_BYTE)p_color; + int d_r = r - (uint8_t)(p_color >> 16); + int d_g = g - (uint8_t)(p_color >> 8); + int d_b = b - (uint8_t)p_color; error = d_r * d_r + d_g * d_g + d_b * d_b; if (error < min_error) { min_error = error; @@ -252,9 +252,9 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type) int row, col; m_lut = 0; for (row = 0; row < height; row++) { - FX_BYTE* scan_line = (FX_BYTE*)pBitmap->GetScanline(row); + uint8_t* scan_line = (uint8_t*)pBitmap->GetScanline(row); for (col = 0; col < width; col++) { - FX_BYTE* src_port = scan_line + col * bpp; + uint8_t* src_port = scan_line + col * bpp; FX_DWORD b = src_port[0] & 0xf0; FX_DWORD g = src_port[1] & 0xf0; FX_DWORD r = src_port[2] & 0xf0; @@ -282,7 +282,7 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type) FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { - FX_BYTE set_gray, reset_gray; + uint8_t set_gray, reset_gray; set_gray = 0xff; reset_gray = 0x00; for (int row = 0; row < height; row ++) { @@ -312,7 +312,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { FX_DWORD* src_plt = pSrcBitmap->GetPalette(); - FX_BYTE gray[2]; + uint8_t gray[2]; if (pIccTransform) { FX_DWORD plt[2]; if (pSrcBitmap->IsCmykImage()) { @@ -330,7 +330,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2); } else { - FX_BYTE reset_r, reset_g, reset_b, + uint8_t reset_r, reset_g, reset_b, set_r, set_g, set_b; if (pSrcBitmap->IsCmykImage()) { AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]), @@ -365,7 +365,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { FX_DWORD* src_plt = pSrcBitmap->GetPalette(); - FX_BYTE gray[256]; + uint8_t gray[256]; if (pIccTransform) { FX_DWORD plt[256]; if (pSrcBitmap->IsCmykImage()) { @@ -384,7 +384,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256); } else { if (pSrcBitmap->IsCmykImage()) { - FX_BYTE r, g, b; + uint8_t r, g, b; for (int i = 0; i < 256; i ++) { AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), r, g, b); @@ -433,7 +433,7 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi FX_LPBYTE dest_scan = dest_buf + row * dest_pitch; FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4; for (int col = 0; col < width; col ++) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), FXSYS_GetMValue((FX_DWORD)src_scan[1]), FXSYS_GetYValue((FX_DWORD)src_scan[2]), FXSYS_GetKValue((FX_DWORD)src_scan[3]), r, g, b); *dest_scan++ = FXRGB2GRAY(r, g, b); @@ -506,7 +506,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width } else { if (pSrcBitmap->IsCmykImage()) { for (int i = 0; i < plt_size; i ++) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), r, g, b); dst_plt[i] = FXARGB_MAKE(0xff, r, g, b); @@ -536,14 +536,14 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de int lut_256 = lut - 256; for (row = 0; row < lut_256; row++) { min_err = 1000000; - FX_BYTE r, g, b; + uint8_t r, g, b; _ColorDecode(cLut[row], r, g, b); int clrindex = 0; for (int col = 0; col < 256; col++) { FX_DWORD p_color = *(pPalette + col); - int d_r = r - (FX_BYTE)(p_color >> 16); - int d_g = g - (FX_BYTE)(p_color >> 8); - int d_b = b - (FX_BYTE)(p_color); + int d_r = r - (uint8_t)(p_color >> 16); + int d_g = g - (uint8_t)(p_color >> 8); + int d_b = b - (uint8_t)(p_color); err = d_r * d_r + d_g * d_g + d_b * d_b; if (err < min_err) { min_err = err; @@ -553,19 +553,19 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de aLut[row] = clrindex; } } - FX_INT32 lut_1 = lut - 1; + int32_t lut_1 = lut - 1; for (row = 0; row < height; row ++) { - FX_BYTE* src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left; - FX_BYTE* dest_scan = dest_buf + row * dest_pitch; + uint8_t* src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left; + uint8_t* dest_scan = dest_buf + row * dest_pitch; for (col = 0; col < width; col++) { - FX_BYTE* src_port = src_scan + col * bpp; + uint8_t* src_port = src_scan + col * bpp; int r = src_port[2] & 0xf0; int g = src_port[1] & 0xf0; int b = src_port[0] & 0xf0; FX_DWORD clrindex = (r << 4) + g + (b >> 4); for (int i = lut_1; i >= 0; i--) if (clrindex == cLut[i]) { - *(dest_scan + col) = (FX_BYTE)(aLut[i]); + *(dest_scan + col) = (uint8_t)(aLut[i]); break; } } @@ -596,7 +596,7 @@ FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; - FX_BYTE set_gray, reset_gray; + uint8_t set_gray, reset_gray; set_gray = 0xff; reset_gray = 0x00; for (int row = 0; row < height; row ++) { @@ -624,7 +624,7 @@ FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, for (int row = 0; row < height; row ++) { FX_LPBYTE dest_scan = dest_buf + row * dest_pitch; FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left; - FX_BYTE src_pixel; + uint8_t src_pixel; for (int col = 0; col < width; col ++) { src_pixel = *src_scan++; *dest_scan++ = src_pixel; @@ -1003,7 +1003,7 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor } int dest_bpp = dest_format & 0xff; int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4; - FX_LPBYTE dest_buf = FX_TryAlloc(FX_BYTE, dest_pitch * m_Height + 4); + FX_LPBYTE dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4); if (dest_buf == NULL) { return FALSE; } @@ -1068,8 +1068,8 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor } m_bExtBuf = FALSE; m_pBuffer = dest_buf; - m_bpp = (FX_BYTE)dest_format; - m_AlphaFlag = (FX_BYTE)(dest_format >> 8); + m_bpp = (uint8_t)dest_format; + m_AlphaFlag = (uint8_t)(dest_format >> 8); m_Pitch = dest_pitch; return TRUE; } diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index 6f8621e2a5..e0b21d2f59 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -28,7 +28,7 @@ void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, int src_len, i if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize) { return; } - m_pWeightTables = FX_TryAlloc(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4); + m_pWeightTables = FX_TryAlloc(uint8_t, (dest_max - dest_min) * m_ItemSize + 4); if (m_pWeightTables == NULL) { return; } @@ -202,7 +202,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d } size += 31; size = size / 32 * 4; - m_pDestScanline = FX_TryAlloc(FX_BYTE, size); + m_pDestScanline = FX_TryAlloc(uint8_t, size); if (m_pDestScanline == NULL) { return; } @@ -373,7 +373,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) if (m_Flags & FXDIB_BICUBIC_INTERPOL) { dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a; } - *dest_scan++ = (FX_BYTE)(dest_a >> 16); + *dest_scan++ = (uint8_t)(dest_a >> 16); } break; } @@ -388,7 +388,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) if (m_Flags & FXDIB_BICUBIC_INTERPOL) { dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a; } - *dest_scan++ = (FX_BYTE)(dest_a >> 16); + *dest_scan++ = (uint8_t)(dest_a >> 16); } break; } @@ -406,8 +406,8 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_r = dest_r < 0 ? 0 : dest_r > 16711680 ? 16711680 : dest_r; dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a; } - *dest_scan++ = (FX_BYTE)(dest_r >> 16); - *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16); + *dest_scan++ = (uint8_t)(dest_r >> 16); + *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16); } break; } @@ -419,13 +419,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]]; if (m_DestFormat == FXDIB_Rgb) { - dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16); - dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8); - dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk; + dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16); + dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8); + dest_b_c += pixel_weight * (uint8_t)argb_cmyk; } else { - dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24); - dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16); - dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8); + dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24); + dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16); + dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8); } } if (m_Flags & FXDIB_BICUBIC_INTERPOL) { @@ -433,9 +433,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m; dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c; } - *dest_scan++ = (FX_BYTE)(dest_b_c >> 16); - *dest_scan++ = (FX_BYTE)(dest_g_m >> 16); - *dest_scan++ = (FX_BYTE)(dest_r_y >> 16); + *dest_scan++ = (uint8_t)(dest_b_c >> 16); + *dest_scan++ = (uint8_t)(dest_g_m >> 16); + *dest_scan++ = (uint8_t)(dest_r_y >> 16); } break; } @@ -448,13 +448,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) pixel_weight = pixel_weight * src_scan_mask[j] / 255; unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]]; if (m_DestFormat == FXDIB_Rgba) { - dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16); - dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8); - dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk; + dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16); + dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8); + dest_b_c += pixel_weight * (uint8_t)argb_cmyk; } else { - dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24); - dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16); - dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8); + dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24); + dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16); + dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8); } dest_a += pixel_weight; } @@ -464,10 +464,10 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y; dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a; } - *dest_scan++ = (FX_BYTE)(dest_b_c >> 16); - *dest_scan++ = (FX_BYTE)(dest_g_m >> 16); - *dest_scan++ = (FX_BYTE)(dest_r_y >> 16); - *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16); + *dest_scan++ = (uint8_t)(dest_b_c >> 16); + *dest_scan++ = (uint8_t)(dest_g_m >> 16); + *dest_scan++ = (uint8_t)(dest_r_y >> 16); + *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16); } break; } @@ -487,9 +487,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m; dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y; } - *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16); - *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16); - *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16); + *dest_scan++ = (uint8_t)((dest_b_c) >> 16); + *dest_scan++ = (uint8_t)((dest_g_m) >> 16); + *dest_scan++ = (uint8_t)((dest_r_y) >> 16); dest_scan += Bpp - 3; } break; @@ -517,14 +517,14 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c; dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a; } - *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16); - *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16); - *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16); + *dest_scan++ = (uint8_t)((dest_b_c) >> 16); + *dest_scan++ = (uint8_t)((dest_g_m) >> 16); + *dest_scan++ = (uint8_t)((dest_r_y) >> 16); if (m_DestFormat == FXDIB_Argb) { - *dest_scan = (FX_BYTE)((dest_a * 255) >> 16); + *dest_scan = (uint8_t)((dest_a * 255) >> 16); } if (dest_scan_mask) { - *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16); + *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16); } dest_scan += Bpp - 3; } @@ -564,7 +564,7 @@ void CStretchEngine::StretchVert() if (m_Flags & FXDIB_BICUBIC_INTERPOL) { dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a; } - *dest_scan = (FX_BYTE)(dest_a >> 16); + *dest_scan = (uint8_t)(dest_a >> 16); dest_scan += DestBpp; } break; @@ -583,9 +583,9 @@ void CStretchEngine::StretchVert() dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k; dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a; } - *dest_scan = (FX_BYTE)(dest_k >> 16); + *dest_scan = (uint8_t)(dest_k >> 16); dest_scan += DestBpp; - *dest_sacn_mask++ = (FX_BYTE)(dest_a >> 16); + *dest_sacn_mask++ = (uint8_t)(dest_a >> 16); } break; } @@ -606,9 +606,9 @@ void CStretchEngine::StretchVert() dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m; dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c; } - dest_scan[0] = (FX_BYTE)((dest_b_c) >> 16); - dest_scan[1] = (FX_BYTE)((dest_g_m) >> 16); - dest_scan[2] = (FX_BYTE)((dest_r_y) >> 16); + dest_scan[0] = (uint8_t)((dest_b_c) >> 16); + dest_scan[1] = (uint8_t)((dest_g_m) >> 16); + dest_scan[2] = (uint8_t)((dest_r_y) >> 16); dest_scan += DestBpp; } break; @@ -653,9 +653,9 @@ void CStretchEngine::StretchVert() dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r; } if (m_DestFormat == FXDIB_Argb) { - dest_scan[3] = (FX_BYTE)((dest_a) >> 16); + dest_scan[3] = (uint8_t)((dest_a) >> 16); } else { - *dest_sacn_mask = (FX_BYTE)((dest_a) >> 16); + *dest_sacn_mask = (uint8_t)((dest_a) >> 16); } dest_scan += DestBpp; if (dest_sacn_mask) { @@ -798,9 +798,9 @@ FX_BOOL CFX_ImageStretcher::StartQuickStretch() return FALSE; } size *= m_DestBPP; - m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4); + m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4); if (m_pSource->m_pAlphaMask) { - m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4); + m_pMaskScanline = FX_Alloc(uint8_t, (m_ClipRect.Width() + 3) / 4 * 4); } if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) { ContinueQuickStretch(NULL); diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index 12812b2f8d..74c4276695 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -62,8 +62,8 @@ CFX_DIBitmap::CFX_DIBitmap() FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch) { m_pBuffer = NULL; - m_bpp = (FX_BYTE)format; - m_AlphaFlag = (FX_BYTE)(format >> 8); + m_bpp = (uint8_t)format; + m_AlphaFlag = (uint8_t)(format >> 8); m_Width = m_Height = m_Pitch = 0; if (width <= 0 || height <= 0 || pitch < 0) { return FALSE; @@ -84,12 +84,12 @@ FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBY int size = pitch * height + 4; int oomlimit = _MAX_OOM_LIMIT_; if (oomlimit >= 0 && size >= oomlimit) { - m_pBuffer = FX_TryAlloc(FX_BYTE, size); + m_pBuffer = FX_TryAlloc(uint8_t, size); if (m_pBuffer == NULL) { return FALSE; } } else { - m_pBuffer = FX_Alloc(FX_BYTE, size); + m_pBuffer = FX_Alloc(uint8_t, size); } } m_Width = width; @@ -273,14 +273,14 @@ int CFX_DIBSource::FindPalette(FX_DWORD color) const if (m_pPalette == NULL) { if (IsCmykImage()) { if (GetBPP() == 1) { - return ((FX_BYTE)color == 0xff) ? 0 : 1; + return ((uint8_t)color == 0xff) ? 0 : 1; } - return 0xff - (FX_BYTE)color; + return 0xff - (uint8_t)color; } if (GetBPP() == 1) { - return ((FX_BYTE)color == 0xff) ? 1 : 0; + return ((uint8_t)color == 0xff) ? 1 : 0; } - return (FX_BYTE)color; + return (uint8_t)color; } int palsize = (1 << GetBPP()); for (int i = 0; i < palsize; i ++) @@ -463,7 +463,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h } } if(!IsCmykImage()) { - color_p[3] = (FX_BYTE)alpha; + color_p[3] = (uint8_t)alpha; } if (GetFormat() == FXDIB_Argb) { for (int row = 0; row < height; row ++) { @@ -886,12 +886,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) if (m_pPalette == NULL) { return FALSE; } - FX_BYTE gray[2]; + uint8_t gray[2]; for (int i = 0; i < 2; i ++) { - int r = (FX_BYTE)(m_pPalette[i] >> 16); - int g = (FX_BYTE)(m_pPalette[i] >> 8); - int b = (FX_BYTE)m_pPalette[i]; - gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b); + int r = (uint8_t)(m_pPalette[i] >> 16); + int g = (uint8_t)(m_pPalette[i] >> 8); + int b = (uint8_t)m_pPalette[i]; + gray[i] = (uint8_t)FXRGB2GRAY(r, g, b); } CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap; if (!pMask) { @@ -920,12 +920,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) if (m_pPalette == NULL) { return FALSE; } - FX_BYTE gray[256]; + uint8_t gray[256]; for (int i = 0; i < 256; i ++) { - int r = (FX_BYTE)(m_pPalette[i] >> 16); - int g = (FX_BYTE)(m_pPalette[i] >> 8); - int b = (FX_BYTE)m_pPalette[i]; - gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b); + int r = (uint8_t)(m_pPalette[i] >> 16); + int g = (uint8_t)(m_pPalette[i] >> 8); + int b = (uint8_t)m_pPalette[i]; + gray[i] = (uint8_t)FXRGB2GRAY(r, g, b); } CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap; if (!pMask) { @@ -1111,13 +1111,13 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color) } break; case FXDIB_8bppMask: - *pos = (FX_BYTE)(color >> 24); + *pos = (uint8_t)(color >> 24); break; case FXDIB_8bppRgb: { if (m_pPalette) { for (int i = 0; i < 256; i ++) { if (m_pPalette[i] == color) { - *pos = (FX_BYTE)i; + *pos = (uint8_t)i; return; } } @@ -1246,7 +1246,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) int size = 1 << m_bpp; if (isCmykImage) { for (int i = 0; i < size; i ++) { - FX_BYTE b, g, r; + uint8_t b, g, r; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(m_pPalette[i]), FXSYS_GetMValue(m_pPalette[i]), FXSYS_GetYValue(m_pPalette[i]), FXSYS_GetKValue(m_pPalette[i]), r, g, b); int gray = 255 - FXRGB2GRAY(r, g, b); @@ -1266,7 +1266,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) for (int row = 0; row < m_Height; row ++) { FX_LPBYTE scanline = m_pBuffer + row * m_Pitch; for (int col = 0; col < m_Width; col ++) { - FX_BYTE b, g, r; + uint8_t b, g, r; AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3], r, g, b); *scanline ++ = 0; @@ -1295,7 +1295,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) for (int row = 0; row < m_Height; row ++) { FX_LPBYTE scanline = m_pBuffer + row * m_Pitch; for (int col = 0; col < m_Width; col ++) { - FX_BYTE b, g, r; + uint8_t b, g, r; AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3], r, g, b); int gray = 255 - FXRGB2GRAY(r, g, b); @@ -1335,11 +1335,11 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_ if (pRect) { rect.Intersect(*pRect); } - FX_BYTE translate[256]; + uint8_t translate[256]; for (int i = 0; i < 256; i ++) { int err2 = 65536; for (int j = 0; j < pal_size; j ++) { - FX_BYTE entry = (FX_BYTE)pPalette[j]; + uint8_t entry = (uint8_t)pPalette[j]; int err = (int)entry - i; if (err * err < err2) { err2 = err * err; @@ -1353,7 +1353,7 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_ for (int col = rect.left; col < rect.right; col ++) { int src_pixel = scan[col]; int dest_pixel = translate[src_pixel]; - scan[col] = (FX_BYTE)dest_pixel; + scan[col] = (uint8_t)dest_pixel; int error = -dest_pixel + src_pixel; if (col < rect.right - 1) { int src = scan[col + 1]; @@ -1522,11 +1522,11 @@ void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc) m_Width = pSrc->GetWidth(); m_Height = pSrc->GetHeight(); FXDIB_Format format = GetDestFormat(); - m_bpp = (FX_BYTE)format; - m_AlphaFlag = (FX_BYTE)(format >> 8); + m_bpp = (uint8_t)format; + m_AlphaFlag = (uint8_t)(format >> 8); m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4; m_pPalette = GetDestPalette(); - m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); + m_pScanline = FX_Alloc(uint8_t, m_Pitch); } FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const { @@ -1641,7 +1641,7 @@ FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause) if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) { if (m_AlphaFlag >> 8) { - m_AlphaFlag = (((FX_BYTE)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8)); + m_AlphaFlag = (((uint8_t)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8)); } else { m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha); } diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index a9a1e66d99..7d91cdba4b 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -259,7 +259,7 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineM m_Status = 3; return TRUE; } -FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r, +uint8_t _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r, int src_col_l, int src_col_r, int res_x, int res_y, int bpp, int c_offset) { @@ -272,23 +272,23 @@ FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r, FX_LPCBYTE src_pos1 = buf_u + col_bpp_r; FX_LPCBYTE src_pos2 = buf_d + col_bpp_l; FX_LPCBYTE src_pos3 = buf_d + col_bpp_r; - FX_BYTE r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8; - FX_BYTE r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8; + uint8_t r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8; + uint8_t r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8; return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8; } -FX_BYTE _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y, +uint8_t _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y, int bpp, int c_offset) { int s_result = 0; for (int i = 0; i < 4; i ++) { int a_result = 0; for (int j = 0; j < 4; j ++) { - a_result += u_w[j] * (*(FX_BYTE*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset)); + a_result += u_w[j] * (*(uint8_t*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset)); } s_result += a_result * v_w[i]; } s_result >>= 16; - return (FX_BYTE)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result); + return (uint8_t)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result); } void _bicubic_get_pos_weight(int pos_pixel[], int u_w[], int v_w[], int src_col_l, int src_row_l, int res_x, int res_y, int stretch_width, int stretch_height) @@ -390,7 +390,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row); + uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -419,7 +419,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row); + uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -441,7 +441,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else { CPDF_FixedMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row); + uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col, src_row; result2stretch_fix.Transform(col, row, src_col, src_row); @@ -555,7 +555,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -578,9 +578,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) int row_offset_r = src_row_r * stretch_pitch; FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)]; if (transformF == FXDIB_Rgba) { - dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24); - dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16); - dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8); + dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24); + dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); + dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { *(FX_DWORD*)dest_pos = r_bgra_cmyk; } @@ -591,7 +591,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -607,9 +607,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height); FX_DWORD r_bgra_cmyk = argb[_bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)]; if (transformF == FXDIB_Rgba) { - dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24); - dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16); - dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8); + dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24); + dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); + dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { *(FX_DWORD*)dest_pos = r_bgra_cmyk; } @@ -620,7 +620,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else { CPDF_FixedMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col, src_row; result2stretch_fix.Transform(col, row, src_col, src_row); @@ -633,9 +633,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } FX_DWORD r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]]; if (transformF == FXDIB_Rgba) { - dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24); - dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16); - dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8); + dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24); + dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); + dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { *(FX_DWORD*)dest_pos = r_bgra_cmyk; } @@ -650,7 +650,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -671,9 +671,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } int row_offset_l = src_row_l * stretch_pitch; int row_offset_r = src_row_r * stretch_pitch; - FX_BYTE r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2); - FX_BYTE r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1); - FX_BYTE r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0); + uint8_t r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2); + uint8_t r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1); + uint8_t r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0); if (bHasAlpha) { if (transformF != FXDIB_Argb) { if (transformF == FXDIB_Rgba) { @@ -685,7 +685,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } } else { - FX_BYTE r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3); + uint8_t r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3); *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } } else { @@ -704,7 +704,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -718,9 +718,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) src_row_l--; } _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height); - FX_BYTE r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2); - FX_BYTE r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1); - FX_BYTE r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0); + uint8_t r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2); + uint8_t r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1); + uint8_t r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0); if (bHasAlpha) { if (transformF != FXDIB_Argb) { if (transformF == FXDIB_Rgba) { @@ -732,7 +732,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } } else { - FX_BYTE r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3); + uint8_t r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3); *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } } else { @@ -751,7 +751,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else { CPDF_FixedMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row); + uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col, src_row; result2stretch_fix.Transform(col, row, src_col, src_row); diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp index d044d721e6..4cfa95b881 100644 --- a/core/src/fxge/ge/fx_ge.cpp +++ b/core/src/fxge/ge/fx_ge.cpp @@ -64,7 +64,7 @@ void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue) gammaValue /= 2.2f; int i = 0; while (i < 256) { - m_GammaValue[i] = (FX_BYTE)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f); + m_GammaValue[i] = (uint8_t)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f); i++; } } diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp index 9c268b5606..0b4ffd5f4c 100644 --- a/core/src/fxge/ge/fx_ge_device.cpp +++ b/core/src/fxge/ge/fx_ge_device.cpp @@ -125,7 +125,7 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) { - FX_BYTE fill_alpha, stroke_alpha; + uint8_t fill_alpha, stroke_alpha; if (FXGETFLAG_COLORTYPE(alpha_flag)) { fill_alpha = FXGETFLAG_ALPHA_FILL(alpha_flag); stroke_alpha = FXGETFLAG_ALPHA_STROKE(alpha_flag); diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index 46eecff323..4c6da4edc3 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -137,9 +137,9 @@ extern "C" { { } }; -FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream, FX_INT32 faceIndex = 0) +FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream, int32_t faceIndex = 0) { - FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(FX_BYTE, sizeof (FXFT_StreamRec)); + FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(uint8_t, sizeof (FXFT_StreamRec)); stream1->base = NULL; stream1->size = (unsigned long)pFile->GetSize(); stream1->pos = 0; @@ -209,7 +209,7 @@ static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size) } FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size) { - m_pFontDataAllocation = FX_Alloc(FX_BYTE, size); + m_pFontDataAllocation = FX_Alloc(uint8_t, size); FXSYS_memcpy32(m_pFontDataAllocation, data, size); m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size); m_pFontData = (FX_LPBYTE)m_pFontDataAllocation; diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index acae306d6f..4df7def3b9 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -38,7 +38,7 @@ CTTFontDesc::~CTTFontDesc() FX_Free(m_pFontData); } } -FX_INT32 CTTFontDesc::ReleaseFace(FXFT_Face face) +int32_t CTTFontDesc::ReleaseFace(FXFT_Face face) { if (m_Type == 1) { if (m_SingleFace.m_pFace != face) { @@ -582,7 +582,7 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont) CFX_ByteString result; FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0); if (size) { - FX_LPBYTE buffer = FX_Alloc(FX_BYTE, size); + FX_LPBYTE buffer = FX_Alloc(uint8_t, size); m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size); result = _FPDF_GetNameFromTT(buffer, 6); FX_Free(buffer); @@ -661,7 +661,7 @@ CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_na return match; } typedef struct _CHARSET_MAP_ { - FX_BYTE charset; + uint8_t charset; FX_WORD codepage; } CHARSET_MAP; static const CHARSET_MAP g_Codepage2CharsetTable[] = { @@ -697,11 +697,11 @@ static const CHARSET_MAP g_Codepage2CharsetTable[] = { { 88, 10029 }, { 89, 10007 }, }; -FX_BYTE _GetCharsetFromCodePage(FX_WORD codepage) +uint8_t _GetCharsetFromCodePage(FX_WORD codepage) { - FX_INT32 iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1; + int32_t iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; + int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; const CHARSET_MAP & cp = g_Codepage2CharsetTable[iMid]; @@ -841,7 +841,7 @@ static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle) }; typedef struct _FX_FontStyle { FX_LPCSTR style; - FX_INT32 len; + int32_t len; } FX_FontStyle; const FX_FontStyle g_FontStyles[] = { { "Bold", 4 }, @@ -865,9 +865,9 @@ CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex) } return buf.GetByteString(); } -FX_INT32 GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert) +int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert) { - FX_INT32 iLen = bsStyle.GetLength(); + int32_t iLen = bsStyle.GetLength(); if (!iLen) { return -1; } @@ -985,7 +985,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru } if (!bHasHypen) { int nLen = family.GetLength(); - FX_INT32 nRet = GetStyleType(family, TRUE); + int32_t nRet = GetStyleType(family, TRUE); if (nRet > -1) { family = family.Left(nLen - g_FontStyles[nRet].len); if (nRet == 0) { @@ -1017,7 +1017,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru CFX_ByteString buf; while (i < nLen) { buf = ParseStyle(pStyle, nLen, i); - FX_INT32 nRet = GetStyleType(buf, FALSE); + int32_t nRet = GetStyleType(buf, FALSE); if ((i && !bStyleAvail) || (!i && nRet < 0)) { family = SubstName; iBaseFont = 12; @@ -1218,7 +1218,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru } FXFT_Face face = NULL; if (ttc_size) { - FX_BYTE temp[1024]; + uint8_t temp[1024]; m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024); FX_DWORD checksum = 0; for (int i = 0; i < 256; i ++) { @@ -1227,7 +1227,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru FX_LPBYTE pFontData; face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData); if (face == NULL) { - pFontData = FX_Alloc(FX_BYTE, ttc_size); + pFontData = FX_Alloc(uint8_t, ttc_size); m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size); face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size, ttc_size - font_size); @@ -1236,7 +1236,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru FX_LPBYTE pFontData; face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData); if (face == NULL) { - pFontData = FX_Alloc(FX_BYTE, font_size); + pFontData = FX_Alloc(uint8_t, font_size); m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size); face = m_pFontMgr->AddCachedFace(SubstName, weight, bItalic, pFontData, font_size, m_pFontInfo->GetFaceIndex(hFont)); } @@ -1303,7 +1303,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl }
FXFT_Face face = NULL;
if (ttc_size) {
- FX_BYTE temp[1024];
+ uint8_t temp[1024];
m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024);
FX_DWORD checksum = 0;
for (int i = 0; i < 256; i ++) {
@@ -1312,7 +1312,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl FX_LPBYTE pFontData;
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, ttc_size);
+ pFontData = FX_Alloc(uint8_t, ttc_size);
if (pFontData) {
m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size);
face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size,
@@ -1325,7 +1325,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl FX_LPBYTE pFontData;
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, font_size);
+ pFontData = FX_Alloc(uint8_t, font_size);
if (!pFontData) {
m_pFontInfo->DeleteFont(hFont);
return NULL;
@@ -1454,7 +1454,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path) } FXSYS_fseek(pFile, 0, FXSYS_SEEK_END); FX_DWORD filesize = FXSYS_ftell(pFile); - FX_BYTE buffer[16]; + uint8_t buffer[16]; FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET); size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile); if (readCnt != 1) { @@ -1469,7 +1469,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path) return; } FX_DWORD face_bytes = nFaces * 4; - FX_LPBYTE offsets = FX_Alloc(FX_BYTE, face_bytes); + FX_LPBYTE offsets = FX_Alloc(uint8_t, face_bytes); readCnt = FXSYS_fread(offsets, face_bytes, 1, pFile); if (readCnt != face_bytes) { FX_Free(offsets); diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp index ad0a70ab1f..5a0f0dffa5 100644 --- a/core/src/fxge/ge/fx_ge_linux.cpp +++ b/core/src/fxge/ge/fx_ge_linux.cpp @@ -56,7 +56,7 @@ static const FX_LPCSTR g_LinuxB5FontList[] = { static const FX_LPCSTR g_LinuxHGFontList[] = { "UnDotum", }; -static FX_INT32 GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family) +static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family) { CFX_ByteString face = facearr; if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) { @@ -94,35 +94,35 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p FX_BOOL bCJK = TRUE; switch (charset) { case FXFONT_SHIFTJIS_CHARSET: { - FX_INT32 index = GetJapanesePreference(cstr_face, weight, pitch_family); + int32_t index = GetJapanesePreference(cstr_face, weight, pitch_family); if (index < 0) { break; } - for (FX_INT32 i = 0; i < LINUX_GPNAMESIZE; i++) + for (int32_t i = 0; i < LINUX_GPNAMESIZE; i++) if (m_FontList.Lookup(LinuxGpFontList[index].NameArr[i], p)) { return p; } } break; case FXFONT_GB2312_CHARSET: { - static FX_INT32 s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR); - for (FX_INT32 i = 0; i < s_gbCount; i++) + static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR); + for (int32_t i = 0; i < s_gbCount; i++) if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) { return p; } } break; case FXFONT_CHINESEBIG5_CHARSET: { - static FX_INT32 s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR); - for (FX_INT32 i = 0; i < s_b5Count; i++) + static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR); + for (int32_t i = 0; i < s_b5Count; i++) if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) { return p; } } break; case FXFONT_HANGEUL_CHARSET: { - static FX_INT32 s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR); - for (FX_INT32 i = 0; i < s_hgCount; i++) + static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR); + for (int32_t i = 0; i < s_hgCount; i++) if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) { return p; } @@ -157,9 +157,9 @@ static FX_DWORD _LinuxGetCharset(int charset) } return 0; } -static FX_INT32 _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style) +static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style) { - FX_INT32 iSimilarValue = 0; + int32_t iSimilarValue = 0; if ((style & FXFONT_BOLD) == (weight > 400)) { iSimilarValue += 16; } @@ -181,7 +181,7 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int { CFontFaceInfo* pFind = NULL; FX_DWORD charset_flag = _LinuxGetCharset(charset); - FX_INT32 iBestSimilar = 0; + int32_t iBestSimilar = 0; FX_POSITION pos = m_FontList.GetStartPosition(); while (pos) { CFX_ByteString bsName; @@ -190,8 +190,8 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) { continue; } - FX_INT32 iSimilarValue = 0; - FX_INT32 index = bsName.Find(family); + int32_t iSimilarValue = 0; + int32_t index = bsName.Find(family); if (bMatchName && index < 0) { continue; } diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp index 6522309f37..4ff40211d0 100644 --- a/core/src/fxge/ge/fx_ge_ps.cpp +++ b/core/src/fxge/ge/fx_ge_ps.cpp @@ -93,7 +93,7 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, const CFX_AffineM CFX_ByteTextBuf buf; buf.EstimateSize(nPoints * 10); for (int i = 0; i < nPoints; i ++) { - FX_BYTE flag = pPathData->GetFlag(i); + uint8_t flag = pPathData->GetFlag(i); FX_FLOAT x = pPathData->GetPointX(i); FX_FLOAT y = pPathData->GetPointY(i); if (pObject2Device) { @@ -348,7 +348,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color, if (pSource->GetBPP() == 1 && pSource->GetPalette() == NULL) { int pitch = (width + 7) / 8; FX_DWORD src_size = height * pitch; - FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size); + FX_LPBYTE src_buf = FX_Alloc(uint8_t, src_size); for (int row = 0; row < height; row ++) { FX_LPCBYTE src_scan = pSource->GetScanline(row); FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch); @@ -421,7 +421,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color, if (filter == NULL) { int src_pitch = width * Bpp; output_size = height * src_pitch; - output_buf = FX_Alloc(FX_BYTE, output_size); + output_buf = FX_Alloc(uint8_t, output_size); for (int row = 0; row < height; row ++) { FX_LPCBYTE src_scan = pConverted->GetScanline(row); FX_LPBYTE dest_scan = output_buf + row * src_pitch; diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index 88f2967132..1aabbedd5b 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -78,7 +78,7 @@ static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars) next_origin_f = this_origin_f; } } -static const FX_BYTE g_TextGammaAdjust[256] = { +static const uint8_t g_TextGammaAdjust[256] = { 0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, @@ -97,7 +97,7 @@ static const FX_BYTE g_TextGammaAdjust[256] = { 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254, 255, }; #define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \ - src_alpha = g_TextGammaAdjust[(FX_BYTE)src_alpha]; + src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha]; void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform) { if (pIccTransform == NULL && !FXGETFLAG_COLORTYPE(alpha_flag)) { @@ -107,7 +107,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { pIccTransform = NULL; } - FX_BYTE bgra[4]; + uint8_t bgra[4]; if (pIccTransform) { ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); @@ -441,7 +441,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3; ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a); src_alpha1 = src_alpha1 * a / 255; - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b)); dest_scan += 4; @@ -453,7 +453,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar src_scan += 3; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; + uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1 * 255 / dest_alpha; dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio)); @@ -488,11 +488,11 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar dest_scan += 4; src_scan += 3; } else { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b)); } else { - FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; + uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1 * 255 / dest_alpha; dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio)); @@ -526,7 +526,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar int src_alpha1 = (src_scan[-1] + src_scan[0] + src_scan[1]) / 3; ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a); src_alpha1 = src_alpha1 * a / 255; - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b)); dest_scan += 4; @@ -538,7 +538,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar src_scan += 3; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; + uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1 * 255 / dest_alpha; dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio)); @@ -573,11 +573,11 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar dest_scan += 4; src_scan += 3; } else { - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b)); } else { - FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; + uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1 * 255 / dest_alpha; dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio)); @@ -611,7 +611,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar int src_alpha1 = (src_scan[-2] + src_scan[-1] + src_scan[0]) / 3; ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a); src_alpha1 = src_alpha1 * a / 255; - FX_BYTE back_alpha = dest_scan[3]; + uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b)); dest_scan += 4; @@ -623,7 +623,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar src_scan += 3; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; + uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1 * 255 / dest_alpha; dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio)); @@ -1081,14 +1081,14 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache); } CFX_GlyphBitmap* pGlyphBitmap = NULL; - if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) { + if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) { return pGlyphBitmap; } pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias); if (pGlyphBitmap == NULL) { return NULL; } - pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap); + pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap); return pGlyphBitmap; } const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix, @@ -1135,12 +1135,12 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD CFX_GlyphBitmap* pGlyphBitmap; CFX_SizeGlyphCache* pSizeCache = NULL; if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) { - if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) { + if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) { return pGlyphBitmap; } pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias); if (pGlyphBitmap) { - pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap); + pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap); return pGlyphBitmap; } } else { @@ -1151,7 +1151,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD return NULL; } m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache); - pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap); + pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap); return pGlyphBitmap; } } @@ -1222,7 +1222,7 @@ static const char g_AngleSkew[ANGLESKEW_ARRAY_SIZE] = { 36, 38, 40, 42, 45, 47, 49, 51, 53, 55, }; static const size_t WEIGHTPOW_ARRAY_SIZE = 100; -static const FX_BYTE g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = { +static const uint8_t g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = { 0, 3, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, @@ -1230,7 +1230,7 @@ static const FX_BYTE g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = { 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, }; -static const FX_BYTE g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = { +static const uint8_t g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = { 0, 4, 7, 8, 9, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 39, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, @@ -1238,7 +1238,7 @@ static const FX_BYTE g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = { 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, }; -static const FX_BYTE g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE] = { +static const uint8_t g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE] = { 0, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 26, 28, 30, 32, 33, 35, 37, 39, 41, 43, 45, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55, @@ -1288,7 +1288,7 @@ static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int } else if (temp < 0) { temp = 0; } - *pDstRow ++ = (FX_BYTE)temp; + *pDstRow ++ = (uint8_t)temp; } } } @@ -1381,13 +1381,13 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde pGlyphBitmap->m_Top = FXFT_Get_Glyph_BitmapTop(m_Face); int dest_pitch = pGlyphBitmap->m_Bitmap.GetPitch(); int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(m_Face)); - FX_BYTE* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer(); - FX_BYTE* pSrcBuf = (FX_BYTE*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face)); + uint8_t* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer(); + uint8_t* pSrcBuf = (uint8_t*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face)); if (anti_alias != FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) { int bytes = anti_alias == FXFT_RENDER_MODE_LCD ? 3 : 1; for(int i = 0; i < bmheight; i++) for(int n = 0; n < bmwidth; n++) { - FX_BYTE data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0; + uint8_t data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0; for (int b = 0; b < bytes; b ++) { pDestBuf[i * dest_pitch + n * bytes + b] = data; } @@ -1501,11 +1501,11 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph CFX_PathData* pGlyphPath = NULL; FX_LPVOID key; if (pFont->GetSubstFont()) - key = (FX_LPVOID)(FX_UINTPTR)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) + + key = (FX_LPVOID)(uintptr_t)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) + ((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + ((dest_width / 16) << 25) + (pFont->IsVertical() << 31)); else { - key = (FX_LPVOID)(FX_UINTPTR)glyph_index; + key = (FX_LPVOID)(uintptr_t)glyph_index; } if (m_PathMap.Lookup(key, (FX_LPVOID&)pGlyphPath)) { return pGlyphPath; diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h index c08b3e0630..39f6cb8567 100644 --- a/core/src/fxge/ge/text_int.h +++ b/core/src/fxge/ge/text_int.h @@ -44,7 +44,7 @@ public: FXFT_Face m_pFaces[16]; } m_TTCFace; }; - FX_BYTE* m_pFontData; + uint8_t* m_pFontData; int m_RefCount; }; class CFX_UnicodeEncoding : public IFX_FontEncoding diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp index a107485d72..3b3bd3349c 100644 --- a/core/src/fxge/skia/fx_skia_blitter_new.cpp +++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp @@ -74,13 +74,13 @@ } /*---------------------------------------------------------------------------------------------------*/ void CFX_SkiaRenderer::CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_bRgbByteOrder); ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left/8; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left/8; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -88,7 +88,7 @@ int index = 0; if (m_pDevice->GetPalette() == NULL) - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) @@ -107,14 +107,14 @@ } } void CFX_SkiaRenderer::CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_bRgbByteOrder); ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left/8; - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left/8; + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -122,7 +122,7 @@ int index = 0; if (m_pDevice->GetPalette() == NULL) - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) @@ -143,13 +143,13 @@ } /*-----------------------------------------------------------------------------------------------------*/ void CFX_SkiaRenderer::CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); ASSERT(!m_bRgbByteOrder); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -165,14 +165,14 @@ } } void CFX_SkiaRenderer::CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); ASSERT(!m_bRgbByteOrder); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left; - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left; + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -208,13 +208,13 @@ } void CFX_SkiaRenderer::CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_bRgbByteOrder); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left; - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left; + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -236,14 +236,14 @@ } void CFX_SkiaRenderer::CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left; - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left; - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left; + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left; + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -296,11 +296,11 @@ /*--------------------------------------------------------------------------------------------------*/ void CFX_SkiaRenderer::CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -331,7 +331,7 @@ dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -344,13 +344,13 @@ } void CFX_SkiaRenderer::CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - //ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -393,12 +393,12 @@ } } void CFX_SkiaRenderer::CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -425,7 +425,7 @@ dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1*255/dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -459,7 +459,7 @@ dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -492,7 +492,7 @@ dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha1*255/dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -508,14 +508,14 @@ } void CFX_SkiaRenderer::CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - //ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -558,11 +558,11 @@ /*-----------------------------------------------------------------------------------------------------------*/ void CFX_SkiaRenderer::CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -589,12 +589,12 @@ } } void CFX_SkiaRenderer::CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -628,12 +628,12 @@ } } void CFX_SkiaRenderer::CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -706,14 +706,14 @@ #endif } void CFX_SkiaRenderer::CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2); - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2); + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -785,11 +785,11 @@ } /*-----------------------------------------------------------------------------------------------------*/ void CFX_SkiaRenderer::CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -819,13 +819,13 @@ } } void CFX_SkiaRenderer::CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1); - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left + (span_left<<1); + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1); + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left + (span_left<<1); int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -860,12 +860,12 @@ } } void CFX_SkiaRenderer::CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -940,14 +940,14 @@ #endif } void CFX_SkiaRenderer::CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { ASSERT(!m_pDevice->IsCmykImage()); - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); - ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left+(span_left<<1); - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); + ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left+(span_left<<1); + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -1018,12 +1018,12 @@ #endif } void CFX_SkiaRenderer::CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); - dest_extra_alpha_scan = (FX_BYTE*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); + dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -1031,9 +1031,9 @@ #if 1 if (m_Alpha == 255 && cover_scan == 255) { for (int col = col_start; col < col_end; col ++) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; *dest_extra_alpha_scan++ = 255; } return; @@ -1042,7 +1042,7 @@ for (int col = col_start; col < col_end; col ++) { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; @@ -1057,9 +1057,9 @@ if (m_bFullCover) { if (m_Alpha == 255) { for (int col = col_start; col < col_end; col ++) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; *dest_extra_alpha_scan++ = 255; } return; @@ -1067,7 +1067,7 @@ for (int col = col_start; col < col_end; col ++) { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + m_Alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + m_Alpha - (*dest_extra_alpha_scan) * m_Alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = m_Alpha*255/dest_alpha; @@ -1081,9 +1081,9 @@ } else { if (m_Alpha == 255 && cover_scan == 255) { for (int col = col_start; col < col_end; col ++) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; *dest_extra_alpha_scan++ = 255; } return; @@ -1092,7 +1092,7 @@ for (int col = col_start; col < col_end; col ++) { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; @@ -1107,13 +1107,13 @@ #endif } void CFX_SkiaRenderer::CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { - dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); - dest_extra_alpha_scan = (FX_BYTE*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left; - clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; + dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1); + dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left; + clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left; int col_start = span_left < clip_left ? clip_left - span_left : 0; int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left); if (col_end < col_start) return; // do nothing. @@ -1128,14 +1128,14 @@ continue; } if (src_alpha1 == 255) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; - *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; + *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; } else { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 - (*dest_extra_alpha_scan) * src_alpha1 / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha1*255/dest_alpha; @@ -1157,14 +1157,14 @@ continue; } if (src_alpha == 255) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; - *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; + *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; } else { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; @@ -1186,14 +1186,14 @@ continue; } if (src_alpha1 == 255) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; - *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; + *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; } else { // Dest format: Rgba // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 - (*dest_extra_alpha_scan) * src_alpha1 / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha1*255/dest_alpha; @@ -1212,7 +1212,7 @@ // A general alpha merge function (with clipping mask). Cmyka/Cmyk device. void CFX_SkiaRenderer::CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan) { @@ -1243,11 +1243,11 @@ if (src_alpha) { if (src_alpha == 255) { *(FX_CMYK*)dest_scan = m_Color; - *dest_extra_alpha_scan = (FX_BYTE)m_Alpha; + *dest_extra_alpha_scan = (uint8_t)m_Alpha; } else { // Dest format: Cmyka // calculate destination alpha (it's union of source and dest alpha) - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha*255/dest_alpha; @@ -1351,13 +1351,13 @@ } else { //Gray(a) device if (pIccTransform) { - FX_BYTE gray; + uint8_t gray; color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); pIccModule->TranslateScanline(pIccTransform, &gray, (FX_LPCBYTE)&color, 1); m_Gray = gray; } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Gray = FXRGB2GRAY(r, g, b); @@ -1404,7 +1404,7 @@ } } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Color = FXARGB_MAKE(m_Alpha, r, g, b); @@ -1552,7 +1552,7 @@ col_end = col_end < m_dstWidth ? col_end - m_Left: m_pDevice->GetWidth(); int result = col_end - col_start; if (result > 0) { - FX_BYTE* dest_pos = dest_scan + col_start; + uint8_t* dest_pos = dest_scan + col_start; if (result >= 4) FXSYS_memset32(dest_pos, 0xffffffff,result); else diff --git a/core/src/fxge/skia/fx_skia_blitter_new.h b/core/src/fxge/skia/fx_skia_blitter_new.h index 1193e64c1c..a80e56b2aa 100644 --- a/core/src/fxge/skia/fx_skia_blitter_new.h +++ b/core/src/fxge/skia/fx_skia_blitter_new.h @@ -30,7 +30,7 @@ protected: FX_LPBYTE m_pOriScan; FX_LPBYTE m_pClipScan; - void (CFX_SkiaRenderer::*composite_span)(FX_LPBYTE,FX_LPBYTE,int,int,int,int,FX_BYTE,int,int,int,FX_LPBYTE,FX_LPBYTE); + void (CFX_SkiaRenderer::*composite_span)(FX_LPBYTE,FX_LPBYTE,int,int,int,int,uint8_t,int,int,int,FX_LPBYTE,FX_LPBYTE); public: //-------------------------------------------------------------------- @@ -43,35 +43,35 @@ public: /*------------------------------------------------------------------------------------------------------*/ // A general alpha merge function (with clipping mask). Gray device. void CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_1(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_5(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_8(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_9(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_12(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpan1bpp_13(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); @@ -79,119 +79,119 @@ public: // A general alpha merge function (with clipping mask). Gray device. void CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanGray_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); /*--------------------------------------------------------------------------------------------------------*/ void CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); // ... /*--------------------------------------------------------------------------------------------------------*/ void CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); /*---------------------------------------------------------------------------------------------------------*/ void CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); void CompositeSpanRGB24_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); @@ -199,7 +199,7 @@ public: // A general alpha merge function (with clipping mask). Cmyka/Cmyk device. void CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, - int span_left, int span_len, int span_top, FX_BYTE cover_scan, + int span_left, int span_len, int span_top, uint8_t cover_scan, int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan, FX_LPBYTE dest_extra_alpha_scan); diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index 3372af103d..7ebdcb380e 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -64,9 +64,9 @@ FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0); if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) { FX_DWORD lVersion = 0; - GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD)); - lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 | - ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24)); + GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD)); + lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 | + ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24)); if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 || lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || @@ -85,9 +85,9 @@ FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0); if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) { FX_DWORD lVersion = 0; - GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD)); - lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 | - ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24)); + GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD)); + lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 | + ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24)); if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 || lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || @@ -145,7 +145,7 @@ FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) lf.lfCharSet = DEFAULT_CHARSET; lf.lfFaceName[0] = 0; lf.lfPitchAndFamily = 0; - EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (FX_UINTPTR)this, 0); + EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (uintptr_t)this, 0); if (pMapper->GetFontEnumerator()) { pMapper->GetFontEnumerator()->Finish(); } @@ -521,7 +521,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de return FALSE; } CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap); - if ((FX_INT64)abs(dest_width) * abs(dest_height) < (FX_INT64)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 || + if ((int64_t)abs(dest_width) * abs(dest_height) < (int64_t)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 || (flags & FXDIB_INTERPOL) || (flags & FXDIB_BICUBIC_INTERPOL)) { SetStretchBltMode(m_hDC, HALFTONE); } else { @@ -529,7 +529,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de } CFX_DIBitmap* pToStrechBitmap = pBitmap; bool del = false; - if (m_DeviceClass == FXDC_PRINTER && ((FX_INT64)pBitmap->GetWidth() * pBitmap->GetHeight() > (FX_INT64)abs(dest_width) * abs(dest_height))) { + if (m_DeviceClass == FXDC_PRINTER && ((int64_t)pBitmap->GetWidth() * pBitmap->GetHeight() > (int64_t)abs(dest_width) * abs(dest_height))) { pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height); del = true; } diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp index 0c6a7e1068..7706ee289e 100644 --- a/core/src/fxge/win32/fx_win32_dib.cpp +++ b/core/src/fxge/win32/fx_win32_dib.cpp @@ -71,7 +71,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL } FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height); if (bBottomUp) { - FX_LPBYTE temp_buf = FX_Alloc(FX_BYTE, pitch); + FX_LPBYTE temp_buf = FX_Alloc(uint8_t, pitch); int top = 0, bottom = height - 1; while (top < bottom) { FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch); @@ -210,7 +210,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP if (bmih.biBitCount == 8) { size += sizeof (FX_DWORD) * 254; } - BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size); + BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(uint8_t, size); pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbmih->bmiHeader.biBitCount = bmih.biBitCount; pbmih->bmiHeader.biCompression = BI_RGB; @@ -246,7 +246,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP if (ret != 0 && bmih.biBitCount == 32) { int pitch = pDIBitmap->GetPitch(); for (int row = 0; row < height; row ++) { - FX_BYTE* dest_scan = (FX_BYTE*)(pDIBitmap->GetBuffer() + row * pitch); + uint8_t* dest_scan = (uint8_t*)(pDIBitmap->GetBuffer() + row * pitch); for (int col = 0; col < width; col++) { dest_scan[3] = 255; dest_scan += 4; diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp index 022325b5ac..2a490a62a4 100644 --- a/core/src/fxge/win32/fx_win32_dwrite.cpp +++ b/core/src/fxge/win32/fx_win32_dwrite.cpp @@ -314,7 +314,7 @@ HRESULT STDMETHODCALLTYPE CDwFontFileStream::ReadFileFragment( { if (fileOffset <= resourceSize_ && fragmentSize <= resourceSize_ - fileOffset) { - *fragmentStart = static_cast<FX_BYTE const*>(resourcePtr_) + static_cast<size_t>(fileOffset); + *fragmentStart = static_cast<uint8_t const*>(resourcePtr_) + static_cast<size_t>(fileOffset); *fragmentContext = NULL; return S_OK; } else { diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index d2aafe09d5..fd31d2da66 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -220,7 +220,7 @@ typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIP typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *graphics, InterpolationMode interpolationMode); typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count); typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BITMAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap); -typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT FX_UINTPTR *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output); +typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT uintptr_t *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output); typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPen *pen, int x1, int y1, int x2, int y2); typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics); typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpPath **path); @@ -509,7 +509,7 @@ void CGdiplusExt::Load() return; } } - FX_UINTPTR gdiplusToken; + uintptr_t gdiplusToken; GdiplusStartupInput gdiplusStartupInput; ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL); m_GdiModule = LoadLibraryA("GDI32.DLL"); @@ -1047,7 +1047,7 @@ public: bytes_left = m_InterStream.GetLength() - m_ReadPos; bytes_out = FX_MIN(cb, bytes_left); FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out); - m_ReadPos += (FX_INT32)bytes_out; + m_ReadPos += (int32_t)bytes_out; if (pcbRead != NULL) { *pcbRead = (ULONG)bytes_out; } diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 149df5058c..4ebeab9023 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -303,7 +303,7 @@ FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) if (ret == 1) { ret = ::GetRegionData(hRgn, 0, NULL); if (ret) { - RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret); + RGNDATA* pData = (RGNDATA*)FX_Alloc(uint8_t, ret); ret = ::GetRegionData(hRgn, ret, pData); if (ret) { CFX_PathData path; diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h index 7c5c0720b1..a3380f3b5b 100644 --- a/core/src/fxge/win32/win32_int.h +++ b/core/src/fxge/win32/win32_int.h @@ -29,7 +29,7 @@ public: int fill_mode ); - void* LoadMemFont(FX_BYTE* pData, FX_DWORD size); + void* LoadMemFont(uint8_t* pData, FX_DWORD size); void DeleteMemFont(void* pFontCollection); FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics); void GdipDeleteGraphics(void* graphics); diff --git a/core/src/reflow/autoreflow.cpp b/core/src/reflow/autoreflow.cpp index 8c37960932..77d60c4efa 100644 --- a/core/src/reflow/autoreflow.cpp +++ b/core/src/reflow/autoreflow.cpp @@ -416,7 +416,7 @@ void CPDF_AutoReflowLayoutProvider::GenerateParagraph(CFX_PtrArray& cellArray) void CPDF_AutoReflowLayoutProvider::ProcessObj(CFX_PtrArray& cellArray, CPDF_PageObject* pObj, CFX_AffineMatrix matrix) { } -FX_INT32 CPDF_AutoReflowLayoutProvider::LogicPreObj(CPDF_PageObject* pObj) +int32_t CPDF_AutoReflowLayoutProvider::LogicPreObj(CPDF_PageObject* pObj) { CPDF_PageObject* pPreObj = m_pPreObj; m_pPreObj = pObj; diff --git a/core/src/reflow/autoreflow.h b/core/src/reflow/autoreflow.h index 95aebcfcdc..20babd72da 100644 --- a/core/src/reflow/autoreflow.h +++ b/core/src/reflow/autoreflow.h @@ -105,7 +105,7 @@ public: int GetRectHeight(FX_RECT rect); int GetRectWidth(FX_RECT rect); void ProcessObj(CFX_PtrArray& cellArray, CPDF_PageObject* pObj, CFX_AffineMatrix matrix); - FX_INT32 LogicPreObj(CPDF_PageObject* pObj); + int32_t LogicPreObj(CPDF_PageObject* pObj); CPDF_AutoReflowElement* m_pRoot; CPDF_AutoReflowElement* m_pCurrElm; diff --git a/core/src/reflow/layoutprocessor_reflow.cpp b/core/src/reflow/layoutprocessor_reflow.cpp index d2fa7e9371..371f47e19c 100644 --- a/core/src/reflow/layoutprocessor_reflow.cpp +++ b/core/src/reflow/layoutprocessor_reflow.cpp @@ -407,10 +407,10 @@ FX_BOOL IsSameLine(FX_BOOL bHorizontal, CFX_FloatRect Rect1, CFX_FloatRect Rect2 } return TRUE; } -FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElement* pNextElement) +int32_t IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElement* pNextElement) { - FX_INT32 analogial = 100; - FX_INT32 nPrevObj = pPrevElement->CountObjects(), i; + int32_t analogial = 100; + int32_t nPrevObj = pPrevElement->CountObjects(), i; CPDF_PageObject* pPrevObj = NULL; CFX_FloatRect prevRect, rect; CFX_PtrArray prevLine, line; @@ -449,7 +449,7 @@ FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElemen CPDF_PageObject* pObj = pPrevElement->GetObject(nPrevObj - 1); if(pObj->m_Type == PDFPAGE_TEXT) { CPDF_TextObject* pText = (CPDF_TextObject*)pObj; - FX_INT32 nItem = pText->CountItems(); + int32_t nItem = pText->CountItems(); CPDF_TextObjectItem item; pText->GetItemInfo(nItem - 1, &item); CFX_WideString wStr = pText->GetFont()->UnicodeFromCharCode(item.m_CharCode); @@ -471,7 +471,7 @@ FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElemen prevLine.RemoveAll(); prevLine.Append(line); line.RemoveAll(); - FX_INT32 nNextObj = pNextElement->CountObjects(); + int32_t nNextObj = pNextElement->CountObjects(); pPrevObj = NULL; FX_BOOL bFirst = TRUE; for(i = 0; i < nNextObj; i++) { @@ -522,7 +522,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F } if(m_Status == LayoutReady) { LayoutType layoutType = pElement->GetType(); - FX_INT32 ElementType = GetElementTypes(layoutType); + int32_t ElementType = GetElementTypes(layoutType); switch(ElementType) { case SST_IE: m_bIllustration = TRUE; @@ -645,7 +645,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F if(m_Status == LayoutReady) { FX_FLOAT dx = 0; LayoutType layoutType = pElement->GetType(); - FX_INT32 ElementType = GetElementTypes(layoutType); + int32_t ElementType = GetElementTypes(layoutType); switch(ElementType) { case SST_IE: m_bIllustration = FALSE; @@ -711,7 +711,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F m_PausePosition = 100; } } -FX_INT32 CPDF_LayoutProcessor_Reflow::GetElementTypes(LayoutType layoutType) +int32_t CPDF_LayoutProcessor_Reflow::GetElementTypes(LayoutType layoutType) { switch(layoutType) { case LayoutParagraph: @@ -1210,7 +1210,7 @@ int CPDF_LayoutProcessor_Reflow::ProcessInsertObject(CPDF_TextObject* pObj, CFX_ } return 0; } -FX_INT32 CPDF_LayoutProcessor_Reflow::LogicPreObj(CPDF_TextObject* pObj) +int32_t CPDF_LayoutProcessor_Reflow::LogicPreObj(CPDF_TextObject* pObj) { CPDF_TextObject* pPreObj = m_pPreObj; m_pPreObj = pObj; @@ -1347,7 +1347,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessTextObject(CPDF_TextObject *pTextObj, F return; } CPDF_PageObject* pPreObj = m_pPreObj; - FX_INT32 logic = ProcessInsertObject(pTextObj, objMatrix); + int32_t logic = ProcessInsertObject(pTextObj, objMatrix); m_pPreObj = pTextObj; m_perMatrix.Copy(objMatrix); int size = m_pTempLine->GetSize(); @@ -1542,7 +1542,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessUnitaryObjs(CPDF_PageObjects *pObjs, FX while(pos) { CPDF_PageObject* pObj = pObjs->GetNextObject(pos); if(pObj->m_Type == PDFPAGE_TEXT) { - FX_INT32 ret = LogicPreObj((CPDF_TextObject*)pObj); + int32_t ret = LogicPreObj((CPDF_TextObject*)pObj); if(ret == 1 || ret == 2) { continue; } diff --git a/core/src/reflow/reflowedpage.cpp b/core/src/reflow/reflowedpage.cpp index 11baef8718..b7048b6840 100644 --- a/core/src/reflow/reflowedpage.cpp +++ b/core/src/reflow/reflowedpage.cpp @@ -151,14 +151,14 @@ CPDF_Dictionary* CPDF_ReflowedPage::GetFormResDict(CPDF_PageObject* pObj) } return pPageInfo->GetFormDict(); } -void CPDF_ReflowedPage::GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix) +void CPDF_ReflowedPage::GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix) { CFX_AffineMatrix display_matrix; if(m_PageHeight == 0) { matrix.Set(1, 0, 0, -1, 0, 0); return; } - FX_INT32 x0, y0, x1, y1, x2, y2; + int32_t x0, y0, x1, y1, x2, y2; iRotate %= 4; switch (iRotate) { case 0: @@ -207,7 +207,7 @@ FX_FLOAT CPDF_ReflowedPage::GetPageHeight() { return m_PageHeight; } -void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str) +void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str) { if (NULL == m_pReflowed) { return; @@ -218,8 +218,8 @@ void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, revMatrix.Transform((float)x, (float)y, x1, y1); int count = m_pReflowed->GetSize(); FX_FLOAT dx = 1000, dy = 1000; - FX_INT32 pos = 0; - FX_INT32 i; + int32_t pos = 0; + int32_t i; for(i = 0; i < count; i++) { CRF_Data* pData = (*m_pReflowed)[i]; FX_FLOAT tempdy = FXSYS_fabs(pData->m_PosY - y1); @@ -266,12 +266,12 @@ void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, } str.Format("%d", pos); } -FX_BOOL CPDF_ReflowedPage::FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y) +FX_BOOL CPDF_ReflowedPage::FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y) { if (NULL == m_pReflowed) { return FALSE; } - FX_INT32 pos = FXSYS_atoi(str); + int32_t pos = FXSYS_atoi(str); if(pos < 0 || pos >= m_pReflowed->GetSize()) { return FALSE; } @@ -426,7 +426,7 @@ CPDF_ProgressiveReflowPageRender::CPDF_ProgressiveReflowPageRender() m_pFontEncoding = NULL; m_DisplayColor = -1; } -static FX_FLOAT _CIDTransformToFloat(FX_BYTE ch) +static FX_FLOAT _CIDTransformToFloat(uint8_t ch) { if (ch < 128) { return ch * 1.0f / 127; diff --git a/core/src/reflow/reflowedpage.h b/core/src/reflow/reflowedpage.h index 3fef553d7a..79b4937bdb 100644 --- a/core/src/reflow/reflowedpage.h +++ b/core/src/reflow/reflowedpage.h @@ -48,14 +48,14 @@ protected: void ProcessTextObject(CPDF_TextObject *pObj, FX_FLOAT reflowWidth, CFX_AffineMatrix objMatrix); void ProcessPathObject(CPDF_PathObject *pObj, FX_FLOAT reflowWidth); void ProcessUnitaryObjs(CPDF_PageObjects *pObjs, FX_FLOAT reflowWidth, CFX_AffineMatrix objMatrix); - FX_INT32 LogicPreObj(CPDF_TextObject* pObj); + int32_t LogicPreObj(CPDF_TextObject* pObj); int ProcessInsertObject(CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix); FX_WCHAR GetPreChar(); FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2); int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const; FX_BOOL IsCanBreakAfter(FX_DWORD unicode); FX_BOOL IsCanBreakBefore(FX_DWORD unicode); - FX_INT32 GetElementTypes(LayoutType layoutType); + int32_t GetElementTypes(LayoutType layoutType); void CreateRFData(CPDF_PageObject* pObj, CFX_AffineMatrix* pMatrix = NULL); CRF_CharState* GetCharState(CPDF_TextObject* pObj, CPDF_Font* pFont, FX_FLOAT fHeight, FX_ARGB color); FX_FLOAT ConverWidth(FX_FLOAT width); @@ -169,15 +169,15 @@ public: { return this; }; - void GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix); + void GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix); FX_FLOAT GetPageHeight() ; FX_FLOAT GetPageWidth() { return m_PageWidth; }; - void FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str); - FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y); + void FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str); + FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y); CRF_DataPtrArray* m_pReflowed; FX_FLOAT m_PageWidth; FX_FLOAT m_PageHeight; diff --git a/core/src/reflow/reflowedtextpage.h b/core/src/reflow/reflowedtextpage.h index 288ceed48b..bb6e24a9cd 100644 --- a/core/src/reflow/reflowedtextpage.h +++ b/core/src/reflow/reflowedtextpage.h @@ -11,7 +11,7 @@ #include "../../src/reflow/reflowedpage.h" typedef CFX_SegmentedArray<CRF_CharData*> CRF_CharDataPtrArray; -typedef CFX_SegmentedArray<FX_INT32> CFX_CountBSINT32Array; +typedef CFX_SegmentedArray<int32_t> CFX_CountBSINT32Array; class CRF_TextPage : public IPDF_TextPage { public: diff --git a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h index 5e596657ec..a51e9efbe1 100644 --- a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h +++ b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h @@ -29,12 +29,12 @@ public: void SetAPType(const CFX_ByteString& sAPType); protected: - virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset); + virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset); virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); virtual CPDF_Document* GetDocument(); private: CPDF_Font* FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias, - FX_INT32 nCharset); + int32_t nCharset); CPDF_Font* GetAnnotDefaultFont(CFX_ByteString &csNameTag); void AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias); diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h index 6e3e58139d..7b5f119f50 100644 --- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h @@ -67,15 +67,15 @@ public: virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); public: - virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet); - virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, + virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet); + virtual void 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); virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ; virtual void OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow); - virtual void OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString & strChange, + virtual void 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); virtual void OnPopupPreOpen(void* pPrivateData, FX_BOOL& bExit, FX_DWORD nFlag); virtual void OnPopupPostOpen(void* pPrivateData, FX_BOOL& bExit, FX_DWORD nFlag); diff --git a/fpdfsdk/include/formfiller/FFL_Notify.h b/fpdfsdk/include/formfiller/FFL_Notify.h index 4e66c3a991..ae7b3dcf9b 100644 --- a/fpdfsdk/include/formfiller/FFL_Notify.h +++ b/fpdfsdk/include/formfiller/FFL_Notify.h @@ -50,7 +50,7 @@ private: CFFL_FormFiller * m_pFormFiller; FX_BOOL m_bDoActioning; - FX_INT32 m_nNotifyFlag; + int32_t m_nNotifyFlag; }; #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_NOTIFY_H_ diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h index 37a7ec17a5..1a8a6b41b0 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h @@ -49,19 +49,19 @@ public: }
void Beep(FX_DWORD dwType) override;
- FX_INT32 MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIconType, FX_DWORD dwButtonType) override;
+ int32_t MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIconType, FX_DWORD dwButtonType) override;
void Response(CFX_WideString &wsAnswer, FX_WSTR wsQuestion, FX_WSTR wsTitle,
FX_WSTR wsDefaultAnswer, FX_BOOL bMark) override;
- FX_INT32 GetDocumentCountInBatch() override;
- FX_INT32 GetCurDocumentInBatch() override;
+ int32_t GetDocumentCountInBatch() override;
+ int32_t GetCurDocumentInBatch() override;
IFX_FileRead* DownloadURL(FX_WSTR wsURL) override;
FX_BOOL PostRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsContentType,
FX_WSTR wsEncode, FX_WSTR wsHeader, CFX_WideString &wsResponse) override;
FX_BOOL PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsEncode) override;
- void LoadString(FX_INT32 iStringID, CFX_WideString &wsString) override;
+ void LoadString(int32_t iStringID, CFX_WideString &wsString) override;
FX_BOOL ShowFileDialog(FX_WSTR wsTitle, FX_WSTR wsFilter, CFX_WideStringArray &wsPathArr, FX_BOOL bOpen) override;
IFWL_AdapterTimerMgr* GetTimerMgr() override;
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h index 9158b8236a..d8cda3953f 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h @@ -62,9 +62,9 @@ public: virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}
//host method
- virtual FX_INT32 CountPages(IXFA_Doc* hDoc);
- virtual FX_INT32 GetCurrentPage(IXFA_Doc* hDoc);
- virtual void SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage);
+ virtual int32_t CountPages(IXFA_Doc* hDoc);
+ virtual int32_t GetCurrentPage(IXFA_Doc* hDoc);
+ virtual void SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage);
virtual FX_BOOL IsCalculationsEnabled(IXFA_Doc* hDoc);
virtual void SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
virtual void GetTitle(IXFA_Doc* hDoc, CFX_WideString &wsTitle);
@@ -75,17 +75,17 @@ public: virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc);
virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget);
- virtual void Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);
+ virtual void Print(IXFA_Doc* hDoc, int32_t nStartPage, int32_t nEndPage, FX_DWORD dwOptions);
//LayoutPseudo method
- virtual FX_INT32 AbsPageCountInBatch(IXFA_Doc* hDoc){return 0;}
- virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
- virtual FX_INT32 SheetCountInBatch(IXFA_Doc* hDoc){return 0;}
- virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
+ virtual int32_t AbsPageCountInBatch(IXFA_Doc* hDoc){return 0;}
+ virtual int32_t AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
+ virtual int32_t SheetCountInBatch(IXFA_Doc* hDoc){return 0;}
+ virtual int32_t SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
//SignaturePseudoModel method
//TODO:
- virtual FX_INT32 Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}
+ virtual int32_t Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}
virtual FX_BOOL Sign(IXFA_Doc* hDoc, CXFA_NodeList* pNodeList, FX_WSTR wsExpression, FX_WSTR wsXMLIdent, FX_WSTR wsValue = FX_WSTRC(L"open"), FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) {return 0;}
virtual CXFA_NodeList* Enumerate(IXFA_Doc* hDoc) {return 0;}
virtual FX_BOOL Clear(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bCleared = TRUE) {return 0;}
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h index 6c3d15e4f1..9676b1399f 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h @@ -23,7 +23,7 @@ public: virtual FWL_ERR Stop(FWL_HTIMER hTimer);
protected:
- static void TimerProc(FX_INT32 idEvent);
+ static void TimerProc(int32_t idEvent);
static CFX_PtrArray ms_timerArray;
CPDFDoc_Environment* m_pEnv;
@@ -37,7 +37,7 @@ public: {
}
- FX_UINT32 uIDEvent;
+ uint32_t uIDEvent;
IFWL_Timer *pTimer;
};
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h index d2ce977a6c..04b384d596 100644 --- a/fpdfsdk/include/fsdk_baseannot.h +++ b/fpdfsdk/include/fsdk_baseannot.h @@ -58,14 +58,14 @@ public: struct FX_DATETIME { - FX_SHORT year; - FX_BYTE month; - FX_BYTE day; - FX_BYTE hour; - FX_BYTE minute; - FX_BYTE second; - FX_INT8 tzHour; - FX_BYTE tzMinute; + int16_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; + int8_t tzHour; + uint8_t tzMinute; }dt; }; diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index 67c67fc37a..88192aad31 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -156,8 +156,8 @@ public: void ClearAppModified(); FX_BOOL IsAppModified() const; - FX_INT32 GetAppearanceAge() const; - FX_INT32 GetValueAge() const; + int32_t GetAppearanceAge() const; + int32_t GetValueAge() const; private: void ResetAppearance_PushButton(); @@ -189,8 +189,8 @@ public: private: CPDFSDK_InterForm* m_pInterForm; FX_BOOL m_bAppModified; - FX_INT32 m_nAppAge; - FX_INT32 m_nValueAge; + int32_t m_nAppAge; + int32_t m_nValueAge; IXFA_Widget* m_hMixXFAWidget; IXFA_WidgetHandler* m_pWidgetHandler; @@ -317,13 +317,13 @@ private: public: FX_BOOL IsNeedHighLight(int nFieldType); void RemoveAllHighLight(); - void SetHighlightAlpha(FX_BYTE alpha) {m_iHighlightAlpha = alpha;} - FX_BYTE GetHighlightAlpha() {return m_iHighlightAlpha;} + void SetHighlightAlpha(uint8_t alpha) {m_iHighlightAlpha = alpha;} + uint8_t GetHighlightAlpha() {return m_iHighlightAlpha;} void SetHighlightColor(FX_COLORREF clr, int nFieldType); FX_COLORREF GetHighlightColor(int nFieldType); private: FX_COLORREF m_aHighlightColor[7]; - FX_BYTE m_iHighlightAlpha; + uint8_t m_iHighlightAlpha; FX_BOOL m_bNeedHightlight[7]; }; diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index fd6beca527..12ef8133a2 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -84,13 +84,13 @@ public: virtual CFX_ByteString GetFullPath() { return ""; } virtual FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } - virtual FX_BOOL GetByte(FX_DWORD pos, FX_BYTE& ch); + virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch); virtual FX_BOOL GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size); virtual void Release() override { delete this; } virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; FPDF_FILEACCESS m_FileAccess; - FX_BYTE m_Buffer[512]; + uint8_t m_Buffer[512]; FX_DWORD m_BufferOffset; }; diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index f8df723ad0..276019eae5 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -9,7 +9,7 @@ typedef FX_LPVOID FX_HWND; typedef FX_LPVOID FX_HMENU; -typedef void (*TimerCallback)(FX_INT32 idEvent); +typedef void (*TimerCallback)(int32_t idEvent); typedef struct _FX_SYSTEMTIME { @@ -52,8 +52,8 @@ public: virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0; - virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0; - virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0; + virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; + virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; /*cursor style FXCT_ARROW @@ -63,20 +63,20 @@ public: FXCT_HBEAM FXCT_HAND */ - virtual void SetCursor(FX_INT32 nCursorType) = 0; + virtual void SetCursor(int32_t nCursorType) = 0; virtual FX_HMENU CreatePopupMenu() = 0; - virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) = 0; - virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) = 0; - virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) = 0; + virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) = 0; + virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) = 0; + virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) = 0; virtual void DestroyMenu(FX_HMENU hMenu) = 0; - virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset) = 0; - virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) = 0; - virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset) = 0; + virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0; + virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName) = 0; + virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset) = 0; - virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) = 0; - virtual void KillTimer(FX_INT32 nID) = 0; + virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0; + virtual void KillTimer(int32_t nID) = 0; virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0; @@ -86,8 +86,8 @@ public: virtual FX_SYSTEMTIME GetLocalTime() = 0; - virtual FX_INT32 GetCharSet() = 0; - virtual void SetCharSet(FX_INT32 nCharSet) = 0; + virtual int32_t GetCharSet() = 0; + virtual void SetCharSet(int32_t nCharSet) = 0; }; #endif // FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 31ede0564b..0da6fe6f9e 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -65,15 +65,15 @@ class IFX_Edit_FontMap public: virtual ~IFX_Edit_FontMap() { } //map a fontindex to pdf font. - virtual CPDF_Font * GetPDFFont(FX_INT32 nFontIndex) = 0; + virtual CPDF_Font * GetPDFFont(int32_t nFontIndex) = 0; //get the alias of a pdf font. - virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0; + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; //get the index of a font that can show a word. - virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0; + virtual int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; //get the charcode of word from unicode - virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) = 0; + virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) = 0; //get the charset of unicode - virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) = 0; + virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) = 0; }; class IFX_Edit_Notify @@ -151,7 +151,7 @@ public: //get the information of the current section. virtual FX_BOOL GetSection(CPVT_Section & section) const = 0; //set the current position. - virtual void SetAt(FX_INT32 nWordIndex) = 0; + virtual void SetAt(int32_t nWordIndex) = 0; //set the current position. virtual void SetAt(const CPVT_WordPlace & place) = 0; //get the current position. @@ -200,19 +200,19 @@ public: virtual void SetScrollPos(const CPDF_Point & point) = 0; //set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right). - virtual void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; //set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom). - virtual void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; //if the text is shown in secret , set a character for substitute. virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0; //set the maximal count of words of the text. - virtual void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; //if set the count of charArray , then all words is shown in equal space. - virtual void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; //set the space of two characters. virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0; //set the horizontal scale of all characters. - virtual void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; + virtual void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; //set the leading of all lines virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; //if set, CRLF is allowed. @@ -235,11 +235,11 @@ public: //set the fontsize of selected text. virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; //set the fontindex of selected text, user can change the font of selected text. - virtual FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex) = 0; + virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; //set the textcolor of selected text. virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; //set the text script type of selected text. (0:normal 1:superscript 2:subscript) - virtual FX_BOOL SetRichTextScript(FX_INT32 nScriptType) = 0; + virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; //set the bold font style of selected text. virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; //set the italic font style of selected text. @@ -251,25 +251,25 @@ public: //set the charspace of selected text, in user coordinate. virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; //set the horizontal scale of selected text, default value is 100. - virtual FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100) = 0; + virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; //set the leading of selected section, in user coordinate. virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; //set the indent of selected section, in user coordinate. virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; //set the alignment of selected section, nAlignment(0:left 1:middle 2:right) - virtual FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment) = 0; + virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0; //set the selected range of text. //if nStartChar == 0 and nEndChar == -1, select all the text. - virtual void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) = 0; + virtual void SetSel(int32_t nStartChar,int32_t nEndChar) = 0; //get the selected range of text. - virtual void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const = 0; + virtual void GetSel(int32_t & nStartChar, int32_t & nEndChar) const = 0; //select all the text. virtual void SelectAll() = 0; //set text is not selected. virtual void SelectNone() = 0; //get the caret position. - virtual FX_INT32 GetCaret() const = 0; + virtual int32_t GetCaret() const = 0; virtual CPVT_WordPlace GetCaretWordPlace() const = 0; //get the string of selected text. virtual CFX_WideString GetSelText() const = 0; @@ -309,14 +309,14 @@ public: virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; //put text into edit. - virtual void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET, + virtual void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert a word into the edit. - virtual FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; + virtual FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; //insert a return into the edit. virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert text into the edit. - virtual FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET, + virtual FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //do backspace operation. virtual FX_BOOL Backspace() = 0; @@ -330,7 +330,7 @@ public: //do Undo operation. virtual FX_BOOL Undo() = 0; //move caret - virtual void SetCaret(FX_INT32 nPos) = 0; + virtual void SetCaret(int32_t nPos) = 0; //arrange all words over again virtual void Paint() = 0; @@ -350,9 +350,9 @@ public: virtual void EnableOprNotify(FX_BOOL bNotify) = 0; //map word place to word index. - virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; + virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; //map word index to word place. - virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0; + virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; //get the beginning position of a line virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0; @@ -374,9 +374,9 @@ public: //get the mask character. virtual FX_WORD GetPasswordChar() const = 0; //get the count of charArray - virtual FX_INT32 GetCharArray() const = 0; + virtual int32_t GetCharArray() const = 0; //get the horizontal scale of all characters - virtual FX_INT32 GetHorzScale() const = 0; + virtual int32_t GetHorzScale() const = 0; //get the space of two characters virtual FX_FLOAT GetCharSpace() const = 0; //get the latin words of specified range @@ -388,7 +388,7 @@ public: //if the content is changed after settext? virtual FX_BOOL IsModified() const = 0; //get the total words in edit - virtual FX_INT32 GetTotalWords() const = 0; + virtual int32_t GetTotalWords() const = 0; virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; @@ -449,29 +449,29 @@ public: virtual CPDF_Rect GetContentRect() const = 0; virtual FX_FLOAT GetFontSize() const = 0; - virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const = 0; - virtual FX_INT32 GetCount() const = 0; - virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const = 0; + virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; + virtual int32_t GetCount() const = 0; + virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0; virtual FX_FLOAT GetFirstHeight() const = 0; virtual void SetMultipleSel(FX_BOOL bMultiple) = 0; virtual FX_BOOL IsMultipleSel() const = 0; - virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const = 0; - virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const = 0; + virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; + virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0; virtual void SetScrollPos(const CPDF_Point & point) = 0; - virtual void ScrollToListItem(FX_INT32 nItemIndex) = 0; - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const = 0; - virtual FX_INT32 GetCaret() const = 0; - virtual FX_INT32 GetSelect() const = 0; - virtual FX_INT32 GetTopItem() const = 0; - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const = 0; - virtual FX_INT32 GetFirstSelected() const = 0; + virtual void ScrollToListItem(int32_t nItemIndex) = 0; + virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; + virtual int32_t GetCaret() const = 0; + virtual int32_t GetSelect() const = 0; + virtual int32_t GetTopItem() const = 0; + virtual int32_t GetItemIndex(const CPDF_Point & point) const = 0; + virtual int32_t GetFirstSelected() const = 0; virtual void AddString(FX_LPCWSTR string) = 0; - virtual void SetTopItem(FX_INT32 nIndex) = 0; - virtual void Select(FX_INT32 nItemIndex) = 0; - virtual void SetCaret(FX_INT32 nItemIndex) = 0; + virtual void SetTopItem(int32_t nIndex) = 0; + virtual void Select(int32_t nItemIndex) = 0; + virtual void SetCaret(int32_t nItemIndex) = 0; virtual void Empty() = 0; virtual void Cancel() = 0; virtual CFX_WideString GetText() const = 0; @@ -485,7 +485,7 @@ public: virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; - virtual void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0; virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0; protected: diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index 237aa66b53..6fd7b9a4ee 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -111,7 +111,7 @@ public: void Empty() { - for (FX_INT32 i = 0, sz = m_LineRects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_LineRects.GetSize(); i < sz; i++) delete m_LineRects.GetAt(i); m_LineRects.RemoveAll(); @@ -125,7 +125,7 @@ public: void operator = (CFX_Edit_LineRectArray & rects) { Empty(); - for (FX_INT32 i = 0, sz = rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = rects.GetSize(); i < sz; i++) m_LineRects.Add(rects.GetAt(i)); rects.RemoveAll(); @@ -137,12 +137,12 @@ public: m_LineRects.Add(pRect); } - FX_INT32 GetSize() const + int32_t GetSize() const { return m_LineRects.GetSize(); } - CFX_Edit_LineRect * GetAt(FX_INT32 nIndex) const + CFX_Edit_LineRect * GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_LineRects.GetSize()) return NULL; @@ -167,7 +167,7 @@ public: void Empty() { - for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) delete m_Rects.GetAt(i); this->m_Rects.RemoveAll(); @@ -176,7 +176,7 @@ public: void Add(const CPDF_Rect & rect) { //check for overlaped area - for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) if (CPDF_Rect * pRect = m_Rects.GetAt(i)) if (pRect->Contains(rect))return; @@ -184,12 +184,12 @@ public: m_Rects.Add(pNewRect); } - FX_INT32 GetSize() const + int32_t GetSize() const { return m_Rects.GetSize(); } - CPDF_Rect * GetAt(FX_INT32 nIndex) const + CPDF_Rect * GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_Rects.GetSize()) return NULL; @@ -209,7 +209,7 @@ public: void BeginRefresh(); void Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect); void NoAnalyse(); - void Analyse(FX_INT32 nAlignment); + void Analyse(int32_t nAlignment); void AddRefresh(const CPDF_Rect & rect); const CFX_Edit_RectArray * GetRefreshRects() const; void EndRefresh(); @@ -285,7 +285,7 @@ public: class CFX_Edit_Undo { public: - CFX_Edit_Undo(FX_INT32 nBufsize = 10000); + CFX_Edit_Undo(int32_t nBufsize = 10000); virtual ~CFX_Edit_Undo(); void Undo(); @@ -300,13 +300,13 @@ public: void Reset(); - IFX_Edit_UndoItem* GetItem(FX_INT32 nIndex); - FX_INT32 GetItemCount(){return m_UndoItemStack.GetSize();} - FX_INT32 GetCurUndoPos(){return m_nCurUndoPos;} + IFX_Edit_UndoItem* GetItem(int32_t nIndex); + int32_t GetItemCount(){return m_UndoItemStack.GetSize();} + int32_t GetCurUndoPos(){return m_nCurUndoPos;} private: - void SetBufSize(FX_INT32 nSize){m_nBufSize = nSize;} - FX_INT32 GetBufSize(){return m_nBufSize;} + void SetBufSize(int32_t nSize){m_nBufSize = nSize;} + int32_t GetBufSize(){return m_nBufSize;} void RemoveHeads(); void RemoveTails(); @@ -314,8 +314,8 @@ private: private: CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack; - FX_INT32 m_nCurUndoPos; - FX_INT32 m_nBufSize; + int32_t m_nCurUndoPos; + int32_t m_nBufSize; FX_BOOL m_bModified; FX_BOOL m_bVirgin; FX_BOOL m_bWorking; @@ -362,7 +362,7 @@ class CFXEU_InsertWord : public CFX_Edit_UndoItem { public: 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); virtual ~CFXEU_InsertWord(); void Redo(); @@ -374,7 +374,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_WordProps m_WordProps; }; @@ -401,7 +401,7 @@ class CFXEU_Backspace : public CFX_Edit_UndoItem { public: 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); virtual ~CFXEU_Backspace(); @@ -414,7 +414,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -423,7 +423,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem { public: 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); virtual ~CFXEU_Delete(); @@ -436,7 +436,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; FX_BOOL m_bSecEnd; @@ -463,7 +463,7 @@ class CFXEU_ClearRich : public CFX_Edit_UndoItem public: CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, const CPVT_WordRange & wrSel, - FX_WORD word, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps); virtual ~CFXEU_ClearRich(); @@ -477,7 +477,7 @@ private: CPVT_WordPlace m_wpNew; CPVT_WordRange m_wrSel; FX_WORD m_Word; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -486,7 +486,7 @@ class CFXEU_InsertText : public CFX_Edit_UndoItem { public: 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); virtual ~CFXEU_InsertText(); @@ -499,7 +499,7 @@ private: CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; CFX_WideString m_swText; - FX_INT32 m_nCharset; + int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; }; @@ -578,13 +578,13 @@ public: void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE); void SetScrollPos(const CPDF_Point & point); - void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE); - void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE); + void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); + void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE); - void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE); - void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE); + void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE); + void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE); void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE); - void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE); + void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE); void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); @@ -596,18 +596,18 @@ public: FX_BOOL IsRichText() const; void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); - FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex); + FX_BOOL SetRichFontIndex(int32_t nFontIndex); FX_BOOL SetRichTextColor(FX_COLORREF dwColor); - FX_BOOL SetRichTextScript(FX_INT32 nScriptType); + FX_BOOL SetRichTextScript(int32_t nScriptType); FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE); FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE); FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE); FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE); FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace); - FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100); + FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100); FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading); FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent); - FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment); + FX_BOOL SetRichTextAlignment(int32_t nAlignment); void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); @@ -618,24 +618,24 @@ public: void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); - void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET, + void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); + FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); FX_BOOL Backspace(); FX_BOOL Delete(); FX_BOOL Clear(); FX_BOOL Empty(); - FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET, + FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); FX_BOOL Redo(); FX_BOOL Undo(); - CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset, + CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); - FX_INT32 GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset); + int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset); - FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const; - CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const; + int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const; + CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const; @@ -643,24 +643,24 @@ public: CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const; - FX_INT32 GetCaret() const; + int32_t GetCaret() const; CPVT_WordPlace GetCaretWordPlace() const; CFX_WideString GetSelText() const; CFX_WideString GetText() const; FX_FLOAT GetFontSize() const; FX_WORD GetPasswordChar() const; CPDF_Point GetScrollPos() const; - FX_INT32 GetCharArray() const; + int32_t GetCharArray() const; CPDF_Rect GetPlateRect() const; CPDF_Rect GetContentRect() const; CFX_WideString GetRangeText(const CPVT_WordRange & range) const; - FX_INT32 GetHorzScale() const; + int32_t GetHorzScale() const; FX_FLOAT GetCharSpace() const; - FX_INT32 GetTotalWords() const; - FX_INT32 GetTotalLines() const; + int32_t GetTotalWords() const; + int32_t GetTotalLines() const; - void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar); - void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const; + void SetSel(int32_t nStartChar,int32_t nEndChar); + void GetSel(int32_t & nStartChar, int32_t & nEndChar) const; private: void SelectAll(); @@ -679,14 +679,14 @@ private: void SetContentChanged(); void EnableNotify(FX_BOOL bNotify); - void SetText(FX_LPCWSTR text,FX_INT32 charset, + void SetText(FX_LPCWSTR text,int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); - FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + FX_BOOL InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); - FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset, + FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); @@ -708,7 +708,7 @@ private: void RefreshPushRandomRects(const CPVT_WordRange & wr); void RefreshWordRange(const CPVT_WordRange& wr); - void SetCaret(FX_INT32 nPos); + void SetCaret(int32_t nPos); void SetCaret(const CPVT_WordPlace & place); void SetCaretInfo(); void SetCaretOrigin(); @@ -756,7 +756,7 @@ private: CFX_Edit_Refresh m_Refresh; CPDF_Point m_ptCaret; CFX_Edit_Undo m_Undo; - FX_INT32 m_nAlignment; + int32_t m_nAlignment; FX_BOOL m_bNotifyFlag; FX_BOOL m_bEnableOverflow; FX_BOOL m_bEnableRefresh; @@ -785,7 +785,7 @@ public: FX_BOOL GetWord(CPVT_Word & word) const; FX_BOOL GetLine(CPVT_Line & line) const; FX_BOOL GetSection(CPVT_Section & section) const; - void SetAt(FX_INT32 nWordIndex); + void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace & place); const CPVT_WordPlace & GetAt() const; IFX_Edit* GetEdit() const; @@ -803,11 +803,11 @@ public: IFX_Edit_FontMap* GetFontMap(); - FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle); - FX_INT32 GetTypeAscent(FX_INT32 nFontIndex); - FX_INT32 GetTypeDescent(FX_INT32 nFontIndex); - FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); - FX_INT32 GetDefaultFontIndex(); + int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle); + int32_t GetTypeAscent(int32_t nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); + int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); + int32_t GetDefaultFontIndex(); FX_BOOL IsLatinWord(FX_WORD word); private: diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h index 5c689ed439..b7888eaf3b 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -209,8 +209,8 @@ template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { public: FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } - TYPE GetAt(FX_INT32 nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;} - void RemoveAt(FX_INT32 nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);} + TYPE GetAt(int32_t nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;} + void RemoveAt(int32_t nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);} }; class CFX_List : protected CFX_ListContainer , public IFX_List @@ -227,31 +227,31 @@ public: virtual CPDF_Rect GetContentRect() const; virtual FX_FLOAT GetFontSize() const; - virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const; - virtual FX_INT32 GetCount() const; - virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const; + virtual IFX_Edit* GetItemEdit(int32_t nIndex) const; + virtual int32_t GetCount() const; + virtual FX_BOOL IsItemSelected(int32_t nIndex) const; virtual FX_FLOAT GetFirstHeight() const; virtual void SetMultipleSel(FX_BOOL bMultiple); virtual FX_BOOL IsMultipleSel() const; - virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const; - virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const; + virtual FX_BOOL IsValid(int32_t nItemIndex) const; + virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const; protected: virtual void Empty(); void AddItem(FX_LPCWSTR str); - virtual void ReArrange(FX_INT32 nItemIndex); + virtual void ReArrange(int32_t nItemIndex); - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const; - CFX_WideString GetItemText(FX_INT32 nIndex) const; + virtual CPDF_Rect GetItemRect(int32_t nIndex) const; + CFX_WideString GetItemText(int32_t nIndex) const; - void SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected); - void SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret); + void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); + void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const; - FX_INT32 GetFirstSelected() const; - FX_INT32 GetLastSelected() const; + virtual int32_t GetItemIndex(const CPDF_Point & point) const; + int32_t GetFirstSelected() const; + int32_t GetLastSelected() const; FX_WCHAR Toupper(FX_WCHAR c) const; private: @@ -263,14 +263,14 @@ private: struct CPLST_Select_Item { - CPLST_Select_Item(FX_INT32 nItemIndex,FX_INT32 nState) + CPLST_Select_Item(int32_t nItemIndex,int32_t nState) { this->nItemIndex = nItemIndex; this->nState = nState; } - FX_INT32 nItemIndex; - FX_INT32 nState; //0:normal select -1:to deselect 1: to select + int32_t nItemIndex; + int32_t nState; //0:normal select -1:to deselect 1: to select }; class CPLST_Select @@ -280,15 +280,15 @@ public: virtual ~CPLST_Select(); public: - void Add(FX_INT32 nItemIndex); - void Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); - void Sub(FX_INT32 nItemIndex); - void Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); - FX_BOOL IsExist(FX_INT32 nItemIndex) const; - FX_INT32 Find(FX_INT32 nItemIndex) const; - FX_INT32 GetCount() const; - FX_INT32 GetItemIndex(FX_INT32 nIndex) const; - FX_INT32 GetState(FX_INT32 nIndex) const; + void Add(int32_t nItemIndex); + void Add(int32_t nBeginIndex, int32_t nEndIndex); + void Sub(int32_t nItemIndex); + void Sub(int32_t nBeginIndex, int32_t nEndIndex); + FX_BOOL IsExist(int32_t nItemIndex) const; + int32_t Find(int32_t nItemIndex) const; + int32_t GetCount() const; + int32_t GetItemIndex(int32_t nIndex) const; + int32_t GetState(int32_t nIndex) const; void Done(); void DeselectAll(); @@ -313,7 +313,7 @@ public: void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl); void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); - void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl); + void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl); FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl); virtual CPDF_Point InToOut(const CPDF_Point & point) const; @@ -323,41 +323,41 @@ public: virtual void SetPlateRect(const CPDF_Rect & rect); void SetScrollPos(const CPDF_Point & point); - void ScrollToListItem(FX_INT32 nItemIndex); - virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const; - FX_INT32 GetCaret() const {return m_nCaretIndex;} - FX_INT32 GetSelect() const {return m_nSelItem;} - FX_INT32 GetTopItem() const; + void ScrollToListItem(int32_t nItemIndex); + virtual CPDF_Rect GetItemRect(int32_t nIndex) const; + int32_t GetCaret() const {return m_nCaretIndex;} + int32_t GetSelect() const {return m_nSelItem;} + int32_t GetTopItem() const; virtual CPDF_Rect GetContentRect() const; - virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const; + virtual int32_t GetItemIndex(const CPDF_Point & point) const; void AddString(FX_LPCWSTR string); - void SetTopItem(FX_INT32 nIndex); - void Select(FX_INT32 nItemIndex); - virtual void SetCaret(FX_INT32 nItemIndex); + void SetTopItem(int32_t nIndex); + void Select(int32_t nItemIndex); + virtual void SetCaret(int32_t nItemIndex); virtual void Empty(); virtual void Cancel(); CFX_WideString GetText() const; private: - void SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected); - void SetSingleSelect(FX_INT32 nItemIndex); - void InvalidateItem(FX_INT32 nItemIndex); + void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); + void SetSingleSelect(int32_t nItemIndex); + void InvalidateItem(int32_t nItemIndex); void SelectItems(); - FX_BOOL IsItemVisible(FX_INT32 nItemIndex) const; + FX_BOOL IsItemVisible(int32_t nItemIndex) const; void SetScrollInfo(); void SetScrollPosY(FX_FLOAT fy); - virtual void ReArrange(FX_INT32 nItemIndex); + virtual void ReArrange(int32_t nItemIndex); private: IFX_List_Notify* m_pNotify; FX_BOOL m_bNotifyFlag; CPDF_Point m_ptScrollPos; CPLST_Select m_aSelItems; //for multiple - FX_INT32 m_nSelItem; //for single - FX_INT32 m_nFootIndex; //for multiple + int32_t m_nSelItem; //for single + int32_t m_nFootIndex; //for multiple FX_BOOL m_bCtrlSel; //for multiple - FX_INT32 m_nCaretIndex; //for multiple + int32_t m_nCaretIndex; //for multiple }; #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/include/javascript/Field.h index 0da08b6e95..573fb392c0 100644 --- a/fpdfsdk/include/javascript/Field.h +++ b/fpdfsdk/include/javascript/Field.h @@ -87,7 +87,7 @@ struct CJS_DelayData CFX_WideString sFieldName; int nControlIndex; enum FIELD_PROP eProp; - FX_INT32 num; + int32_t num; bool b; CFX_ByteString string; CFX_WideString widestring; @@ -244,7 +244,7 @@ protected: CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField); FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel); - void AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n); + void AddDelay_Int(enum FIELD_PROP prop, int32_t n); void AddDelay_Bool(enum FIELD_PROP prop,bool b); void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string); void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string); diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h index eea2e6a7ca..d62b68bf50 100644 --- a/fpdfsdk/include/javascript/IJavaScript.h +++ b/fpdfsdk/include/javascript/IJavaScript.h @@ -111,7 +111,7 @@ private: FX_BOOL m_bInit; int m_nRef; CJS_GlobalData* m_pGlobalData; - FX_INT32 m_nGlobalDataCount; + int32_t m_nGlobalDataCount; }; #endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index fc68e58755..15f236d681 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -17,7 +17,7 @@ struct JSConstSpec const wchar_t* pName; double number; const wchar_t* string; - FX_BYTE t; //0:double 1:str + uint8_t t; //0:double 1:str }; struct JSPropertySpec diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h index 4f09d87531..4e1073d15a 100644 --- a/fpdfsdk/include/javascript/JS_GlobalData.h +++ b/fpdfsdk/include/javascript/JS_GlobalData.h @@ -75,7 +75,7 @@ public: FX_BOOL SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent); FX_BOOL DeleteGlobalVariable(FX_LPCSTR propname); - FX_INT32 GetSize() const; + int32_t GetSize() const; CJS_GlobalData_Element* GetAt(int index) const; private: @@ -85,8 +85,8 @@ private: CJS_GlobalData_Element* GetGlobalVariable(FX_LPCSTR propname); int FindGlobalVariable(FX_LPCSTR propname); - void LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength); - void WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength); + void LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, int32_t& nLength); + void WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, int32_t nLength); void MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); private: diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/include/javascript/util.h index b621067bc3..07f52ab8ce 100644 --- a/fpdfsdk/include/javascript/util.h +++ b/fpdfsdk/include/javascript/util.h @@ -45,6 +45,6 @@ public: JS_STATIC_METHOD(byteToChar, util); }; -FX_INT64 FX_atoi64(const char *nptr); +int64_t FX_atoi64(const char *nptr); #endif // FPDFSDK_INCLUDE_JAVASCRIPT_UTIL_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h index b827f18d3f..8efbf79341 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Caret.h +++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h @@ -46,7 +46,7 @@ private: CPDF_Point m_ptHead; CPDF_Point m_ptFoot; FX_FLOAT m_fWidth; - FX_INT32 m_nDelay; + int32_t m_nDelay; CPDF_Rect m_rcInvalid; }; diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h index 826f4dcc3e..7abdeeffce 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h @@ -61,7 +61,7 @@ public: virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); virtual void RePosChildWnd(); @@ -80,11 +80,11 @@ public: void SetText(FX_LPCWSTR text); void AddString(FX_LPCWSTR string); - FX_INT32 GetSelect() const; - void SetSelect(FX_INT32 nItemIndex); + int32_t GetSelect() const; + void SetSelect(int32_t nItemIndex); - void SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar); - void GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const; + void SetEditSel(int32_t nStartChar,int32_t nEndChar); + void GetEditSel(int32_t & nStartChar, int32_t & nEndChar ) const; void Clear(); void SelectAll(); FX_BOOL IsPopup() const; @@ -105,8 +105,8 @@ private: FX_BOOL m_bPopup; CPDF_Rect m_rcOldWindow; - FX_INT32 m_nPopupWhere; - FX_INT32 m_nSelectItem; + int32_t m_nPopupWhere; + int32_t m_nSelectItem; IPWL_Filler_Notify* m_pFillerNotify; public: diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h index 5b0e7dd1ff..93db6f09bd 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Edit.h +++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h @@ -20,8 +20,8 @@ class IPWL_Filler_Notify public: virtual ~IPWL_Filler_Notify() { } virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, - FX_INT32 & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top) - virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, + int32_t & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top) + virtual void 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) = 0; @@ -61,10 +61,10 @@ public: void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE); //0:top 1:bottom 2:center - void SetCharArray(FX_INT32 nCharArray); - void SetLimitChar(FX_INT32 nLimitChar); + void SetCharArray(int32_t nCharArray); + void SetLimitChar(int32_t nLimitChar); - void SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint = TRUE); + void SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint = TRUE); void SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint = TRUE); void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); @@ -90,7 +90,7 @@ public: FX_BOOL IsTextFull() const; - static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray); + static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray); void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;} @@ -119,7 +119,7 @@ private: FX_BOOL IsVScrollBarVisible() const; void SetParamByFlag(); - FX_FLOAT GetCharArrayAutoFontSize(FX_INT32 nCharArray); + FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray); CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2); diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h index 600c348446..2eb779ddc8 100644 --- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h @@ -37,7 +37,7 @@ class IPWL_Edit_Notify public: virtual ~IPWL_Edit_Notify() { } //when the position of caret is changed in edit - virtual void OnCaretMove(FX_INT32 x1, FX_INT32 y1, FX_INT32 x2, FX_INT32 y2) {} + virtual void OnCaretMove(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {} virtual void OnContentChange(const CPDF_Rect& rcContent){} //OprType: 0 InsertWord //1 InsertReturn @@ -73,7 +73,7 @@ public: virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag); virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag); virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); virtual void RePosChildWnd(); @@ -88,20 +88,20 @@ public: virtual void CutText(); CPDF_Rect GetContentRect() const; - void GetCaretPos(FX_INT32& x, FX_INT32& y) const; + void GetCaretPos(int32_t& x, int32_t& y) const; FX_BOOL IsModified() const; CFX_WideString GetText() const; - void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar); - void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const; - void GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const; - CFX_WideString GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const; + void SetSel(int32_t nStartChar,int32_t nEndChar); + void GetSel(int32_t & nStartChar, int32_t & nEndChar ) const; + void GetTextRange(const CPDF_Rect& rect, int32_t & nStartChar, int32_t & nEndChar) const; + CFX_WideString GetText(int32_t & nStartChar, int32_t & nEndChar) const; void Clear(); void SelectAll(); - FX_INT32 GetCaret() const; - void SetCaret(FX_INT32 nPos); - FX_INT32 GetTotalWords() const; + int32_t GetCaret() const; + void SetCaret(int32_t nPos); + int32_t GetTotalWords() const; void Paint(); @@ -111,11 +111,11 @@ public: void SetEditNotify(IPWL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;} - void SetCharSet(FX_BYTE nCharSet){m_nCharSet = nCharSet;} - FX_INT32 GetCharSet() const; + void SetCharSet(uint8_t nCharSet){m_nCharSet = nCharSet;} + int32_t GetCharSet() const; - void SetCodePage(FX_INT32 nCodePage){m_nCodePage = nCodePage;} - FX_INT32 GetCodePage() const {return m_nCodePage;} + void SetCodePage(int32_t nCodePage){m_nCodePage = nCodePage;} + int32_t GetCodePage() const {return m_nCodePage;} CPDF_Font * GetCaretFont() const; FX_FLOAT GetCaretFontSize() const; @@ -129,7 +129,7 @@ public: protected: virtual void ShowVScrollBar(FX_BOOL bShow); - virtual void InsertWord(FX_WORD word, FX_INT32 nCharset); + virtual void InsertWord(FX_WORD word, int32_t nCharset); virtual void InsertReturn(); virtual void InsertText(FX_LPCWSTR csText); @@ -169,8 +169,8 @@ protected: IPWL_Edit_Notify* m_pEditNotify; private: - FX_INT32 m_nCharSet; - FX_INT32 m_nCodePage; + int32_t m_nCharSet; + int32_t m_nCodePage; }; #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h index cdce862b29..4f44660cb2 100644 --- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h @@ -16,13 +16,13 @@ class IFX_SystemHandler; struct CPWL_FontMap_Data { CPDF_Font* pFont; - FX_INT32 nCharset; + int32_t nCharset; CFX_ByteString sFontName; }; struct CPWL_FontMap_Native { - FX_INT32 nCharset; + int32_t nCharset; CFX_ByteString sFontName; }; @@ -65,51 +65,51 @@ public: CPWL_FontMap(IFX_SystemHandler* pSystemHandler); virtual ~CPWL_FontMap(); - virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex); - virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex); - virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex); - virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word); - virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset); + virtual CPDF_Font* GetPDFFont(int32_t nFontIndex); + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex); + virtual int32_t GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex); + virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word); + virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset); public: virtual void Initial(FX_LPCSTR fontname = NULL); void SetSystemHandler(IFX_SystemHandler* pSystemHandler); - FX_INT32 GetFontMapCount() const; - const CPWL_FontMap_Data* GetFontMapData(FX_INT32 nIndex) const; + int32_t GetFontMapCount() const; + const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const; public: - static FX_INT32 GetNativeCharset(); - CFX_ByteString GetNativeFontName(FX_INT32 nCharset); + static int32_t GetNativeCharset(); + CFX_ByteString GetNativeFontName(int32_t nCharset); - static CFX_ByteString GetDefaultFontByCharset(FX_INT32 nCharset); + static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); - CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset); + CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset); static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, - FX_BYTE nCharset); + uint8_t nCharset); protected: - virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset); + virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset); virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); - FX_BOOL KnowWord(FX_INT32 nFontIndex, FX_WORD word); + FX_BOOL KnowWord(int32_t nFontIndex, FX_WORD word); virtual CPDF_Document* GetDocument(); void Empty(); - FX_INT32 GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind); - FX_INT32 GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset); - FX_INT32 AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset = DEFAULT_CHARSET); + int32_t GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind); + int32_t GetPWLFontIndex(FX_WORD word, int32_t nCharset); + int32_t AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, int32_t nCharset = DEFAULT_CHARSET); - CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset); + CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, int32_t nCharset); CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); private: - CFX_ByteString GetFontName(FX_INT32 nFontIndex); - FX_INT32 FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CHARSET); + CFX_ByteString GetFontName(int32_t nFontIndex); + int32_t FindFont(const CFX_ByteString& sFontName, int32_t nCharset = DEFAULT_CHARSET); - CFX_ByteString GetNativeFont(FX_INT32 nCharset); + CFX_ByteString GetNativeFont(int32_t nCharset); public: using CharsetFontMap = FPDF_CharsetFontMap; diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h index cb56a9929e..c09f7a9fe8 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Icon.h +++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h @@ -45,7 +45,7 @@ public: virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale); virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y); - FX_INT32 GetScaleMethod(); + int32_t GetScaleMethod(); FX_BOOL IsProportionalScale(); void GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom); FX_BOOL GetFittingBounds(); diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h index d074b76be1..74438c2afd 100644 --- a/fpdfsdk/include/pdfwindow/PWL_IconList.h +++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h @@ -21,7 +21,7 @@ class IPWL_IconList_Notify { public: virtual ~IPWL_IconList_Notify() { } - virtual void OnNoteListSelChanged(FX_INT32 nItemIndex) = 0; + virtual void OnNoteListSelChanged(int32_t nItemIndex) = 0; }; class CPWL_IconList_Item : public CPWL_Wnd @@ -37,7 +37,7 @@ public: void SetSelect(FX_BOOL bSelected); FX_BOOL IsSelected() const; void SetData(void* pData); - void SetIcon(FX_INT32 nIconIndex); + void SetIcon(int32_t nIconIndex); void SetText(const CFX_WideString& str); void SetIconFillColor(const CPWL_Color& color); CFX_WideString GetText() const; @@ -50,7 +50,7 @@ protected: virtual void OnDisabled(); private: - FX_INT32 m_nIconIndex; + int32_t m_nIconIndex; void* m_pData; FX_BOOL m_bSelected; CPWL_Label* m_pText; @@ -60,20 +60,20 @@ private: class CPWL_IconList_Content : public CPWL_ListCtrl { public: - CPWL_IconList_Content(FX_INT32 nListCount); + CPWL_IconList_Content(int32_t nListCount); virtual ~CPWL_IconList_Content(); - void SetSelect(FX_INT32 nIndex); - FX_INT32 GetSelect() const; + void SetSelect(int32_t nIndex); + int32_t GetSelect() const; void SetNotify(IPWL_IconList_Notify* pNotify); void EnableNotify(FX_BOOL bNotify); - void SetListData(FX_INT32 nItemIndex, void* pData); - void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex); - void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str); + void SetListData(int32_t nItemIndex, void* pData); + void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); + void SetListString(int32_t nItemIndex, const CFX_WideString& str); void SetIconFillColor(const CPWL_Color& color); - CFX_WideString GetListString(FX_INT32 nItemIndex) const; + CFX_WideString GetListString(int32_t nItemIndex) const; IPWL_IconList_Notify* GetNotify() const; - void ScrollToItem(FX_INT32 nItemIndex); + void ScrollToItem(int32_t nItemIndex); protected: virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); @@ -83,46 +83,46 @@ protected: virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); private: - CPWL_IconList_Item* GetListItem(FX_INT32 nItemIndex) const; - void SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect); - FX_INT32 FindItemIndex(const CPDF_Point& point); + CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const; + void SelectItem(int32_t nItemIndex, FX_BOOL bSelect); + int32_t FindItemIndex(const CPDF_Point& point); FX_BOOL m_nSelectIndex; IPWL_IconList_Notify* m_pNotify; FX_BOOL m_bEnableNotify; FX_BOOL m_bMouseDown; - FX_INT32 m_nListCount; + int32_t m_nListCount; }; class PWL_CLASS CPWL_IconList : public CPWL_Wnd { public: - CPWL_IconList(FX_INT32 nListCount); + CPWL_IconList(int32_t nListCount); virtual ~CPWL_IconList(); virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag); - void SetSelect(FX_INT32 nIndex); - void SetTopItem(FX_INT32 nIndex); - FX_INT32 GetSelect() const; + void SetSelect(int32_t nIndex); + void SetTopItem(int32_t nIndex); + int32_t GetSelect() const; void SetNotify(IPWL_IconList_Notify* pNotify); void EnableNotify(FX_BOOL bNotify); - void SetListData(FX_INT32 nItemIndex, void* pData); - void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex); - void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str); + void SetListData(int32_t nItemIndex, void* pData); + void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); + void SetListString(int32_t nItemIndex, const CFX_WideString& str); void SetIconFillColor(const CPWL_Color& color); - CFX_WideString GetListString(FX_INT32 nItemIndex) const; + CFX_WideString GetListString(int32_t nItemIndex) const; protected: virtual void OnCreated(); virtual void RePosChildWnd(); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); private: CPWL_IconList_Content* m_pListContent; - FX_INT32 m_nListCount; + int32_t m_nListCount; }; #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h index f724a0a82b..be083db486 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Label.h +++ b/fpdfsdk/include/pdfwindow/PWL_Label.h @@ -23,11 +23,11 @@ public: void SetText(FX_LPCWSTR csText); CFX_WideString GetText() const; - void SetLimitChar(FX_INT32 nLimitChar); - void SetHorzScale(FX_INT32 nHorzScale); + void SetLimitChar(int32_t nLimitChar); + void SetHorzScale(int32_t nHorzScale); void SetCharSpace(FX_FLOAT fCharSpace); CPDF_Rect GetContentRect() const; - FX_INT32 GetTotalWords(); + int32_t GetTotalWords(); CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const; protected: diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h index e8e9036b8e..c5a6df76dd 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h @@ -57,7 +57,7 @@ public: virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag); virtual void KillFocus(); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void RePosChildWnd(); virtual void SetText(FX_LPCWSTR csText,FX_BOOL bRefresh = TRUE); virtual CFX_WideString GetText() const; @@ -68,21 +68,21 @@ public: void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit , FX_DWORD nFlag); void AddString(FX_LPCWSTR string); - void SetTopVisibleIndex(FX_INT32 nItemIndex); - void ScrollToListItem(FX_INT32 nItemIndex); + void SetTopVisibleIndex(int32_t nItemIndex); + void ScrollToListItem(int32_t nItemIndex); void ResetContent(); void Reset(); - void Select(FX_INT32 nItemIndex); - void SetCaret(FX_INT32 nItemIndex); + void Select(int32_t nItemIndex); + void SetCaret(int32_t nItemIndex); void SetHoverSel(FX_BOOL bHoverSel); - FX_INT32 GetCount() const; + int32_t GetCount() const; FX_BOOL IsMultipleSel() const; - FX_INT32 GetCaretIndex() const; - FX_INT32 GetCurSel() const; - FX_BOOL IsItemSelected(FX_INT32 nItemIndex) const; - FX_INT32 GetTopVisibleIndex() const; - FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const; + int32_t GetCaretIndex() const; + int32_t GetCurSel() const; + FX_BOOL IsItemSelected(int32_t nItemIndex) const; + int32_t GetTopVisibleIndex() const; + int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const; CPDF_Rect GetContentRect() const; FX_FLOAT GetFirstHeight() const; CPDF_Rect GetListRect() const; diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h index 65df7aecfc..56a1fbf919 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h @@ -22,8 +22,8 @@ public: void SetTopSpace(FX_FLOAT fSpace); void SetBottomSpace(FX_FLOAT fSpace); void ResetFace(); - void ResetContent(FX_INT32 nStart); - FX_INT32 GetItemIndex(CPWL_Wnd* pItem); + void ResetContent(int32_t nStart); + int32_t GetItemIndex(CPWL_Wnd* pItem); FX_FLOAT GetContentsHeight(FX_FLOAT fLimitWidth); CPDF_Point InToOut(const CPDF_Point& point) const; CPDF_Point OutToIn(const CPDF_Point& point) const; @@ -35,7 +35,7 @@ protected: virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); private: - void ResetAll(FX_BOOL bMove,FX_INT32 nStart); + void ResetAll(FX_BOOL bMove,int32_t nStart); CPDF_Rect m_rcContent; CPDF_Point m_ptScroll; diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h index c5cdc4dd9c..a9e6dda05b 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Note.h +++ b/fpdfsdk/include/pdfwindow/PWL_Note.h @@ -43,8 +43,8 @@ public: virtual void OnSetContents(IPWL_NoteItem* pItem) = 0; virtual void OnSetDateTime(IPWL_NoteItem* pItem) = 0; virtual void OnSetSubjectName(IPWL_NoteItem* pItem) = 0; - virtual void OnPopupMenu(FX_INT32 x, FX_INT32 y) = 0; - virtual void OnPopupMenu(IPWL_NoteItem* pItem, FX_INT32 x, FX_INT32 y) = 0; + virtual void OnPopupMenu(int32_t x, int32_t y) = 0; + virtual void OnPopupMenu(IPWL_NoteItem* pItem, int32_t x, int32_t y) = 0; }; class IPWL_NoteHandler @@ -66,8 +66,8 @@ public: virtual void SetContents(const CFX_WideString& sContents) = 0; virtual IPWL_NoteItem* CreateSubItem() = 0; - virtual FX_INT32 CountSubItems() const = 0; - virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const = 0; + virtual int32_t CountSubItems() const = 0; + virtual IPWL_NoteItem* GetSubItems(int32_t index) const = 0; virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem) = 0; virtual void SetFocus() = 0; @@ -88,7 +88,7 @@ public: CPWL_Note_Icon(); virtual ~CPWL_Note_Icon(); - void SetIconType(FX_INT32 nType); + void SetIconType(int32_t nType); public: @@ -96,7 +96,7 @@ protected: virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); private: - FX_INT32 m_nType; + int32_t m_nType; }; class CPWL_Note_CloseBox : public CPWL_Button @@ -148,7 +148,7 @@ public: virtual void SetText(FX_LPCWSTR csText); protected: - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void RePosChildWnd(); virtual void OnSetFocus(); virtual void OnKillFocus(); @@ -187,7 +187,7 @@ public: virtual ~CPWL_Note_Contents(); virtual CFX_ByteString GetClassName() const; - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); void SetEditFocus(FX_BOOL bLast); @@ -199,8 +199,8 @@ public: CPWL_NoteItem* CreateSubItem(); void DeleteSubItem(IPWL_NoteItem* pNoteItem); - FX_INT32 CountSubItems() const; - IPWL_NoteItem* GetSubItems(FX_INT32 index) const; + int32_t CountSubItems() const; + IPWL_NoteItem* GetSubItems(int32_t index) const; virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); void EnableRead(FX_BOOL bEnabled); @@ -228,8 +228,8 @@ public: virtual void SetContents(const CFX_WideString& sContents); virtual IPWL_NoteItem* CreateSubItem(); - virtual FX_INT32 CountSubItems() const; - virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const; + virtual int32_t CountSubItems() const; + virtual IPWL_NoteItem* GetSubItems(int32_t index) const; virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem); virtual void SetFocus(){SetNoteFocus(FALSE);} @@ -250,7 +250,7 @@ public: virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); virtual IPWL_NoteItem* GetFocusedNoteItem() const; - virtual void ResetSubjectName(FX_INT32 nItemIndex); + virtual void ResetSubjectName(int32_t nItemIndex); void EnableRead(FX_BOOL bEnabled); void EnableModify(FX_BOOL bEnabled); @@ -258,7 +258,7 @@ protected: virtual void RePosChildWnd(); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); public: virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth); @@ -304,7 +304,7 @@ public: virtual void SetAuthorName(const CFX_WideString& sName); virtual CFX_WideString GetAuthorName() const; virtual void SetBkColor(const CPWL_Color& color); - virtual void ResetSubjectName(FX_INT32 nItemIndex){} + virtual void ResetSubjectName(int32_t nItemIndex){} virtual FX_BOOL IsTopItem() const {return TRUE;} virtual const CPWL_Note* GetNote() const; virtual IPWL_NoteNotify* GetNoteNotify() const; @@ -312,7 +312,7 @@ public: public: IPWL_NoteItem* Reply(); void EnableNotify(FX_BOOL bEnabled); - void SetIconType(FX_INT32 nType); + void SetIconType(int32_t nType); void SetOptionsText(const CFX_WideString& sText); void EnableRead(FX_BOOL bEnabled); void EnableModify(FX_BOOL bEnabled); @@ -321,7 +321,7 @@ public: void SetReplyString(const CFX_WideString& string); //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options - FX_INT32 NoteHitTest(const CPDF_Point& point) const; + int32_t NoteHitTest(const CPDF_Point& point) const; CPDF_Rect GetCaptionRect() const {return m_rcCaption;} IPopup_Note* GetPopupNote() const {return m_pPopupNote;} @@ -334,7 +334,7 @@ protected: virtual void RePosChildWnd(); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); FX_BOOL ResetScrollBar(); void RePosNoteChildren(); diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h index 2f0473f1d2..bf92399e88 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h +++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h @@ -112,7 +112,7 @@ public: virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag); virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h index 51514f2513..9f121e80a8 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Utils.h +++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h @@ -18,7 +18,7 @@ struct CPWL_Color; template<class T> T PWL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); } template<class T> T PWL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); } -#define PWL_PDF2WIN(color) (FX_BYTE(color*255)) +#define PWL_PDF2WIN(color) (uint8_t(color*255)) #define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color/255.0f)) #define PWL_MAKEDWORD(low,high) ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high))<<16))) @@ -119,17 +119,17 @@ public: static CPDF_Rect MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2); static CPDF_Rect OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y); static CPDF_Point OffsetPoint(const CPDF_Point & point,FX_FLOAT x,FX_FLOAT y); - static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy = 255); + static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, int32_t nTransparancy = 255); static FX_BOOL IsBlackOrWhite(const CPWL_Color& color); static CPWL_Color GetReverseColor(const CPWL_Color& color); static CFX_ByteString GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke = TRUE); static CFX_ByteString GetBorderAppStream(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); + int32_t nStyle, const CPWL_Dash & dash); static CFX_ByteString GetCircleBorderAppStream(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); + int32_t nStyle, const CPWL_Dash & dash); static CFX_ByteString GetRectFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color); static CFX_ByteString GetCircleFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color); @@ -140,12 +140,12 @@ public: const CFX_WideString & sLabel, const CPWL_Color & crText, FX_FLOAT fFontSize, - FX_INT32 nLayOut); + int32_t nLayOut); static CFX_ByteString GetCheckBoxAppStream(const CPDF_Rect & rcBBox, - FX_INT32 nStyle, + int32_t nStyle, const CPWL_Color & crText); static CFX_ByteString GetRadioButtonAppStream(const CPDF_Rect & rcBBox, - FX_INT32 nStyle, + int32_t nStyle, const CPWL_Color & crText); static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL, @@ -156,12 +156,12 @@ public: const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL); static CFX_ByteString GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap, - const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV, + const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV, FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText); static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect & rcBBox); static void 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); static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect & rect,const FX_COLORREF & color); static void DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect, @@ -171,12 +171,12 @@ public: static void 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); static void DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, - const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color); + const CPDF_Point* pPts, int32_t nCount, const FX_COLORREF& color); static void 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); static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck* pSpellCheck); @@ -190,18 +190,18 @@ public: static void ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dGray); static void ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK); - static void PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue); + static void PWLColorToARGB(const CPWL_Color& color, int32_t& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue); public: - static CFX_ByteString GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill, + static CFX_ByteString GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR); static void 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); private: - static CFX_ByteString GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount); - static void GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount); + static CFX_ByteString GetAppStreamFromArray(const CPWL_PathData* pPathData, int32_t nCount); + static void GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, int32_t nCount); static CFX_ByteString GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText); static CFX_ByteString GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText); diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h index 4fa1c7639b..970480f14a 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h +++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h @@ -107,25 +107,25 @@ class IPWL_SpellCheck; struct CPWL_Dash { - CPWL_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase) + CPWL_Dash(int32_t dash, int32_t gap, int32_t phase) : nDash(dash), nGap(gap), nPhase(phase) {} - FX_INT32 nDash; - FX_INT32 nGap; - FX_INT32 nPhase; + int32_t nDash; + int32_t nGap; + int32_t nPhase; }; struct PWL_CLASS CPWL_Color { - CPWL_Color(FX_INT32 type = COLORTYPE_TRANSPARENT, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) + CPWL_Color(int32_t type = COLORTYPE_TRANSPARENT, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4) {} - CPWL_Color(FX_INT32 r, FX_INT32 g, FX_INT32 b) : + CPWL_Color(int32_t r, int32_t g, int32_t b) : nColorType(COLORTYPE_RGB), fColor1(r/255.0f), fColor2(g/255.0f), fColor3(b/255.0f), fColor4(0) {} - void ConvertColorType(FX_INT32 nColorType); + void ConvertColorType(int32_t nColorType); /* COLORTYPE_TRANSPARENT @@ -133,7 +133,7 @@ struct PWL_CLASS CPWL_Color COLORTYPE_CMYK COLORTYPE_GRAY */ - FX_INT32 nColorType; + int32_t nColorType; FX_FLOAT fColor1,fColor2,fColor3,fColor4; }; @@ -194,7 +194,7 @@ public: 5 L"&Delete" 6 L"&Select All\tCtrl+A" */ - virtual CFX_WideString LoadPopupMenuString(FX_INT32 nIndex) = 0; + virtual CFX_WideString LoadPopupMenuString(int32_t nIndex) = 0; }; class IPWL_FocusHandler @@ -242,18 +242,18 @@ public: CPWL_Color sBackgroundColor; //optional FX_HWND hAttachedWnd; //required for no-reader framework IPWL_SpellCheck* pSpellCheck; //required for spellchecking - FX_INT32 nBorderStyle; //optional - FX_INT32 dwBorderWidth; //optional + int32_t nBorderStyle; //optional + int32_t dwBorderWidth; //optional CPWL_Color sBorderColor; //optional CPWL_Color sTextColor; //optional CPWL_Color sTextStrokeColor; //optional - FX_INT32 nTransparency; //optional + int32_t nTransparency; //optional FX_FLOAT fFontSize; //optional CPWL_Dash sDash; //optional void* pAttachedData; //optional CPWL_Wnd* pParentWnd; //ignore CPWL_MsgControl* pMsgControl; //ignore - FX_INT32 eCursorType; //ignore + int32_t eCursorType; //ignore CPDF_Matrix mtChild; //ignore }; @@ -263,12 +263,12 @@ public: CPWL_Timer(CPWL_TimerHandler* pAttached, IFX_SystemHandler* pSystemHandler); virtual ~CPWL_Timer(); - FX_INT32 SetPWLTimer(FX_INT32 nElapse); + int32_t SetPWLTimer(int32_t nElapse); void KillPWLTimer(); - static void TimerProc(FX_INT32 idEvent); + static void TimerProc(int32_t idEvent); private: - FX_INT32 m_nTimerID; + int32_t m_nTimerID; CPWL_TimerHandler* m_pAttached; IFX_SystemHandler* m_pSystemHandler; }; @@ -279,7 +279,7 @@ public: CPWL_TimerHandler(); virtual ~CPWL_TimerHandler(); - void BeginTimer(FX_INT32 nElapse); + void BeginTimer(int32_t nElapse); void EndTimer(); virtual void TimerProc(); virtual IFX_SystemHandler* GetSystemHandler() const = 0; @@ -324,7 +324,7 @@ public: void SetCapture(); void ReleaseCapture(); - virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void SetTextColor(const CPWL_Color & color); virtual void SetTextStrokeColor(const CPWL_Color & color); virtual void SetVisible(FX_BOOL bVisible); @@ -335,9 +335,9 @@ public: virtual CPWL_Color GetTextColor() const; virtual CPWL_Color GetTextStrokeColor() const; virtual FX_FLOAT GetFontSize() const; - virtual FX_INT32 GetInnerBorderWidth() const; - virtual CPWL_Color GetBorderLeftTopColor(FX_INT32 nBorderStyle) const; - virtual CPWL_Color GetBorderRightBottomColor(FX_INT32 nBorderStyle) const; + virtual int32_t GetInnerBorderWidth() const; + virtual CPWL_Color GetBorderLeftTopColor(int32_t nBorderStyle) const; + virtual CPWL_Color GetBorderRightBottomColor(int32_t nBorderStyle) const; virtual FX_BOOL IsModified() const {return FALSE;} @@ -345,9 +345,9 @@ public: void SetBackgroundColor(const CPWL_Color & color); void SetBorderColor(const CPWL_Color & color); - void SetBorderWidth(FX_INT32 nBorderWidth); + void SetBorderWidth(int32_t nBorderWidth); void SetClipRect(const CPDF_Rect & rect); - void SetBorderStyle(FX_INT32 eBorderStyle); + void SetBorderStyle(int32_t eBorderStyle); void SetBorderDash(const CPWL_Dash & sDash); CPDF_Rect GetOriginWindowRect() const; @@ -356,14 +356,14 @@ public: CPDF_Point GetCenterPoint() const; CPDF_Rect GetClientCenterSquare() const; CPDF_Rect GetWindowCenterSquare() const; - FX_INT32 GetBorderWidth() const; + int32_t GetBorderWidth() const; FX_BOOL IsVisible() const {return m_bVisible;} FX_BOOL HasFlag(FX_DWORD dwFlags) const; void AddFlag(FX_DWORD dwFlags); void RemoveFlag(FX_DWORD dwFlags); CPDF_Rect GetClipRect() const; CPWL_Wnd* GetParentWindow() const; - FX_INT32 GetBorderStyle() const; + int32_t GetBorderStyle() const; CPWL_Dash GetBorderDash() const; void* GetAttachedData() const; @@ -381,8 +381,8 @@ public: virtual IFX_SystemHandler* GetSystemHandler() const; IPWL_FocusHandler* GetFocusHandler() const; - FX_INT32 GetTransparency(); - void SetTransparency(FX_INT32 nTransparency); + int32_t GetTransparency(); + void SetTransparency(int32_t nTransparency); CPDF_Matrix GetChildToRoot() const; CPDF_Matrix GetChildMatrix() const; @@ -431,7 +431,7 @@ protected: void InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew); - void PWLtoWnd(const CPDF_Point & point, FX_INT32& x, FX_INT32& y) const; + void PWLtoWnd(const CPDF_Point & point, int32_t& x, int32_t& y) const; FX_RECT PWLtoWnd(const CPDF_Rect & rect) const; FX_HWND GetAttachedHWnd() const; 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(); i<sz; i++) + for (int32_t i=0,sz=pField->CountControls(); i<sz; i++) { if (CPDF_FormControl* pCtrl = pField->GetControl(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(); i<sz; i++) + for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++) { pWnd->AddString(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(); i<sz; i++) + for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++) pWnd->AddString(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(); i<sz; i++) + for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++) { if (m_pWidget->IsOptionSelected(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(); i<sz; i++) + for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++) { if (pListBox->IsItemSelected(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(); i<sz; i++) + for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++) { if (pListBox->IsItemSelected(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(); i<sz; i++) + for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++) { if (pListBox->IsItemSelected(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(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteActionTree(eAAT,subaction,bExit)) return FALSE; diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp index aacb7d81e9..708d6df090 100644 --- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp @@ -117,7 +117,7 @@ void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) CPDF_FormField* pField = m_pWidget->GetFormField(); ASSERT(pField != NULL); - for (FX_INT32 i=0,sz=pField->CountControls(); i<sz; i++) + for (int32_t i=0,sz=pField->CountControls(); i<sz; i++) { if (CPDF_FormControl* pCtrl = pField->GetControl(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<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) return FALSE; @@ -214,7 +214,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDF DoAction_NoJs(action, pDocument); } - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteLinkAction(subaction, pDocument, list)) return FALSE; @@ -255,7 +255,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& acti if (!IsValidDocView(pDocument)) return FALSE; - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)) return FALSE; @@ -310,7 +310,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPD DoAction_NoJs(action, pDocument); } - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteFieldAction(subaction, type, pDocument, pFormField, data, list)) return FALSE; @@ -400,7 +400,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CP DoAction_NoJs(action, pDocument); } - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, list)) return FALSE; @@ -455,7 +455,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSD DoAction_NoJs(action, pDocument); } - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) + for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) return FALSE; diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 9a340a1a3a..91fd3ef0b2 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -13,24 +13,24 @@ //--------------------------------------------------------------------------- // CPDFSDK_DateTime //--------------------------------------------------------------------------- -int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, FX_BYTE tzminute) +int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 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; i<nCount; i++) + for (int32_t i=nTop; i<nCount; i++) { FX_BOOL bSelected = FALSE; - for (FX_INT32 j=0; j<nSelCount; j++) + for (int32_t j=0; j<nSelCount; j++) { if (pField->GetSelectedIndex(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;i<nMaxLen;i++) + for (int32_t i=1;i<nMaxLen;i++) { sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " << rcClient.bottom << " m\n" @@ -1979,7 +1979,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(FX_LPCWSTR sValue) << dsBorder.nGap << "] " << dsBorder.nPhase << " d\n"; - for (FX_INT32 i=1;i<nMaxLen;i++) + for (int32_t i=1;i<nMaxLen;i++) { sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " << rcClient.bottom << " m\n" @@ -2059,7 +2059,7 @@ CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const CPWL_Color crLeftTop, crRightBottom; FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); - FX_INT32 nBorderStyle = 0; + int32_t nBorderStyle = 0; CPWL_Dash dsBorder(3,0,0); switch (GetBorderStyle()) @@ -2134,7 +2134,7 @@ CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance(); 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(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) delete m_aListItems.GetAt(i); m_aListItems.RemoveAll(); @@ -157,14 +157,14 @@ void CFX_List::AddItem(FX_LPCWSTR str) } } -void CFX_List::ReArrange(FX_INT32 nItemIndex) +void CFX_List::ReArrange(int32_t nItemIndex) { FX_FLOAT fPosY = 0.0f; if (CFX_ListItem * pPrevItem = m_aListItems.GetAt(nItemIndex - 1)) fPosY = pPrevItem->GetRect().bottom; - for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -177,7 +177,7 @@ void CFX_List::ReArrange(FX_INT32 nItemIndex) SetContentRect(CLST_Rect(0.0f,0.0f,0.0f,fPosY)); } -IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const +IFX_Edit * CFX_List::GetItemEdit(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -187,7 +187,7 @@ IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const return NULL; } -FX_INT32 CFX_List::GetCount() const +int32_t CFX_List::GetCount() const { return m_aListItems.GetSize(); } @@ -207,14 +207,14 @@ FX_FLOAT CFX_List::GetFontSize() const return m_fFontSize; } -FX_INT32 CFX_List::GetItemIndex(const CPDF_Point & point) const +int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const { CPDF_Point pt = OuterToInner(point); FX_BOOL bFirst = TRUE; FX_BOOL bLast = TRUE; - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -253,9 +253,9 @@ FX_FLOAT CFX_List::GetFirstHeight() const return 1.0f; } -FX_INT32 CFX_List::GetFirstSelected() const +int32_t CFX_List::GetFirstSelected() const { - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -266,9 +266,9 @@ FX_INT32 CFX_List::GetFirstSelected() const return -1; } -FX_INT32 CFX_List::GetLastSelected() const +int32_t CFX_List::GetLastSelected() const { - for (FX_INT32 i=m_aListItems.GetSize()-1; 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; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { nCircleIndex ++; if (nCircleIndex >= 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) delete m_aItems.GetAt(i); m_aItems.RemoveAll(); } -void CPLST_Select::Add(FX_INT32 nItemIndex) +void CPLST_Select::Add(int32_t nItemIndex) { - FX_INT32 nIndex = Find(nItemIndex); + int32_t nIndex = Find(nItemIndex); if (nIndex < 0) m_aItems.Add(new CPLST_Select_Item(nItemIndex,1)); @@ -398,21 +398,21 @@ void CPLST_Select::Add(FX_INT32 nItemIndex) } } -void CPLST_Select::Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex) +void CPLST_Select::Add(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++) 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -446,17 +446,17 @@ FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const return -1; } -FX_BOOL CPLST_Select::IsExist(FX_INT32 nItemIndex) const +FX_BOOL CPLST_Select::IsExist(int32_t nItemIndex) const { return Find(nItemIndex) >= 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -487,7 +487,7 @@ void CPLST_Select::DeselectAll() void CPLST_Select::Done() { - 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)) { @@ -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(); i<sz; i++) + for (int32_t i=0,sz=m_aSelItems.GetCount(); i<sz; i++) { - FX_INT32 nItemIndex = m_aSelItems.GetItemIndex(i); - FX_INT32 nState = m_aSelItems.GetState(i); + int32_t nItemIndex = m_aSelItems.GetItemIndex(i); + int32_t nState = m_aSelItems.GetState(i); switch(nState) { @@ -850,7 +850,7 @@ void CFX_ListCtrl::SelectItems() m_aSelItems.Done(); } -void CFX_ListCtrl::Select(FX_INT32 nItemIndex) +void CFX_ListCtrl::Select(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -863,7 +863,7 @@ void CFX_ListCtrl::Select(FX_INT32 nItemIndex) SetSingleSelect(nItemIndex); } -FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const +FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const { CPDF_Rect rcPlate = this->GetPlateRect(); 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; i<nCount; i++) + for (int32_t i=0; i<nCount; i++) { if (CPDFSDK_Widget* pTempWidget = pInterForm->GetWidget(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<sz; i++) + for (int32_t i=0,sz=dwCount; i<sz; i++) { if (p > 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; i<nCount; i++) + for (int32_t i=0; i<nCount; i++) { if (CXML_Element * pSubElement = pXML->GetElement(i)) { @@ -61,7 +61,7 @@ void CPWL_Edit::SetText(FX_LPCWSTR csText) { int nChild = pSubElement->CountChildren(); CFX_WideString swSection; - for(FX_INT32 j=0; j<nChild; j++) + for(int32_t j=0; j<nChild; j++) { swSection += pSubElement->GetContent(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;i<nCharArray;i++) + for (int32_t i=1;i<nCharArray;i++) { sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " << rcClient.bottom << " m\n" @@ -328,7 +328,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) << GetBorderDash().nGap << "] " << GetBorderDash().nPhase << " d\n"; - for (FX_INT32 i=1;i<nCharArray;i++) + for (int32_t i=1;i<nCharArray;i++) { sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " << rcClient.bottom << " m\n" @@ -411,7 +411,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser CPDF_Rect rcClient = GetClientRect(); CFX_ByteTextBuf sLine; - FX_INT32 nCharArray = m_pEdit->GetCharArray(); + 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; i<nCharArray-1; i++) + for (int32_t i=0; i<nCharArray-1; i++) { path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1), rcClient.bottom, FXPT_MOVETO); @@ -453,7 +453,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser CFX_PathData path; path.SetPointCount(nCharArraySafe.ValueOrDie()); - for (FX_INT32 i=0; i<nCharArray-1; i++) + for (int32_t i=0; i<nCharArray-1; i++) { path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1), rcClient.bottom, FXPT_MOVETO); @@ -563,9 +563,9 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) { m_pSpellCheck->SuggestWords(sLatin,sSuggestWords); - FX_INT32 nSuggest = sSuggestWords.GetSize(); + int32_t nSuggest = sSuggestWords.GetSize(); - for (FX_INT32 nWord=0; nWord<nSuggest; nWord++) + for (int32_t nWord=0; nWord<nSuggest; nWord++) { pSH->AppendMenuItem(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<sz; i++) + for (int32_t i=0,sz=m_aNativeFont.GetSize(); i<sz; i++) { if (CPWL_FontMap_Native* pData = m_aNativeFont.GetAt(i)) { @@ -182,13 +182,13 @@ CFX_ByteString CPWL_FontMap::GetNativeFontName(FX_INT32 nCharset) void CPWL_FontMap::Empty() { { - for (FX_INT32 i=0, sz=m_aData.GetSize(); i<sz; i++) + for (int32_t i=0, sz=m_aData.GetSize(); i<sz; i++) delete m_aData.GetAt(i); m_aData.RemoveAll(); } { - for (FX_INT32 i=0, sz=m_aNativeFont.GetSize(); i<sz; i++) + for (int32_t i=0, sz=m_aNativeFont.GetSize(); i<sz; i++) delete m_aNativeFont.GetAt(i); m_aNativeFont.RemoveAll(); @@ -223,7 +223,7 @@ const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldO FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName) { - for (FX_INT32 i=0; i<14; i++) + for (int32_t i=0; i<14; i++) { if (sFontName == g_sDEStandardFontName[i]) return TRUE; @@ -232,9 +232,9 @@ FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName) return FALSE; } -FX_INT32 CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset) +int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset) { - for (FX_INT32 i=0,sz=m_aData.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aData.GetSize(); i<sz; i++) { if (CPWL_FontMap_Data* pData = m_aData.GetAt(i)) { @@ -249,9 +249,9 @@ FX_INT32 CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, FX_INT32 nChars return -1; } -FX_INT32 CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind) +int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind) { - FX_INT32 nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset); + int32_t nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset); if (nFontIndex >= 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(); i<sz; i++) + for (int32_t i=0,sz=m_aData.GetSize(); i<sz; i++) { if (CPWL_FontMap_Data* pData = m_aData.GetAt(i)) { @@ -318,12 +318,12 @@ FX_INT32 CPWL_FontMap::GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset) return AddFontData(pNewFont, sAlias, nCharset); } -CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset) +CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset) { return NULL; } -FX_INT32 CPWL_FontMap::AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset) +int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, int32_t nCharset) { CPWL_FontMap_Data* pNewData = new CPWL_FontMap_Data; pNewData->pFont = 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; i<m_nListCount; i++) + for (int32_t i=0; i<m_nListCount; i++) { CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item(); @@ -188,7 +188,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp) sInfo.fSmallStep = 13.0f; sInfo.fBigStep = sInfo.fPlateWidth; - pParent->OnNotify(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(); i<sz; i++) + int32_t nIndex = 0; + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -270,7 +270,7 @@ FX_INT32 CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) return nIndex; } -void CPWL_IconList_Content::ScrollToItem(FX_INT32 nItemIndex) +void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) { CPDF_Rect rcClient = GetClientRect(); @@ -297,13 +297,13 @@ void CPWL_IconList_Content::ScrollToItem(FX_INT32 nItemIndex) this->InvalidateRect(); 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 && nItemIndex<m_aChildren.GetSize()) { @@ -363,25 +363,25 @@ CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(FX_INT32 nItemIndex) cons return NULL; } -void CPWL_IconList_Content::SetListData(FX_INT32 nItemIndex, void* pData) +void CPWL_IconList_Content::SetListData(int32_t nItemIndex, void* pData) { if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) pItem->SetData(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(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -408,7 +408,7 @@ void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color) /* -------------------- CPWL_IconList --------------------- */ -CPWL_IconList::CPWL_IconList(FX_INT32 nListCount) : +CPWL_IconList::CPWL_IconList(int32_t nListCount) : m_pListContent(NULL), m_nListCount(nListCount) { @@ -446,7 +446,7 @@ void CPWL_IconList::OnCreated() } } -void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); @@ -502,17 +502,17 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_ } } -void CPWL_IconList::SetSelect(FX_INT32 nIndex) +void CPWL_IconList::SetSelect(int32_t nIndex) { m_pListContent->SetSelect(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(); i<sz; i++) + for (int32_t i=0,sz=m_pList->GetCount(); i<sz; i++) { CPDF_Rect rcItem = m_pList->GetItemRect(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(); i<sz; i++) + for (int32_t i=0,sz=m_pList->GetCount(); i<sz; i++) { CPDF_Rect rcItem = m_pList->GetItemRect(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;i<this->GetCount();i++) + for(int32_t i=0;i<this->GetCount();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(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -91,7 +91,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth) return fRet; } -void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, FX_INT32 nStart) +void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart) { CPDF_Rect rcClient = GetClientRect(); @@ -103,7 +103,7 @@ void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, FX_INT32 nStart) if (CPWL_Wnd* pChild = m_aChildren.GetAt(nStart-1)) fy = pChild->GetWindowRect().bottom - m_fItemSpace; - for (FX_INT32 i=nStart,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=nStart,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -165,14 +165,14 @@ void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* CPDF_Rect rcClient = GetClientRect(); CPDF_Rect rcTemp = rcClient; pUser2Device->TransformRect(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(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -196,9 +196,9 @@ void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pDevice->RestoreState(); } -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(); i<sz; i++) + for (int32_t i=0, sz=m_aChildren.GetSize(); i<sz; i++) { if (pItem == m_aChildren.GetAt(i)) return i; diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp index 33d1b3b009..6e8ffcd546 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp @@ -179,7 +179,7 @@ void CPWL_Note_Edit::OnKillFocus() CPWL_Edit::OnKillFocus(); } -void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { if (m_bEnableNotify) { @@ -224,7 +224,7 @@ void CPWL_Note_Edit::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); } } 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(); i<sz; i++) + for (int32_t i=nIndex,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -531,7 +531,7 @@ IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CPDF_Point& point) { CPDF_Point pt = this->ParentToChild(point); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -546,20 +546,20 @@ IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CPDF_Point& point) return NULL; } -void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { switch (msg) { case PNM_NOTEEDITCHANGED: { - FX_INT32 nIndex = this->GetItemIndex(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(); i<sz; i++) + for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) pChild->OnNotify(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(); i<sz; i++) + for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) pChild->OnNotify(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(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -665,7 +665,7 @@ void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled) else m_pEdit->RemoveFlag(PES_NOREAD); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -831,7 +831,7 @@ void CPWL_NoteItem::SetAuthorName(const CFX_WideString& sName) } } -void CPWL_NoteItem::ResetSubjectName(FX_INT32 nItemIndex) +void CPWL_NoteItem::ResetSubjectName(int32_t nItemIndex) { if (nItemIndex < 0) { @@ -966,7 +966,7 @@ IPWL_NoteItem* CPWL_NoteItem::CreateSubItem() return CreateNoteItem(); } -FX_INT32 CPWL_NoteItem::CountSubItems() const +int32_t CPWL_NoteItem::CountSubItems() const { if (m_pContents) return m_pContents->CountSubItems(); @@ -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<nCount; i++) + for (int32_t i=0; i<nCount; i++) { switch (pPathData[i].type) { @@ -45,11 +45,11 @@ CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, return csAP.GetByteString(); } -void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount) +void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, int32_t nCount) { path.SetPointCount(nCount); - for (FX_INT32 i=0; i<nCount; i++) + for (int32_t i=0; i<nCount; i++) { switch (pPathData[i].type) { @@ -143,7 +143,7 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - const FX_INT32 num = 8; + const int32_t num = 8; CPWL_Point pts[num*3] = { @@ -188,7 +188,7 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) CPWL_Point(0.30f, 0.56f) }; - for (FX_INT32 j=0; j<num*3; j++) + for (int32_t j=0; j<num*3; j++) { pts[j].x *= fWidth; pts[j].x += crBBox.left; @@ -199,12 +199,12 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) csAP << pts[0].x << " " << pts[0].y << " m\n"; - for (FX_INT32 i=0; i<num; i++) + for (int32_t i=0; i<num; i++) { - FX_INT32 nCur = i*3; - FX_INT32 n1 = i*3 + 1; - FX_INT32 n2 = i*3 + 2; - FX_INT32 nNext = (i < num-1 ? (i+1)*3 : 0); + int32_t nCur = i*3; + int32_t n1 = i*3 + 1; + int32_t n2 = i*3 + 2; + int32_t nNext = (i < num-1 ? (i+1)*3 : 0); FX_FLOAT px1 = pts[n1].x - pts[nCur].x; FX_FLOAT py1 = pts[n1].y - pts[nCur].y; @@ -321,7 +321,7 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox) FX_FLOAT fAngel = PWL_PI/10.0f; - for (FX_INT32 i=0; i<5; i++) + for (int32_t i=0; i<5; i++) { px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel); py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel); @@ -331,8 +331,8 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox) csAP << px[0] << " " << py[0] << " m\n"; - FX_INT32 nNext = 0; - for (FX_INT32 j=0; j<5; j++) + int32_t nNext = 0; + for (int32_t j=0; j<5; j++) { nNext += 2; if (nNext >= 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; fx<fEndX; fx+=fStep,i++) { @@ -635,7 +635,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe } CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap, - const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV, + const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV, FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText) { CFX_ByteTextBuf sRet; @@ -674,7 +674,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, const CFX_WideString & sLabel, const CPWL_Color & crText, FX_FLOAT fFontSize, - FX_INT32 nLayOut) + int32_t nLayOut) { const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; @@ -947,7 +947,7 @@ CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_B CFX_ByteString CPWL_Utils::GetBorderAppStream(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) + int32_t nStyle, const CPWL_Dash & dash) { CFX_ByteTextBuf sAppStream; CFX_ByteString sColor; @@ -1045,7 +1045,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(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) + int32_t nStyle, const CPWL_Dash & dash) { CFX_ByteTextBuf sAppStream; CFX_ByteString sColor; @@ -1248,7 +1248,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPW } CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox, - FX_INT32 nStyle, + int32_t nStyle, const CPWL_Color & crText) { CPDF_Rect rcCenter = GetCenterSquare(rcBBox); @@ -1271,7 +1271,7 @@ CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox, } CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect & rcBBox, - FX_INT32 nStyle, + int32_t nStyle, const CPWL_Color & crText) { CPDF_Rect rcCenter = GetCenterSquare(rcBBox); @@ -1376,7 +1376,7 @@ void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &d dK = FX_MIN(dC, FX_MIN(dM, dY)); } -void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue) +void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, int32_t& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue) { switch (color.nColorType) { @@ -1406,16 +1406,16 @@ void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLO } } -FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy) +FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, int32_t nTransparancy) { - FX_INT32 nAlpha = nTransparancy; + int32_t nAlpha = nTransparancy; FX_FLOAT dRed = 0; FX_FLOAT dGreen = 0; FX_FLOAT dBlue = 0; PWLColorToARGB(color, nAlpha, dRed, dGreen, dBlue); - return ArgbEncode(nAlpha, (FX_INT32)(dRed*255), (FX_INT32)(dGreen*255), (FX_INT32)(dBlue*255)); + return ArgbEncode(nAlpha, (int32_t)(dRed*255), (int32_t)(dGreen*255), (int32_t)(dBlue*255)); } void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect, @@ -1428,13 +1428,13 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi } void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, - const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color) + const CPDF_Point* pPts, int32_t nCount, const FX_COLORREF& color) { CFX_PathData path; path.SetPointCount(nCount); path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO); - for (FX_INT32 i=1; i<nCount; i++) + for (int32_t i=1; i<nCount; i++) path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO); pDevice->DrawPath(&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; fx<fEndX; fx+=fStep,i++) { @@ -1713,10 +1713,10 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse 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); } @@ -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<FX_INT32, CPWL_Timer*>& GetPWLTimeMap() +static CFX_MapPtrTemplate<int32_t, CPWL_Timer*>& GetPWLTimeMap() { // Leak the object at shutdown. - static auto timeMap = new CFX_MapPtrTemplate<FX_INT32, CPWL_Timer*>; + static auto timeMap = new CFX_MapPtrTemplate<int32_t, CPWL_Timer*>; 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<sz; i++) + for( int32_t i=0,sz=m_aMousePath.GetSize(); i<sz; i++) if (m_aMousePath.GetAt(i) == pWnd) return TRUE; @@ -150,7 +150,7 @@ public: FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const { if (pWnd) - for( FX_INT32 i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++) + for( int32_t i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++) if (m_aKeyboardPath.GetAt(i) == pWnd) return TRUE; @@ -294,7 +294,7 @@ void CPWL_Wnd::Destroy() if (m_bCreated) { - for (FX_INT32 i = m_aChildren.GetSize()-1; 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<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -468,7 +468,7 @@ void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2 void CPWL_Wnd::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -524,7 +524,7 @@ FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\ {\ if (IsWndCaptureKeyboard(this))\ {\ - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ {\ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\ {\ @@ -546,7 +546,7 @@ FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\ {\ if (IsWndCaptureMouse(this))\ {\ - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ {\ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\ {\ @@ -560,7 +560,7 @@ FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\ }\ else\ {\ - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++)\ {\ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\ {\ @@ -599,7 +599,7 @@ FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD SetCursor(); if (IsWndCaptureKeyboard(this)) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) { @@ -621,7 +621,7 @@ void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd) void CPWL_Wnd::RemoveChild(CPWL_Wnd * pWnd) { - for (FX_INT32 i = m_aChildren.GetSize()-1; 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(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) pChild->ReleaseCapture(); @@ -918,7 +918,7 @@ void CPWL_Wnd::SetVisible(FX_BOOL bVisible) { if (IsValid()) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -975,7 +975,7 @@ void CPWL_Wnd::SetCursor() { if (IFX_SystemHandler* pSH = GetSystemHandler()) { - FX_INT32 nCursorType = this->GetCreationParam().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<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -1155,13 +1155,13 @@ CPDF_Matrix CPWL_Wnd::GetWindowMatrix() const return mt; } -void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, FX_INT32& x, FX_INT32& y) const +void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const { CPDF_Matrix mt = GetWindowMatrix(); CPDF_Point pt = point; mt.Transform(pt.x,pt.y); - x = (FX_INT32)(pt.x+0.5); - y = (FX_INT32)(pt.y+0.5); + x = (int32_t)(pt.x+0.5); + y = (int32_t)(pt.y+0.5); } FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect & rect) const @@ -1169,7 +1169,7 @@ FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect & rect) const CPDF_Rect rcTemp = rect; CPDF_Matrix mt = GetWindowMatrix(); mt.TransformRect(rcTemp); - return FX_RECT((FX_INT32)(rcTemp.left+0.5), (FX_INT32)(rcTemp.bottom+0.5), (FX_INT32)(rcTemp.right+0.5), (FX_INT32)(rcTemp.top+0.5)); + return FX_RECT((int32_t)(rcTemp.left+0.5), (int32_t)(rcTemp.bottom+0.5), (int32_t)(rcTemp.right+0.5), (int32_t)(rcTemp.top+0.5)); } FX_HWND CPWL_Wnd::GetAttachedHWnd() const @@ -1275,7 +1275,7 @@ void CPWL_Wnd::EnableWindow(FX_BOOL bEnable) { if (m_bEnabled != bEnable) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index 33c51c5336..7032d6078c 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -7,16 +7,18 @@ #ifndef PUBLIC_FPDF_EDIT_H_ #define PUBLIC_FPDF_EDIT_H_ +#include <stdint.h> + #include "fpdfview.h" // Define all types used in the SDK. Note they can be simply regarded as opaque pointers // or long integer numbers. -#define FPDF_ARGB(a,r,g,b) ((((FX_DWORD)(((FX_BYTE)(b)|((FX_WORD)((FX_BYTE)(g))<<8))|(((FX_DWORD)(FX_BYTE)(r))<<16)))) | (((FX_DWORD)(FX_BYTE)(a))<<24)) -#define FPDF_GetBValue(argb) ((FX_BYTE)(argb)) -#define FPDF_GetGValue(argb) ((FX_BYTE)(((FX_WORD)(argb)) >> 8)) -#define FPDF_GetRValue(argb) ((FX_BYTE)((argb)>>16)) -#define FPDF_GetAValue(argb) ((FX_BYTE)((argb)>>24)) +#define FPDF_ARGB(a,r,g,b) ((((uint32_t)(((uint8_t)(b)|((FX_WORD)((uint8_t)(g))<<8))|(((FX_DWORD)(uint8_t)(r))<<16)))) | (((FX_DWORD)(uint8_t)(a))<<24)) +#define FPDF_GetBValue(argb) ((uint8_t)(argb)) +#define FPDF_GetGValue(argb) ((uint8_t)(((uint16_t)(argb)) >> 8)) +#define FPDF_GetRValue(argb) ((uint8_t)((argb)>>16)) +#define FPDF_GetAValue(argb) ((uint8_t)((argb)>>24)) #ifdef __cplusplus extern "C" { diff --git a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h index 82a098ebbb..196e6503d9 100644 --- a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h @@ -22,8 +22,8 @@ public: virtual FWL_ERR Empty() = 0;
virtual FX_BOOL IsDataAvailable(FX_DWORD dwFormat) = 0;
virtual FWL_HCLIPBOARDDATA GetData(FX_DWORD dwFormat) = 0;
- virtual FWL_ERR SetData(FX_DWORD dwFormat, FX_BYTE *pBuf, FX_INT32 iSize) = 0;
- virtual FX_INT32 GetDataSize(FWL_HCLIPBOARDDATA hData) = 0;
+ virtual FWL_ERR SetData(FX_DWORD dwFormat, uint8_t *pBuf, int32_t iSize) = 0;
+ virtual int32_t GetDataSize(FWL_HCLIPBOARDDATA hData) = 0;
virtual FX_LPVOID LockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0;
virtual FX_BOOL UnLockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0;
virtual FWL_ERR SetStringData(FX_WSTR ws) = 0;
diff --git a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h index bd194964c9..8830a3de81 100644 --- a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h +++ b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h @@ -13,8 +13,8 @@ typedef struct _FWL_HMONITOR { class IFWL_AdapterMonitorMgr
{
public:
- virtual FX_INT32 CountMonitors() = 0;
- virtual FWL_HMONITOR GetMonitor(FX_INT32 nIndex) = 0;
+ virtual int32_t CountMonitors() = 0;
+ virtual FWL_HMONITOR GetMonitor(int32_t nIndex) = 0;
virtual FWL_HMONITOR GetCurrentMonitor() = 0;
virtual FWL_HMONITOR GetMonitorByRect(const CFX_RectF &rect) = 0;
virtual FWL_HMONITOR GetMonitorByPoint(FX_FLOAT fx, FX_FLOAT fy) = 0;
diff --git a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h b/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h index ad6cd58245..f3e01855b0 100644 --- a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h @@ -16,8 +16,8 @@ public: virtual FWL_ERR Start(IFWL_Thread *pThread, FWL_HTHREAD &hThread, FX_BOOL bSuspended = FALSE) = 0;
virtual FWL_ERR Resume(FWL_HTHREAD hThread) = 0;
virtual FWL_ERR Suspend(FWL_HTHREAD hThread) = 0;
- virtual FWL_ERR Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode) = 0;
- virtual FWL_ERR Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode) = 0;
+ virtual FWL_ERR Kill(FWL_HTHREAD hThread, int32_t iExitCode) = 0;
+ virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode) = 0;
virtual IFWL_Thread* GetCurrentThread() = 0;
};
class IFWL_AdapterSemaphore
@@ -28,6 +28,6 @@ public: virtual FWL_ERR Wait() const = 0;
virtual FWL_ERR Post() = 0;
virtual FWL_ERR Value(FX_DWORD &val) const = 0;
- virtual FWL_ERR Reset(FX_INT32 init) = 0;
+ virtual FWL_ERR Reset(int32_t init) = 0;
};
#endif
diff --git a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h b/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h index fbc296f7fa..e8c3b89674 100644 --- a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h @@ -37,7 +37,7 @@ public: virtual FX_BOOL IsIdleMessage() = 0;
virtual FWL_ERR DispatchMessage() = 0;
virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect) = 0;
- virtual FWL_ERR Exit(FX_INT32 iExitCode) = 0;
+ virtual FWL_ERR Exit(int32_t iExitCode) = 0;
virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget *pWidget, FX_LPVOID UserData) = 0;
virtual FWL_ERR GetWidgetDC(IFWL_Widget *pWidget, FX_LPVOID &pDC) = 0;
virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget *pWidget, FX_LPVOID pDC, CFX_RectF *pClip = 0) = 0;
@@ -46,8 +46,8 @@ public: virtual FWL_ERR RunLoop(IFWL_Widget *widget) = 0;
virtual FWL_ERR EndLoop() = 0;
virtual FWL_ERR InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) = 0;
- virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType) = 0;
- virtual FX_INT32 TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) = 0;
+ virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, int32_t iType) = 0;
+ virtual int32_t TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) = 0;
virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook *hook) = 0;
virtual FWL_ERR GetSystemBorder(FX_FLOAT &l, FX_FLOAT &t, FX_FLOAT &r, FX_FLOAT &b) = 0;
virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup) = 0;
diff --git a/xfa/include/fwl/adapter/fwl_sdadapterimp.h b/xfa/include/fwl/adapter/fwl_sdadapterimp.h index 6f8170ff5c..323a0ba4fc 100644 --- a/xfa/include/fwl/adapter/fwl_sdadapterimp.h +++ b/xfa/include/fwl/adapter/fwl_sdadapterimp.h @@ -31,7 +31,7 @@ public: virtual FWL_ERR SetMinimize(IFWL_Widget *pWidget);
virtual FWL_ERR RunWidget(IFWL_Widget *pWidget);
virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect);
- virtual FWL_ERR Exit(FX_INT32 iExitCode);
+ virtual FWL_ERR Exit(int32_t iExitCode);
virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget *pWidget, void *vp);
virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup);
public:
@@ -51,8 +51,8 @@ public: virtual FWL_ERR RunLoop(IFWL_Widget *widget);
virtual FWL_ERR EndLoop();
virtual FWL_ERR InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData);
- virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType);
- virtual FX_INT32 TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData);
+ virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, int32_t iType);
+ virtual int32_t TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData);
virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook *hook);
virtual FWL_ERR GetSystemBorder(FX_FLOAT &l, FX_FLOAT &t, FX_FLOAT &r, FX_FLOAT &b);
};
@@ -65,8 +65,8 @@ public: virtual FWL_ERR Start(IFWL_Thread *pThread, FWL_HTHREAD &hThread, FX_BOOL bSuspended = FALSE);
virtual FWL_ERR Resume(FWL_HTHREAD hThread);
virtual FWL_ERR Suspend(FWL_HTHREAD hThread);
- virtual FWL_ERR Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode);
- virtual FWL_ERR Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode);
+ virtual FWL_ERR Kill(FWL_HTHREAD hThread, int32_t iExitCode);
+ virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode);
virtual IFWL_Thread* GetCurrentThread();
};
#endif
diff --git a/xfa/include/fwl/basewidget/fwl_barcode.h b/xfa/include/fwl/basewidget/fwl_barcode.h index ba6e99691e..08f28b7b7d 100644 --- a/xfa/include/fwl/basewidget/fwl_barcode.h +++ b/xfa/include/fwl/basewidget/fwl_barcode.h @@ -34,17 +34,17 @@ class IFWL_BarcodeDP : public IFWL_EditDP {
public:
virtual BC_CHAR_ENCODING GetCharEncoding() = 0;
- virtual FX_INT32 GetModuleHeight() = 0;
- virtual FX_INT32 GetModuleWidth() = 0;
- virtual FX_INT32 GetDataLength() = 0;
- virtual FX_INT32 GetCalChecksum() = 0;
+ virtual int32_t GetModuleHeight() = 0;
+ virtual int32_t GetModuleWidth() = 0;
+ virtual int32_t GetDataLength() = 0;
+ virtual int32_t GetCalChecksum() = 0;
virtual FX_BOOL GetPrintChecksum() = 0;
virtual BC_TEXT_LOC GetTextLocation() = 0;
- virtual FX_INT32 GetWideNarrowRatio() = 0;
+ virtual int32_t GetWideNarrowRatio() = 0;
virtual FX_CHAR GetStartChar() = 0;
virtual FX_CHAR GetEndChar() = 0;
- virtual FX_INT32 GetVersion() = 0;
- virtual FX_INT32 GetErrorCorrectionLevel() = 0;
+ virtual int32_t GetVersion() = 0;
+ virtual int32_t GetErrorCorrectionLevel() = 0;
virtual FX_BOOL GetTruncated() = 0;
virtual FX_DWORD GetBarcodeAttributeMask() = 0;
};
diff --git a/xfa/include/fwl/basewidget/fwl_checkbox.h b/xfa/include/fwl/basewidget/fwl_checkbox.h index 625ad489c2..0576dedcf3 100644 --- a/xfa/include/fwl/basewidget/fwl_checkbox.h +++ b/xfa/include/fwl/basewidget/fwl_checkbox.h @@ -74,8 +74,8 @@ public: static IFWL_CheckBox* Create();
FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FX_INT32 GetCheckState();
- FWL_ERR SetCheckState(FX_INT32 iCheck);
+ int32_t GetCheckState();
+ FWL_ERR SetCheckState(int32_t iCheck);
protected:
IFWL_CheckBox();
virtual ~IFWL_CheckBox();
@@ -86,8 +86,8 @@ public: static IFWL_RadioButton* Create();
FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FX_INT32 GetCheckState();
- FWL_ERR SetCheckState(FX_INT32 iCheck);
+ int32_t GetCheckState();
+ FWL_ERR SetCheckState(int32_t iCheck);
protected:
IFWL_RadioButton();
virtual ~IFWL_RadioButton();
diff --git a/xfa/include/fwl/basewidget/fwl_combobox.h b/xfa/include/fwl/basewidget/fwl_combobox.h index 74d6bdf24b..950189bbba 100644 --- a/xfa/include/fwl/basewidget/fwl_combobox.h +++ b/xfa/include/fwl/basewidget/fwl_combobox.h @@ -74,7 +74,7 @@ END_FWL_EVENT_DEF BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbCloseUp, FWL_EVTHASH_CMB_CloseUp)
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbEditChanged, FWL_EVTHASH_CMB_EditChanged)
-FX_INT32 nChangeType;
+int32_t nChangeType;
CFX_WideString wsInsert;
CFX_WideString wsDelete;
END_FWL_EVENT_DEF
@@ -83,12 +83,12 @@ CFX_Int32Array iArraySels; FX_BOOL bLButtonUp;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbHoverChanged, FWL_EVTHASH_CMB_HoverChanged)
-FX_INT32 m_iCurHover;
+int32_t m_iCurHover;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbDrawItem, FWL_EVTHASH_CMB_DrawItem)
CFX_Graphics *m_pGraphics;
CFX_Matrix m_matrix;
-FX_INT32 m_index;
+int32_t m_index;
CFX_RectF m_rtItem;
END_FWL_EVENT_DEF
class IFWL_ComboBoxDP : public IFWL_ListBoxDP
@@ -102,16 +102,16 @@ public: static IFWL_ComboBox* Create();
FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FX_INT32 GetCurSel();
- FWL_ERR SetCurSel(FX_INT32 iSel);
+ int32_t GetCurSel();
+ FWL_ERR SetCurSel(int32_t iSel);
FWL_ERR SetEditText(const CFX_WideString &wsText);
- FX_INT32 GetEditTextLength() const;
- FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
- FWL_ERR SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- FX_INT32 GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
- FX_INT32 GetEditLimit();
- FWL_ERR SetEditLimit(FX_INT32 nLimit);
- FWL_ERR EditDoClipboard(FX_INT32 iCmd);
+ int32_t GetEditTextLength() const;
+ FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
+ FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1);
+ int32_t GetEditSelRange(int32_t nIndex, int32_t &nStart);
+ int32_t GetEditLimit();
+ FWL_ERR SetEditLimit(int32_t nLimit);
+ FWL_ERR EditDoClipboard(int32_t iCmd);
FX_BOOL EditRedo(FX_BSTR bsRecord);
FX_BOOL EditUndo(FX_BSTR bsRecord);
IFWL_ListBox* GetListBoxt();
diff --git a/xfa/include/fwl/basewidget/fwl_datetimepicker.h b/xfa/include/fwl/basewidget/fwl_datetimepicker.h index 898264eeec..3f2a60d792 100644 --- a/xfa/include/fwl/basewidget/fwl_datetimepicker.h +++ b/xfa/include/fwl/basewidget/fwl_datetimepicker.h @@ -54,17 +54,17 @@ BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpEditChanged, FWL_EVTHASH_DTP_EditChanged) CFX_WideString m_wsText;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpHoverChanged, FWL_EVTHASH_DTP_HoverChanged)
-FX_INT32 hoverday;
+int32_t hoverday;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpSelectChanged, FWL_EVTHASH_DTP_SelectChanged)
-FX_INT32 iYear;
-FX_INT32 iMonth;
-FX_INT32 iDay;
+int32_t iYear;
+int32_t iMonth;
+int32_t iDay;
END_FWL_EVENT_DEF
class IFWL_DateTimePickerDP : public IFWL_DataProvider
{
public:
- virtual FWL_ERR GetToday(IFWL_Widget *pWidget, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) = 0;
+ virtual FWL_ERR GetToday(IFWL_Widget *pWidget, int32_t &iYear, int32_t &iMonth, int32_t &iDay) = 0;
};
class IFWL_DateTimePicker : public IFWL_Widget
{
@@ -72,12 +72,12 @@ public: static IFWL_DateTimePicker* Create();
FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FWL_ERR GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- FWL_ERR SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ FWL_ERR GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
FWL_ERR SetEditText(const CFX_WideString &wsText);
- FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
- FX_INT32 CountSelRanges();
- FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
+ FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
+ int32_t CountSelRanges();
+ int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
FX_BOOL CanUndo();
FX_BOOL CanRedo();
FX_BOOL Undo();
@@ -92,7 +92,7 @@ public: FX_BOOL Delete();
FX_BOOL DeSelect();
FWL_ERR GetBBox(CFX_RectF &rect);
- FWL_ERR SetEditLimit(FX_INT32 nLimit);
+ FWL_ERR SetEditLimit(int32_t nLimit);
FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved);
protected:
IFWL_DateTimePicker();
diff --git a/xfa/include/fwl/basewidget/fwl_edit.h b/xfa/include/fwl/basewidget/fwl_edit.h index 18bdee662b..78072d0cf8 100644 --- a/xfa/include/fwl/basewidget/fwl_edit.h +++ b/xfa/include/fwl/basewidget/fwl_edit.h @@ -78,7 +78,7 @@ BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtAddDoRecord, FWL_EVTHASH_EDT_AddDoRecord) CFX_ByteString m_wsDoRecord;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged)
-FX_INT32 nChangeType;
+int32_t nChangeType;
CFX_WideString wsInsert;
CFX_WideString wsDelete;
CFX_WideString wsPrevText;
@@ -121,25 +121,25 @@ public: FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
FWL_ERR SetText(const CFX_WideString &wsText);
- FX_INT32 GetTextLength() const;
- FWL_ERR GetText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
+ int32_t GetTextLength() const;
+ FWL_ERR GetText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
FWL_ERR ClearText();
- FX_INT32 GetCaretPos() const;
- FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE);
- FWL_ERR AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- FX_INT32 CountSelRanges();
- FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
+ int32_t GetCaretPos() const;
+ int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1);
+ int32_t CountSelRanges();
+ int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
FWL_ERR ClearSelections();
- FX_INT32 GetLimit();
- FWL_ERR SetLimit(FX_INT32 nLimit);
+ int32_t GetLimit();
+ FWL_ERR SetLimit(int32_t nLimit);
FWL_ERR SetAliasChar(FX_WCHAR wAlias);
FWL_ERR SetFormatString(const CFX_WideString &wsFormat);
- FWL_ERR Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen);
+ FWL_ERR Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen);
FWL_ERR DeleteSelections();
- FWL_ERR DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1);
+ FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1);
FWL_ERR ReplaceSelections(const CFX_WideStringC &wsReplace);
- FWL_ERR Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace);
- FWL_ERR DoClipboard(FX_INT32 iCmd);
+ FWL_ERR Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace);
+ FWL_ERR DoClipboard(int32_t iCmd);
FX_BOOL Copy(CFX_WideString &wsCopy);
FX_BOOL Cut(CFX_WideString &wsCut);
FX_BOOL Paste(const CFX_WideString &wsPaste);
@@ -152,7 +152,7 @@ public: FX_BOOL CanRedo();
FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
FWL_ERR SetOuter(IFWL_Widget *pOuter);
- FWL_ERR SetNumberRange(FX_INT32 iMin, FX_INT32 iMax);
+ FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
FWL_ERR SetBackColor(FX_DWORD dwColor);
FWL_ERR SetFont(const CFX_WideString &wsFont, FX_FLOAT fSize);
void SetScrollOffset(FX_FLOAT fScrollOffset);
diff --git a/xfa/include/fwl/basewidget/fwl_listbox.h b/xfa/include/fwl/basewidget/fwl_listbox.h index 4b2f2555c5..466d919a5e 100644 --- a/xfa/include/fwl/basewidget/fwl_listbox.h +++ b/xfa/include/fwl/basewidget/fwl_listbox.h @@ -54,7 +54,7 @@ END_FWL_EVENT_DEF BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem)
CFX_Graphics *m_pGraphics;
CFX_Matrix m_matrix;
-FX_INT32 m_index;
+int32_t m_index;
CFX_RectF m_rect;
END_FWL_EVENT_DEF
typedef struct _FWL_HLISTITEM {
@@ -62,15 +62,15 @@ typedef struct _FWL_HLISTITEM { }* FWL_HLISTITEM;
typedef struct _FWL_ListBoxItemData {
IFWL_ListBoxDP *pDataProvider;
- FX_INT32 iIndex;
+ int32_t iIndex;
} FWL_ListBoxItemData;
class IFWL_ListBoxDP : public IFWL_DataProvider
{
public:
- virtual FX_INT32 CountItems(IFWL_Widget *pWidget) = 0;
- virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex) = 0;
- virtual FX_INT32 GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) = 0;
- virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex) = 0;
+ virtual int32_t CountItems(IFWL_Widget *pWidget) = 0;
+ virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, int32_t nIndex) = 0;
+ virtual int32_t GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) = 0;
+ virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex) = 0;
virtual FX_DWORD GetItemStyles(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) = 0;
virtual FWL_ERR GetItemText(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, CFX_WideString &wsText) = 0;
virtual FWL_ERR GetItemRect(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, CFX_RectF &rtItem) = 0;
@@ -88,7 +88,7 @@ public: class IFWL_ListBoxCompare
{
public:
- virtual FX_INT32 Compare(FWL_HLISTITEM hLeft, FWL_HLISTITEM hRight) = 0;
+ virtual int32_t Compare(FWL_HLISTITEM hLeft, FWL_HLISTITEM hRight) = 0;
};
class IFWL_ListBox : public IFWL_Widget
{
@@ -96,9 +96,9 @@ public: static IFWL_ListBox* Create();
FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FX_INT32 CountSelItems();
- FWL_HLISTITEM GetSelItem(FX_INT32 nIndexSel);
- FX_INT32 GetSelIndex(FX_INT32 nIndex);
+ int32_t CountSelItems();
+ FWL_HLISTITEM GetSelItem(int32_t nIndexSel);
+ int32_t GetSelIndex(int32_t nIndex);
FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE);
FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString &wsText);
FWL_ERR GetScrollPos(FX_FLOAT &fPos, FX_BOOL bVert = TRUE);
diff --git a/xfa/include/fwl/basewidget/fwl_monthcalendar.h b/xfa/include/fwl/basewidget/fwl_monthcalendar.h index 7ad8f8a364..ba6deef746 100644 --- a/xfa/include/fwl/basewidget/fwl_monthcalendar.h +++ b/xfa/include/fwl/basewidget/fwl_monthcalendar.h @@ -97,21 +97,21 @@ class IFWL_MonthCalendar; #define FWL_NOTEHASH_MCD_DATASELECTED 1085596932
#define FWL_EVTHASH_MCD_DateChanged 54212227
BEGIN_FWL_EVENT_DEF(CFWL_Event_McdDateSelected, FWL_NOTEHASH_MCD_DATASELECTED)
-FX_INT32 m_iStartDay;
-FX_INT32 m_iEndDay;
+int32_t m_iStartDay;
+int32_t m_iEndDay;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EventMcdDateChanged, FWL_EVTHASH_MCD_DateChanged)
-FX_INT32 m_iOldYear;
-FX_INT32 m_iOldMonth;
-FX_INT32 m_iStartDay;
-FX_INT32 m_iEndDay;
+int32_t m_iOldYear;
+int32_t m_iOldMonth;
+int32_t m_iStartDay;
+int32_t m_iEndDay;
END_FWL_EVENT_DEF
class IFWL_MonthCalendarDP : public IFWL_DataProvider
{
public:
- virtual FX_INT32 GetCurDay(IFWL_Widget *pWidget) = 0;
- virtual FX_INT32 GetCurMonth(IFWL_Widget *pWidget) = 0;
- virtual FX_INT32 GetCurYear(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetCurDay(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetCurMonth(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetCurYear(IFWL_Widget *pWidget) = 0;
};
class IFWL_MonthCalendar : public IFWL_Widget
{
@@ -120,9 +120,9 @@ public: FWL_ERR Initialize(IFWL_Widget *pOuter = NULL);
FWL_ERR Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
- FX_INT32 CountSelect();
- FX_BOOL GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex = 0);
- FX_BOOL SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ int32_t CountSelect();
+ FX_BOOL GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex = 0);
+ FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
protected:
IFWL_MonthCalendar();
virtual ~IFWL_MonthCalendar();
diff --git a/xfa/include/fwl/basewidget/fwl_picturebox.h b/xfa/include/fwl/basewidget/fwl_picturebox.h index 419fd4e0d1..c6b732ca63 100644 --- a/xfa/include/fwl/basewidget/fwl_picturebox.h +++ b/xfa/include/fwl/basewidget/fwl_picturebox.h @@ -37,8 +37,8 @@ public: virtual CFX_DIBitmap* GetPicture(IFWL_Widget *pWidget) = 0;
virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget *pWidget) = 0;
virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget *pWidget) = 0;
- virtual FX_INT32 GetOpacity(IFWL_Widget *pWidget) = 0;
- virtual FX_INT32 GetFlipMode(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetOpacity(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetFlipMode(IFWL_Widget *pWidget) = 0;
virtual FWL_ERR GetMatrix(IFWL_Widget *pWidget, CFX_Matrix &matrix) = 0;
};
class IFWL_PictureBox : public IFWL_Widget
diff --git a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h b/xfa/include/fwl/basewidget/fwl_tooltipctrl.h index d27b9a2638..2df14126f1 100644 --- a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h +++ b/xfa/include/fwl/basewidget/fwl_tooltipctrl.h @@ -24,8 +24,8 @@ class IFWL_ToolTipDP : public IFWL_DataProvider {
public:
virtual FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption) = 0;
- virtual FX_INT32 GetInitialDelay(IFWL_Widget *pWidget) = 0;
- virtual FX_INT32 GetAutoPopDelay(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetInitialDelay(IFWL_Widget *pWidget) = 0;
+ virtual int32_t GetAutoPopDelay(IFWL_Widget *pWidget) = 0;
virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget *pWidget) = 0;
virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget *pWidget) = 0;
};
diff --git a/xfa/include/fwl/basewidget/fxmath_barcode.h b/xfa/include/fwl/basewidget/fxmath_barcode.h index d885ac4c57..3fcd341892 100644 --- a/xfa/include/fwl/basewidget/fxmath_barcode.h +++ b/xfa/include/fwl/basewidget/fxmath_barcode.h @@ -11,30 +11,30 @@ class IFX_Barcode public:
virtual void Release() = 0;
virtual BC_TYPE GetType() = 0;
- virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) = 0;
- virtual CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height, FX_INT32 &errorCode) = 0;
- virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &errorCode) = 0;
+ virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) = 0;
+ virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) = 0;
+ virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) = 0;
+ virtual CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t height, int32_t &errorCode) = 0;
+ virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &errorCode) = 0;
virtual FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding) = 0;
- virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight) = 0;
- virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth) = 0;
- virtual FX_BOOL SetHeight(FX_INT32 height) = 0;
- virtual FX_BOOL SetWidth(FX_INT32 width) = 0;
+ virtual FX_BOOL SetModuleHeight(int32_t moduleHeight) = 0;
+ virtual FX_BOOL SetModuleWidth(int32_t moduleWidth) = 0;
+ virtual FX_BOOL SetHeight(int32_t height) = 0;
+ virtual FX_BOOL SetWidth(int32_t width) = 0;
virtual FX_BOOL CheckContentValidity(FX_WSTR contents) = 0;
virtual FX_BOOL SetPrintChecksum(FX_BOOL checksum) = 0;
- virtual FX_BOOL SetDataLength(FX_INT32 length) = 0;
- virtual FX_BOOL SetCalChecksum(FX_INT32 state) = 0;
+ virtual FX_BOOL SetDataLength(int32_t length) = 0;
+ virtual FX_BOOL SetCalChecksum(int32_t state) = 0;
virtual FX_BOOL SetFont(CFX_Font* pFont) = 0;
virtual FX_BOOL SetFontSize(FX_FLOAT size) = 0;
- virtual FX_BOOL SetFontStyle(FX_INT32 style) = 0;
+ virtual FX_BOOL SetFontStyle(int32_t style) = 0;
virtual FX_BOOL SetFontColor(FX_ARGB color) = 0;
virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location) = 0;
- virtual FX_BOOL SetWideNarrowRatio(FX_INT32 ratio) = 0;
+ virtual FX_BOOL SetWideNarrowRatio(int32_t ratio) = 0;
virtual FX_BOOL SetStartChar(FX_CHAR start) = 0;
virtual FX_BOOL SetEndChar(FX_CHAR end) = 0;
- virtual FX_BOOL SetVersion(FX_INT32 version) = 0;
- virtual FX_BOOL SetErrorCorrectionLevel (FX_INT32 level) = 0;
+ virtual FX_BOOL SetVersion(int32_t version) = 0;
+ virtual FX_BOOL SetErrorCorrectionLevel (int32_t level) = 0;
virtual FX_BOOL SetTruncated(FX_BOOL truncated) = 0;
};
IFX_Barcode* FX_Barcode_Create(BC_TYPE type);
diff --git a/xfa/include/fwl/core/fwl_app.h b/xfa/include/fwl/core/fwl_app.h index 89f6309a31..b0cb1857e4 100644 --- a/xfa/include/fwl/core/fwl_app.h +++ b/xfa/include/fwl/core/fwl_app.h @@ -22,7 +22,7 @@ public: virtual IFWL_AdapterNative* GetAdapterNative() = 0;
virtual IFWL_WidgetMgr* GetWidgetMgr() = 0;
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) = 0;
- virtual FWL_ERR Exit(FX_INT32 iExitCode = 0) = 0;
+ virtual FWL_ERR Exit(int32_t iExitCode = 0) = 0;
};
IFWL_App* FWL_GetApp();
void FWL_SetApp(IFWL_App *pApp);
diff --git a/xfa/include/fwl/core/fwl_content.h b/xfa/include/fwl/core/fwl_content.h index 51d5e9e8df..4a00154ef3 100644 --- a/xfa/include/fwl/core/fwl_content.h +++ b/xfa/include/fwl/core/fwl_content.h @@ -13,7 +13,7 @@ class IFWL_Content : public IFWL_Widget public:
static IFWL_Content* Create();
FWL_ERR Initialize();
- FWL_ERR InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex = -1);
+ FWL_ERR InsertWidget(IFWL_Widget *pChild, int32_t nIndex = -1);
FWL_ERR RemoveWidget(IFWL_Widget *pWidget);
FWL_ERR RemoveAllWidgets();
FWL_ERR GetMinSize(FX_FLOAT &fWidth, FX_FLOAT &fHeight);
diff --git a/xfa/include/fwl/core/fwl_error.h b/xfa/include/fwl/core/fwl_error.h index d790bee5ac..465808a116 100644 --- a/xfa/include/fwl/core/fwl_error.h +++ b/xfa/include/fwl/core/fwl_error.h @@ -6,7 +6,7 @@ #ifndef _FWL_ERROR_H
#define _FWL_ERROR_H
-typedef FX_INT32 FWL_ERR;
+typedef int32_t FWL_ERR;
#define FWL_ERR_Succeeded 0
#define FWL_ERR_Indefinite -1
#define FWL_ERR_Parameter_Invalid -100
diff --git a/xfa/include/fwl/core/fwl_grid.h b/xfa/include/fwl/core/fwl_grid.h index e86c3dabe9..0d4e2d61f8 100644 --- a/xfa/include/fwl/core/fwl_grid.h +++ b/xfa/include/fwl/core/fwl_grid.h @@ -46,10 +46,10 @@ public: FWL_ERR Initialize();
FWL_ERR Initialize(CFWL_WidgetImpProperties &properties);
- FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex = -1);
- FX_INT32 CountColRows(FX_BOOL bColumn);
- FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, FX_INT32 nIndex);
- FX_INT32 GetIndex(FWL_HGRIDCOLROW hColRow);
+ FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1);
+ int32_t CountColRows(FX_BOOL bColumn);
+ FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex);
+ int32_t GetIndex(FWL_HGRIDCOLROW hColRow);
FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit);
FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit);
FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit);
@@ -58,10 +58,10 @@ public: FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit);
FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow);
FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow);
- FX_INT32 GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn);
- FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn);
- FX_INT32 GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn);
- FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn);
+ int32_t GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn);
+ FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn);
+ int32_t GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn);
+ FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn);
FX_FLOAT GetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FWL_GRIDUNIT &eUnit);
FWL_ERR SetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit);
FX_BOOL GetWidgetMargin(IFWL_Widget *pWidget, FWL_GRIDMARGIN eMargin, FX_FLOAT &fMargin);
diff --git a/xfa/include/fwl/core/fwl_note.h b/xfa/include/fwl/core/fwl_note.h index 1cc88a6593..7e553a9eb2 100644 --- a/xfa/include/fwl/core/fwl_note.h +++ b/xfa/include/fwl/core/fwl_note.h @@ -174,7 +174,7 @@ protected: {
return TRUE;
}
- virtual FX_INT32 Finalize()
+ virtual int32_t Finalize()
{
return 0;
}
@@ -235,8 +235,8 @@ END_FWL_MESSAGE_DEF BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, FWL_MSGHASH_Cursor)
END_FWL_MESSAGE_DEF
BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, FWL_MSGHASH_Size)
-FX_INT32 m_iWidth;
-FX_INT32 m_iHeight;
+int32_t m_iWidth;
+int32_t m_iHeight;
END_FWL_MESSAGE_DEF
BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, FWL_MSGHASH_WindowMove)
FX_FLOAT m_fx;
@@ -321,7 +321,7 @@ FX_FLOAT m_fPosY; IFWL_Widget *m_pOwner;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, FWL_EVTHASH_MenuCommand)
-FX_INT32 m_iCommand;
+int32_t m_iCommand;
FX_LPVOID m_pData;
END_FWL_EVENT_DEF
BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, FWL_EVTHASH_SizeChanged)
@@ -351,8 +351,8 @@ public: virtual FWL_ERR RegisterEventTarget(IFWL_Widget *pListener, IFWL_Widget *pEventSource = NULL, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0;
virtual FWL_ERR UnregisterEventTarget(IFWL_Widget *pListener) = 0;
virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0;
- virtual FX_INT32 GetQueueMaxSize() const = 0;
- virtual FWL_ERR SetQueueMaxSize(const FX_INT32 size) = 0;
+ virtual int32_t GetQueueMaxSize() const = 0;
+ virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0;
virtual IFWL_NoteThread* GetOwnerThread() const = 0;
virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop *pNoteLoop) = 0;
virtual IFWL_NoteLoop* PopNoteLoop() = 0;
@@ -364,7 +364,7 @@ class IFWL_NoteLoop {
public:
virtual FX_BOOL PreProcessMessage(CFWL_Message *pMessage) = 0;
- virtual FWL_ERR Idle(FX_INT32 count) = 0;
+ virtual FWL_ERR Idle(int32_t count) = 0;
};
class IFWL_ToolTipTarget
{
@@ -382,8 +382,8 @@ public: };
FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget *pTarget);
FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget);
-FWL_ERR FWL_SetToolTipInitialDelay(FX_INT32 iDelayTime);
-FWL_ERR FWL_SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime);
+FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime);
typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message *msg, FX_LPVOID info);
FWL_ERR FWL_SetHook(IFWL_NoteDriver *driver, FWLMessageHookCallback callback, FX_LPVOID info);
#endif
diff --git a/xfa/include/fwl/core/fwl_theme.h b/xfa/include/fwl/core/fwl_theme.h index 59d5ab0a2a..cc29e351d1 100644 --- a/xfa/include/fwl/core/fwl_theme.h +++ b/xfa/include/fwl/core/fwl_theme.h @@ -42,7 +42,7 @@ public: CFX_Matrix m_matrix;
CFX_RectF m_rtPart;
IFWL_Widget *m_pWidget;
- FX_INT32 m_iPart;
+ int32_t m_iPart;
FX_DWORD m_dwStates;
FX_DWORD m_dwData;
FX_LPVOID m_pData;
@@ -69,7 +69,7 @@ public: }
CFX_WideString m_wsText;
FX_DWORD m_dwTTOStyles;
- FX_INT32 m_iTTOAlign;
+ int32_t m_iTTOAlign;
CFX_Graphics *m_pGraphics;
};
class IFWL_ThemeProvider
diff --git a/xfa/include/fwl/core/fwl_thread.h b/xfa/include/fwl/core/fwl_thread.h index 9ce742b368..9b001f4fcb 100644 --- a/xfa/include/fwl/core/fwl_thread.h +++ b/xfa/include/fwl/core/fwl_thread.h @@ -25,8 +25,8 @@ public: FWL_HTHREAD FWL_StartThread(IFWL_Thread *pThread, FX_BOOL bSuspended = FALSE);
FWL_ERR FWL_ResumeThread(FWL_HTHREAD hThread);
FWL_ERR FWL_SuspendThread(FWL_HTHREAD hThread);
-FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, FX_INT32 iExitCode);
-FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, FX_INT32 iExitCode);
+FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, int32_t iExitCode);
+FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, int32_t iExitCode);
FWL_ERR FWL_Sleep(FX_DWORD dwMilliseconds);
class IFWL_NoteThread : public IFWL_Thread
{
@@ -50,7 +50,7 @@ typedef struct _FWL_HSEMAPHORE { FWL_HSEMAPHORE FWL_CreateSemaphore();
FWL_ERR FWL_DestroySemaphore(FWL_HSEMAPHORE hSemaphore);
FWL_ERR FWL_WaitSemaphore(FWL_HSEMAPHORE hSemaphore);
-FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 down = 1);
-FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, FX_INT32 &value);
-FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 init);
+FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t down = 1);
+FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, int32_t &value);
+FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t init);
#endif
diff --git a/xfa/include/fwl/core/fwl_timer.h b/xfa/include/fwl/core/fwl_timer.h index 3e83c299ff..a71cff72be 100644 --- a/xfa/include/fwl/core/fwl_timer.h +++ b/xfa/include/fwl/core/fwl_timer.h @@ -13,8 +13,8 @@ typedef struct _FWL_HTIMER { class IFWL_Timer
{
public:
- virtual FX_INT32 Run(FWL_HTIMER hTimer) = 0;
+ virtual int32_t Run(FWL_HTIMER hTimer) = 0;
};
FWL_HTIMER FWL_StartTimer(IFWL_Timer *pTimer, FX_DWORD dwElapse, FX_BOOL bImmediately = TRUE);
-FX_INT32 FWL_StopTimer(FWL_HTIMER hTimer);
+int32_t FWL_StopTimer(FWL_HTIMER hTimer);
#endif
diff --git a/xfa/include/fwl/core/fwl_widget.h b/xfa/include/fwl/core/fwl_widget.h index 3127f0683d..c7ef2d48ca 100644 --- a/xfa/include/fwl/core/fwl_widget.h +++ b/xfa/include/fwl/core/fwl_widget.h @@ -59,7 +59,7 @@ public: class IFWL_WidgetDelegate
{
public:
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage) = 0;
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage) = 0;
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent) = 0;
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL) = 0;
};
diff --git a/xfa/include/fwl/core/fwl_widgetmgr.h b/xfa/include/fwl/core/fwl_widgetmgr.h index 8db4f34503..9fcb4b682c 100644 --- a/xfa/include/fwl/core/fwl_widgetmgr.h +++ b/xfa/include/fwl/core/fwl_widgetmgr.h @@ -23,11 +23,11 @@ enum FWL_WGTRELATION { class IFWL_WidgetMgr
{
public:
- virtual FX_INT32 CountWidgets(IFWL_Widget *pParent = NULL) = 0;
- virtual IFWL_Widget* GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent = NULL) = 0;
+ virtual int32_t CountWidgets(IFWL_Widget *pParent = NULL) = 0;
+ virtual IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget *pParent = NULL) = 0;
virtual IFWL_Widget* GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRelation) = 0;
- virtual FX_INT32 GetWidgetIndex(IFWL_Widget *pWidget) = 0;
- virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex) = 0;
+ virtual int32_t GetWidgetIndex(IFWL_Widget *pWidget) = 0;
+ virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex) = 0;
virtual FX_BOOL IsWidget(FX_LPVOID pObj) = 0;
virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect = NULL) = 0;
virtual FX_DWORD GetCapability() = 0;
@@ -40,7 +40,7 @@ class IFWL_WidgetMgrDelegate {
public:
virtual FWL_ERR OnSetCapability(FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0;
- virtual FX_INT32 OnProcessMessageToForm(CFWL_Message *pMessage) = 0;
+ virtual int32_t OnProcessMessageToForm(CFWL_Message *pMessage) = 0;
virtual FWL_ERR OnDrawWidget(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL) = 0;
};
FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget *pWidget, const CFX_WideString *saveFile, const CFX_Matrix *pMatrix = NULL);
diff --git a/xfa/include/fwl/lightwidget/app.h b/xfa/include/fwl/lightwidget/app.h index b69be8368b..72d9dc01c7 100644 --- a/xfa/include/fwl/lightwidget/app.h +++ b/xfa/include/fwl/lightwidget/app.h @@ -16,7 +16,7 @@ public: virtual ~CFWL_App();
FWL_ERR Initialize();
CFWL_Theme* GetTheme();
- FWL_ERR Exit(FX_INT32 iExitCode = 0);
+ FWL_ERR Exit(int32_t iExitCode = 0);
IFWL_App* GetApp();
protected:
IFWL_App *m_pAppImp;
diff --git a/xfa/include/fwl/lightwidget/barcode.h b/xfa/include/fwl/lightwidget/barcode.h index e8fcfea476..242b432ab1 100644 --- a/xfa/include/fwl/lightwidget/barcode.h +++ b/xfa/include/fwl/lightwidget/barcode.h @@ -25,23 +25,23 @@ public: m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING;
m_barcodeData.m_eCharEncoding = encoding;
}
- void SetModuleHeight(FX_INT32 height)
+ void SetModuleHeight(int32_t height)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT;
m_barcodeData.m_nModuleHeight = height;
}
- void SetModuleWidth(FX_INT32 width)
+ void SetModuleWidth(int32_t width)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH;
m_barcodeData.m_nModuleWidth = width;
}
- void SetDataLength(FX_INT32 dataLength)
+ void SetDataLength(int32_t dataLength)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH;
m_barcodeData.m_nDataLength = dataLength;
((IFWL_Barcode*)m_pImp)->SetLimit(dataLength);
}
- void SetCalChecksum(FX_INT32 calChecksum)
+ void SetCalChecksum(int32_t calChecksum)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM;
m_barcodeData.m_nCalChecksum = calChecksum;
@@ -56,7 +56,7 @@ public: m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TEXTLOCATION;
m_barcodeData.m_eTextLocation = location;
}
- void SetWideNarrowRatio(FX_INT32 ratio)
+ void SetWideNarrowRatio(int32_t ratio)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_WIDENARROWRATIO;
m_barcodeData.m_nWideNarrowRatio = ratio;
@@ -71,12 +71,12 @@ public: m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR;
m_barcodeData.m_cEndChar = endChar;
}
- void SetVersion(FX_INT32 version)
+ void SetVersion(int32_t version)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION;
m_barcodeData.m_nVersion = version;
}
- void SetErrorCorrectionLevel(FX_INT32 ecLevel)
+ void SetErrorCorrectionLevel(int32_t ecLevel)
{
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL;
m_barcodeData.m_nECLevel = ecLevel;
@@ -102,22 +102,22 @@ protected: {
return m_eCharEncoding;
}
- FX_INT32 m_nModuleHeight, m_nModuleWidth;
- virtual FX_INT32 GetModuleHeight()
+ int32_t m_nModuleHeight, m_nModuleWidth;
+ virtual int32_t GetModuleHeight()
{
return m_nModuleHeight;
}
- virtual FX_INT32 GetModuleWidth()
+ virtual int32_t GetModuleWidth()
{
return m_nModuleWidth;
}
- FX_INT32 m_nDataLength;
- virtual FX_INT32 GetDataLength()
+ int32_t m_nDataLength;
+ virtual int32_t GetDataLength()
{
return m_nDataLength;
}
- FX_INT32 m_nCalChecksum;
- virtual FX_INT32 GetCalChecksum()
+ int32_t m_nCalChecksum;
+ virtual int32_t GetCalChecksum()
{
return m_nCalChecksum;
}
@@ -132,8 +132,8 @@ protected: {
return m_eTextLocation;
}
- FX_INT32 m_nWideNarrowRatio;
- virtual FX_INT32 GetWideNarrowRatio()
+ int32_t m_nWideNarrowRatio;
+ virtual int32_t GetWideNarrowRatio()
{
return m_nWideNarrowRatio;
}
@@ -146,13 +146,13 @@ protected: {
return m_cEndChar;
}
- FX_INT32 m_nVersion;
- virtual FX_INT32 GetVersion()
+ int32_t m_nVersion;
+ virtual int32_t GetVersion()
{
return m_nVersion;
}
- FX_INT32 m_nECLevel;
- virtual FX_INT32 GetErrorCorrectionLevel()
+ int32_t m_nECLevel;
+ virtual int32_t GetErrorCorrectionLevel()
{
return m_nECLevel;
}
diff --git a/xfa/include/fwl/lightwidget/checkbox.h b/xfa/include/fwl/lightwidget/checkbox.h index 2f7b2bac97..ebad96fd8e 100644 --- a/xfa/include/fwl/lightwidget/checkbox.h +++ b/xfa/include/fwl/lightwidget/checkbox.h @@ -20,8 +20,8 @@ public: FWL_ERR GetCaption(CFX_WideString &wsCaption);
FWL_ERR SetCaption(FX_WSTR wsCaption);
FWL_ERR SetBoxSize(FX_FLOAT fHeight);
- FX_INT32 GetCheckState();
- FWL_ERR SetCheckState(FX_INT32 iCheck);
+ int32_t GetCheckState();
+ FWL_ERR SetCheckState(int32_t iCheck);
CFWL_CheckBox();
virtual ~CFWL_CheckBox();
protected:
diff --git a/xfa/include/fwl/lightwidget/combobox.h b/xfa/include/fwl/lightwidget/combobox.h index 46aec5bc8a..594c056e83 100644 --- a/xfa/include/fwl/lightwidget/combobox.h +++ b/xfa/include/fwl/lightwidget/combobox.h @@ -17,27 +17,27 @@ class CFWL_ComboBox : public CFWL_Widget public:
static CFWL_ComboBox* Create();
FWL_ERR Initialize(const CFWL_WidgetProperties *pProperties = NULL);
- FX_INT32 AddString(FX_WSTR wsText);
- FX_INT32 AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon);
- FX_INT32 RemoveAt(FX_INT32 iIndex);
- FX_INT32 RemoveAll();
- FX_INT32 CountItems();
- FWL_ERR GetTextByIndex(FX_INT32 iIndex, CFX_WideString &wsText);
- FX_INT32 GetCurSel();
- FWL_ERR SetCurSel(FX_INT32 iSel);
+ int32_t AddString(FX_WSTR wsText);
+ int32_t AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon);
+ int32_t RemoveAt(int32_t iIndex);
+ int32_t RemoveAll();
+ int32_t CountItems();
+ FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString &wsText);
+ int32_t GetCurSel();
+ FWL_ERR SetCurSel(int32_t iSel);
FWL_ERR SetEditText(FX_WSTR wsText);
- FX_INT32 GetEditTextLength() const;
- FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const ;
- FWL_ERR SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- FX_INT32 GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
- FX_INT32 GetEditLimit();
- FWL_ERR SetEditLimit(FX_INT32 nLimit);
- FWL_ERR EditDoClipboard(FX_INT32 iCmd);
+ int32_t GetEditTextLength() const;
+ FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const ;
+ FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1);
+ int32_t GetEditSelRange(int32_t nIndex, int32_t &nStart);
+ int32_t GetEditLimit();
+ FWL_ERR SetEditLimit(int32_t nLimit);
+ FWL_ERR EditDoClipboard(int32_t iCmd);
FX_BOOL EditRedo(FX_BSTR bsRecord);
FX_BOOL EditUndo(FX_BSTR bsRecord);
FWL_ERR SetMaxListHeight(FX_FLOAT fMaxHeight);
- FWL_ERR SetItemData(FX_INT32 iIndex, FX_LPVOID pData);
- FX_LPVOID GetItemData(FX_INT32 iIndex);
+ FWL_ERR SetItemData(int32_t iIndex, FX_LPVOID pData);
+ FX_LPVOID GetItemData(int32_t iIndex);
FWL_ERR SetListTheme(IFWL_ThemeProvider *pTheme);
FX_BOOL AfterFocusShowDropList();
FWL_ERR OpenDropDownList(FX_BOOL bActivate);
@@ -70,10 +70,10 @@ protected: return FWL_ERR_Succeeded;
}
- virtual FX_INT32 CountItems(IFWL_Widget *pWidget);
- virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex);
- virtual FX_INT32 GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
- virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex);
+ virtual int32_t CountItems(IFWL_Widget *pWidget);
+ virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, int32_t nIndex);
+ virtual int32_t GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
+ virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex);
virtual FX_DWORD GetItemStyles(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
virtual FWL_ERR GetItemText(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, CFX_WideString &wsText);
diff --git a/xfa/include/fwl/lightwidget/datetimepicker.h b/xfa/include/fwl/lightwidget/datetimepicker.h index 73a382c08c..4af07a99bc 100644 --- a/xfa/include/fwl/lightwidget/datetimepicker.h +++ b/xfa/include/fwl/lightwidget/datetimepicker.h @@ -16,13 +16,13 @@ class CFWL_DateTimePicker : public CFWL_Widget public:
static CFWL_DateTimePicker* Create();
FWL_ERR Initialize(const CFWL_WidgetProperties *pProperties = NULL);
- FWL_ERR SetToday(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ FWL_ERR SetToday(int32_t iYear, int32_t iMonth, int32_t iDay);
FWL_ERR GetEditText(CFX_WideString &wsText);
FWL_ERR SetEditText(FX_WSTR wsText);
- FX_INT32 CountSelRanges();
- FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
- FWL_ERR GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- FWL_ERR SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ int32_t CountSelRanges();
+ int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
+ FWL_ERR GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
FX_BOOL CanUndo();
FX_BOOL CanRedo();
FX_BOOL Undo();
@@ -37,7 +37,7 @@ public: FX_BOOL Delete();
FX_BOOL DeSelect();
FWL_ERR GetBBox(CFX_RectF &rect);
- FWL_ERR SetEditLimit(FX_INT32 nLimit);
+ FWL_ERR SetEditLimit(int32_t nLimit);
FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved);
protected:
CFWL_DateTimePicker();
@@ -47,10 +47,10 @@ protected: public:
CFWL_DateTimePickerDP();
virtual FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption);
- virtual FWL_ERR GetToday(IFWL_Widget *pWidget, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- FX_INT32 m_iYear;
- FX_INT32 m_iMonth;
- FX_INT32 m_iDay;
+ virtual FWL_ERR GetToday(IFWL_Widget *pWidget, int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ int32_t m_iYear;
+ int32_t m_iMonth;
+ int32_t m_iDay;
CFX_WideString m_wsData;
};
CFWL_DateTimePickerDP m_DateTimePickerDP;
diff --git a/xfa/include/fwl/lightwidget/edit.h b/xfa/include/fwl/lightwidget/edit.h index 8299a20322..d95baa20e1 100644 --- a/xfa/include/fwl/lightwidget/edit.h +++ b/xfa/include/fwl/lightwidget/edit.h @@ -15,29 +15,29 @@ public: static CFWL_Edit* Create();
FWL_ERR Initialize(const CFWL_WidgetProperties *pProperties = NULL);
FWL_ERR SetText(const CFX_WideString &wsText);
- FX_INT32 GetTextLength() const;
- FWL_ERR GetText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
+ int32_t GetTextLength() const;
+ FWL_ERR GetText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
FWL_ERR ClearText();
- FX_INT32 GetCaretPos() const;
- FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE);
- FWL_ERR AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- FX_INT32 CountSelRanges();
- FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
+ int32_t GetCaretPos() const;
+ int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1);
+ int32_t CountSelRanges();
+ int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
FWL_ERR ClearSelections();
- FX_INT32 GetLimit();
- FWL_ERR SetLimit(FX_INT32 nLimit);
+ int32_t GetLimit();
+ FWL_ERR SetLimit(int32_t nLimit);
FWL_ERR SetAliasChar(FX_WCHAR wAlias);
FWL_ERR SetFormatString(const CFX_WideString &wsFormat);
- FWL_ERR Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen);
+ FWL_ERR Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen);
FWL_ERR DeleteSelections();
- FWL_ERR DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1);
+ FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1);
FWL_ERR ReplaceSelections(const CFX_WideStringC &wsReplace);
- FWL_ERR Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace);
- FWL_ERR DoClipboard(FX_INT32 iCmd);
+ FWL_ERR Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace);
+ FWL_ERR DoClipboard(int32_t iCmd);
FX_BOOL Redo(FX_BSTR bsRecord);
FX_BOOL Undo(FX_BSTR bsRecord);
FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
- FWL_ERR SetNumberRange(FX_INT32 iMin, FX_INT32 iMax);
+ FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
FWL_ERR SetBackColor(FX_DWORD dwColor);
FWL_ERR SetFont(const CFX_WideString &wsFont, FX_FLOAT fSize);
FX_BOOL CanUndo();
diff --git a/xfa/include/fwl/lightwidget/listbox.h b/xfa/include/fwl/lightwidget/listbox.h index 55eddabb48..a8d024abaa 100644 --- a/xfa/include/fwl/lightwidget/listbox.h +++ b/xfa/include/fwl/lightwidget/listbox.h @@ -20,9 +20,9 @@ public: FWL_HLISTITEM AddString(FX_WSTR wsAdd, FX_BOOL bSelect = FALSE);
FX_BOOL DeleteString(FWL_HLISTITEM hItem);
FX_BOOL DeleteAll();
- FX_INT32 CountSelItems();
- FWL_HLISTITEM GetSelItem(FX_INT32 nIndexSel);
- FX_INT32 GetSelIndex(FX_INT32 nIndex);
+ int32_t CountSelItems();
+ FWL_HLISTITEM GetSelItem(int32_t nIndexSel);
+ int32_t GetSelIndex(int32_t nIndex);
FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE);
FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString &wsText);
FWL_ERR GetScrollPos(FX_FLOAT &fPos, FX_BOOL bVert = TRUE);
@@ -30,8 +30,8 @@ public: FWL_HLISTITEM GetFocusItem();
FWL_ERR SetFocusItem(FWL_HLISTITEM hItem);
FWL_ERR* Sort(IFWL_ListBoxCompare *pCom);
- FX_INT32 CountItems();
- FWL_HLISTITEM GetItem(FX_INT32 nIndex);
+ int32_t CountItems();
+ FWL_HLISTITEM GetItem(int32_t nIndex);
FWL_ERR SetItemString(FWL_HLISTITEM hItem, FX_WSTR wsText);
FWL_ERR GetItemString(FWL_HLISTITEM hItem, CFX_WideString &wsText);
FWL_ERR SetItemData(FWL_HLISTITEM hItem, FX_LPVOID pData);
@@ -48,10 +48,10 @@ protected: ~CFWL_ListBoxDP();
virtual FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption);
- virtual FX_INT32 CountItems(IFWL_Widget *pWidget);
- virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex);
- virtual FX_INT32 GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
- virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex);
+ virtual int32_t CountItems(IFWL_Widget *pWidget);
+ virtual FWL_HLISTITEM GetItem(IFWL_Widget *pWidget, int32_t nIndex);
+ virtual int32_t GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
+ virtual FX_BOOL SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex);
virtual FX_DWORD GetItemStyles(IFWL_Widget *pWidget, FWL_HLISTITEM hItem);
virtual FWL_ERR GetItemText(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, CFX_WideString &wsText);
diff --git a/xfa/include/fwl/lightwidget/picturebox.h b/xfa/include/fwl/lightwidget/picturebox.h index dd87d6806b..d15c2510a0 100644 --- a/xfa/include/fwl/lightwidget/picturebox.h +++ b/xfa/include/fwl/lightwidget/picturebox.h @@ -20,10 +20,10 @@ public: FWL_ERR SetPicture(CFX_DIBitmap *pBitmap);
FX_FLOAT GetRotation();
FWL_ERR SetRotation(FX_FLOAT fRotation);
- FX_INT32 GetFlipMode();
- FWL_ERR SetFlipMode(FX_INT32 iFlipMode);
- FX_INT32 GetOpacity();
- FWL_ERR SetOpacity(FX_INT32 iOpacity);
+ int32_t GetFlipMode();
+ FWL_ERR SetFlipMode(int32_t iFlipMode);
+ int32_t GetOpacity();
+ FWL_ERR SetOpacity(int32_t iOpacity);
FWL_ERR GetScale(FX_FLOAT &fScaleX, FX_FLOAT &fScaleY);
FWL_ERR SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY);
FWL_ERR GetOffset(FX_FLOAT &fx, FX_FLOAT &fy);
@@ -47,12 +47,12 @@ protected: virtual CFX_DIBitmap* GetPicture(IFWL_Widget *pWidget);
virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget *pWidget);
virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget *pWidget);
- virtual FX_INT32 GetOpacity(IFWL_Widget *pWidget);
- virtual FX_INT32 GetFlipMode(IFWL_Widget *pWidget);
+ virtual int32_t GetOpacity(IFWL_Widget *pWidget);
+ virtual int32_t GetFlipMode(IFWL_Widget *pWidget);
virtual FWL_ERR GetMatrix(IFWL_Widget *pWidget, CFX_Matrix &matrix);
CFX_DIBitmap *m_pBitmap;
- FX_INT32 m_iOpacity;
- FX_INT32 m_iFlipMode;
+ int32_t m_iOpacity;
+ int32_t m_iFlipMode;
FX_FLOAT m_fRotation;
FX_FLOAT m_fScaleX;
FX_FLOAT m_fScaleY;
diff --git a/xfa/include/fwl/lightwidget/tooltipctrl.h b/xfa/include/fwl/lightwidget/tooltipctrl.h index 114696ff13..821e042533 100644 --- a/xfa/include/fwl/lightwidget/tooltipctrl.h +++ b/xfa/include/fwl/lightwidget/tooltipctrl.h @@ -18,10 +18,10 @@ public: FWL_ERR Initialize(const CFWL_WidgetProperties *pProperties = NULL);
FWL_ERR GetCaption(CFX_WideString &wsCaption);
FWL_ERR SetCaption(FX_WSTR wsCaption);
- FX_INT32 GetInitialDelay();
- FX_INT32 SetInitialDelay(FX_INT32 nDelayTime);
- FX_INT32 GetAutoPopDelay();
- FX_INT32 SetAutoPopDelay(FX_INT32 nDelayTime);
+ int32_t GetInitialDelay();
+ int32_t SetInitialDelay(int32_t nDelayTime);
+ int32_t GetAutoPopDelay();
+ int32_t SetAutoPopDelay(int32_t nDelayTime);
CFX_DIBitmap* GetToolTipIcon();
FWL_ERR SetToolTipIcon(CFX_DIBitmap* pBitmap);
CFX_SizeF GetToolTipIconSize();
@@ -37,14 +37,14 @@ protected: public:
CFWL_ToolTipDP();
FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption);
- FX_INT32 GetInitialDelay(IFWL_Widget *pWidget);
- FX_INT32 GetAutoPopDelay(IFWL_Widget *pWidget);
+ int32_t GetInitialDelay(IFWL_Widget *pWidget);
+ int32_t GetAutoPopDelay(IFWL_Widget *pWidget);
CFX_DIBitmap* GetToolTipIcon(IFWL_Widget *pWidget);
CFX_SizeF GetToolTipIconSize(IFWL_Widget *pWidget);
CFX_RectF GetAnchor();
CFX_WideString m_wsCaption;
- FX_INT32 m_nInitDelayTime;
- FX_INT32 m_nAutoPopDelayTime;
+ int32_t m_nInitDelayTime;
+ int32_t m_nAutoPopDelayTime;
CFX_DIBitmap* m_pBitmap;
CFX_SizeF m_fIconSize;
CFX_RectF m_fAnchor;
diff --git a/xfa/include/fwl/lightwidget/widget.h b/xfa/include/fwl/lightwidget/widget.h index 222ce1c768..d581c7fb40 100644 --- a/xfa/include/fwl/lightwidget/widget.h +++ b/xfa/include/fwl/lightwidget/widget.h @@ -83,7 +83,7 @@ public: virtual ~CFWL_Widget();
void RegisterEventTarget(CFWL_Widget *pEventSource = NULL, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK);
void DispatchEvent(CFWL_Event *pEvent);
- CFX_SizeF CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine = FALSE, FX_INT32 iLineWidth = -1);
+ CFX_SizeF CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine = FALSE, int32_t iLineWidth = -1);
IFWL_Widget *m_pImp;
IFWL_WidgetDelegate *m_pDelegate;
CFWL_WidgetMgr *m_pWidgetMgr;
@@ -94,7 +94,7 @@ class CFWL_WidgetDelegate public:
CFWL_WidgetDelegate();
virtual ~CFWL_WidgetDelegate();
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
};
diff --git a/xfa/include/fwl/theme/formtp.h b/xfa/include/fwl/theme/formtp.h index 8f715e77b6..e531b55a53 100644 --- a/xfa/include/fwl/theme/formtp.h +++ b/xfa/include/fwl/theme/formtp.h @@ -30,14 +30,14 @@ protected: void CalCaption(IFWL_Widget *pWidget, CFX_RectF &rect);
void CalIcon(IFWL_Widget *pWidget, CFX_RectF &rect);
- void DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
- void DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0);
+ void DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, int32_t iActive = 0);
+ void DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive = 0);
void SetThemeData(FX_DWORD dwID);
void TransModeColor(FX_ARGB clrFore, FX_ARGB &clrBack);
void DeactiveForm();
diff --git a/xfa/include/fwl/theme/pushbuttontp.h b/xfa/include/fwl/theme/pushbuttontp.h index b27afc47f4..f6db37b95e 100644 --- a/xfa/include/fwl/theme/pushbuttontp.h +++ b/xfa/include/fwl/theme/pushbuttontp.h @@ -28,7 +28,7 @@ protected: void SetBackgroudColor(FX_DWORD *pData);
void SetCaptionColor(FX_DWORD *pData);
void SetCornerColor(FX_DWORD *pData);
- FX_INT32 GetColorID(FX_DWORD dwStates);
+ int32_t GetColorID(FX_DWORD dwStates);
struct PBThemeData {
FX_ARGB clrBorder[5];
diff --git a/xfa/include/fwl/theme/utils.h b/xfa/include/fwl/theme/utils.h index f1b6b55876..fbad2ad977 100644 --- a/xfa/include/fwl/theme/utils.h +++ b/xfa/include/fwl/theme/utils.h @@ -28,10 +28,10 @@ typedef struct _FWLCOLOR { union {
FX_DWORD color;
struct {
- FX_BYTE b;
- FX_BYTE g;
- FX_BYTE r;
- FX_BYTE a;
+ uint8_t b;
+ uint8_t g;
+ uint8_t r;
+ uint8_t a;
};
};
diff --git a/xfa/include/fwl/theme/widgettp.h b/xfa/include/fwl/theme/widgettp.h index 57348e4c75..5a07c7ea03 100644 --- a/xfa/include/fwl/theme/widgettp.h +++ b/xfa/include/fwl/theme/widgettp.h @@ -47,7 +47,7 @@ protected: void DrawBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, CFX_Matrix *pMatrix = NULL);
void FillBackground(CFX_Graphics *pGraphics, const CFX_RectF *pRect, CFX_Matrix *pMatrix = NULL);
void FillSoildRect(CFX_Graphics *pGraphics, FX_ARGB fillColor, const CFX_RectF *pRect, CFX_Matrix *pMatrix = NULL);
- void DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, FX_INT32 fillMode = FXFILL_WINDING, CFX_Matrix *pMatrix = NULL);
+ void DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, int32_t fillMode = FXFILL_WINDING, CFX_Matrix *pMatrix = NULL);
void DrawAnnulusRect(CFX_Graphics *pGraphics, FX_ARGB fillColor, const CFX_RectF *pRect, FX_FLOAT fRingWidth = 1, CFX_Matrix *pMatrix = NULL);
void DrawAnnulusCircle(CFX_Graphics *pGraphics, FX_ARGB fillColor, const CFX_RectF *pRect, FX_FLOAT fWidth = 1, CFX_Matrix *pMatrix = NULL);
void DrawFocus(CFX_Graphics *pGraphics, const CFX_RectF *pRect, CFX_Matrix *pMatrix = NULL);
@@ -55,7 +55,7 @@ protected: void DrawArrow(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_DIRECTION eDict, FX_ARGB argSign, CFX_Matrix *pMatrix = NULL);
void DrawBtn(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix = NULL);
void DrawArrowBtn(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, CFX_Matrix *pMatrix = NULL);
- FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, FX_BYTE scale);
+ FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale);
FX_DWORD m_dwRefCount;
IFDE_TextOut *m_pTextOut;
IFX_Font *m_pFDEFont;
diff --git a/xfa/include/fxbarcode/BC_BarCode.h b/xfa/include/fxbarcode/BC_BarCode.h index 1893bc3e98..29820c7ce7 100644 --- a/xfa/include/fxbarcode/BC_BarCode.h +++ b/xfa/include/fxbarcode/BC_BarCode.h @@ -42,18 +42,18 @@ public: CBC_CodeBase();
virtual ~CBC_CodeBase();
virtual BC_TYPE GetType() = 0;
- virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) = 0;
- virtual CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) = 0;
- virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) = 0;
+ virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) = 0;
+ virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) = 0;
+ virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) = 0;
+ virtual CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) = 0;
+ virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e) = 0;
- virtual FX_BOOL SetCharEncoding(FX_INT32 encoding);
- virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight);
- virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth);
+ virtual FX_BOOL SetCharEncoding(int32_t encoding);
+ virtual FX_BOOL SetModuleHeight(int32_t moduleHeight);
+ virtual FX_BOOL SetModuleWidth(int32_t moduleWidth);
- virtual FX_BOOL SetHeight(FX_INT32 height);
- virtual FX_BOOL SetWidth(FX_INT32 width);
+ virtual FX_BOOL SetHeight(int32_t height);
+ virtual FX_BOOL SetWidth(int32_t width);
virtual void SetBackgroundColor(FX_ARGB backgroundColor);
virtual void SetBarcodeColor(FX_ARGB foregroundColor);
protected:
@@ -66,19 +66,19 @@ public: CBC_OneCode();
virtual ~CBC_OneCode();
virtual BC_TYPE GetType() = 0;
- virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) = 0;
- virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) = 0;
- virtual CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) = 0;
- virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) = 0;
+ virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) = 0;
+ virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) = 0;
+ virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) = 0;
+ virtual CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) = 0;
+ virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e) = 0;
virtual FX_BOOL CheckContentValidity(FX_WSTR contents);
virtual CFX_WideString FilterContents(FX_WSTR contents);
virtual void SetPrintChecksum(FX_BOOL checksum);
- virtual void SetDataLength(FX_INT32 length);
+ virtual void SetDataLength(int32_t length);
virtual void SetCalChecksum(FX_BOOL calc);
virtual FX_BOOL SetFont(CFX_Font * cFont);
virtual void SetFontSize(FX_FLOAT size);
- virtual void SetFontStyle(FX_INT32 style);
+ virtual void SetFontStyle(int32_t style);
virtual void SetFontColor(FX_ARGB color);
};
class CBC_Code39 : public CBC_OneCode
@@ -88,17 +88,17 @@ public: CBC_Code39(FX_BOOL usingCheckDigit);
CBC_Code39(FX_BOOL usingCheckDigit, FX_BOOL extendedMode);
virtual ~CBC_Code39();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_CODE39;
}
FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ FX_BOOL SetWideNarrowRatio(int32_t ratio);
private:
CFX_WideString m_renderContents;
};
@@ -107,11 +107,11 @@ class CBC_Codabar : public CBC_OneCode public:
CBC_Codabar();
virtual ~CBC_Codabar();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_CODABAR;
@@ -119,7 +119,7 @@ public: FX_BOOL SetStartChar(FX_CHAR start);
FX_BOOL SetEndChar(FX_CHAR end);
FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ FX_BOOL SetWideNarrowRatio(int32_t ratio);
private:
CFX_WideString m_renderContents;
};
@@ -130,11 +130,11 @@ private: public:
CBC_Code128(BC_TYPE type);
virtual ~CBC_Code128();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_CODE128;
@@ -148,11 +148,11 @@ class CBC_EAN8 : public CBC_OneCode public:
CBC_EAN8();
virtual ~CBC_EAN8();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_EAN8;
@@ -166,11 +166,11 @@ class CBC_EAN13 : public CBC_OneCode public:
CBC_EAN13();
virtual ~CBC_EAN13();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_EAN13;
@@ -184,11 +184,11 @@ class CBC_UPCA : public CBC_OneCode public:
CBC_UPCA();
virtual ~CBC_UPCA();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_UPCA;
@@ -202,33 +202,33 @@ class CBC_QRCode : public CBC_CodeBase public:
CBC_QRCode();
virtual ~CBC_QRCode();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_QR_CODE;
}
- FX_BOOL SetVersion(FX_INT32 version);
- FX_BOOL SetErrorCorrectionLevel (FX_INT32 level);
+ FX_BOOL SetVersion(int32_t version);
+ FX_BOOL SetErrorCorrectionLevel (int32_t level);
};
class CBC_PDF417I : public CBC_CodeBase
{
public:
CBC_PDF417I();
virtual ~CBC_PDF417I();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_PDF417;
}
- FX_BOOL SetErrorCorrectionLevel (FX_INT32 level);
+ FX_BOOL SetErrorCorrectionLevel (int32_t level);
void SetTruncated(FX_BOOL truncated);
};
class CBC_DataMatrix : public CBC_CodeBase
@@ -236,11 +236,11 @@ class CBC_DataMatrix : public CBC_CodeBase public:
CBC_DataMatrix();
virtual ~CBC_DataMatrix();
- FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e);
- CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e);
+ FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e);
+ CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &e);
BC_TYPE GetType()
{
return BC_DATAMATRIX;
diff --git a/xfa/include/fxfa/fxfa.h b/xfa/include/fxfa/fxfa.h index da39113062..b732f98d9c 100644 --- a/xfa/include/fxfa/fxfa.h +++ b/xfa/include/fxfa/fxfa.h @@ -217,7 +217,7 @@ public: * @param[in] dwButtonType Button type, refer to XFA_MESSAGEBUTTON.
* @return A valid integer representing the value of the button pressed by the user, refer to XFA_ID.
*/
- virtual FX_INT32 MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle = FX_WSTRC(L""),
+ virtual int32_t MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle = FX_WSTRC(L""),
FX_DWORD dwIconType = 0, FX_DWORD dwButtonType = 0) = 0;
/**
@@ -227,8 +227,8 @@ public: virtual void Response(CFX_WideString &wsAnswer, FX_WSTR wsQuestion, FX_WSTR wsTitle = FX_WSTRC(L""),
FX_WSTR wsDefaultAnswer = FX_WSTRC(L""), FX_BOOL bMark = TRUE) = 0;
- virtual FX_INT32 GetDocumentCountInBatch() = 0;
- virtual FX_INT32 GetCurDocumentInBatch() = 0;
+ virtual int32_t GetDocumentCountInBatch() = 0;
+ virtual int32_t GetCurDocumentInBatch() = 0;
/**
* Download something from somewhere.
@@ -259,7 +259,7 @@ public: */
virtual FX_BOOL PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsEncode) = 0;
- virtual void LoadString(FX_INT32 iStringID, CFX_WideString &wsString) = 0;
+ virtual void LoadString(int32_t iStringID, CFX_WideString &wsString) = 0;
virtual FX_BOOL ShowFileDialog(FX_WSTR wsTitle, FX_WSTR wsFilter, CFX_WideStringArray &wsPathArr, FX_BOOL bOpen = TRUE) = 0;
virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
};
@@ -342,9 +342,9 @@ public: {
return FALSE;
}
- virtual FX_INT32 CountPages(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 GetCurrentPage(IXFA_Doc* hDoc) = 0;
- virtual void SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage) = 0;
+ virtual int32_t CountPages(IXFA_Doc* hDoc) = 0;
+ virtual int32_t GetCurrentPage(IXFA_Doc* hDoc) = 0;
+ virtual void SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage) = 0;
virtual FX_BOOL IsCalculationsEnabled(IXFA_Doc* hDoc) = 0;
virtual void SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) = 0;
virtual void GetTitle(IXFA_Doc* hDoc, CFX_WideString &wsTitle) = 0;
@@ -355,12 +355,12 @@ public: virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc) = 0;
virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) = 0;
virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
- virtual void Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions) = 0;
- virtual FX_INT32 AbsPageCountInBatch(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
- virtual FX_INT32 SheetCountInBatch(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
- virtual FX_INT32 Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE)
+ virtual void Print(IXFA_Doc* hDoc, int32_t nStartPage, int32_t nEndPage, FX_DWORD dwOptions) = 0;
+ virtual int32_t AbsPageCountInBatch(IXFA_Doc* hDoc) = 0;
+ virtual int32_t AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
+ virtual int32_t SheetCountInBatch(IXFA_Doc* hDoc) = 0;
+ virtual int32_t SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
+ virtual int32_t Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE)
{
return 0;
}
@@ -409,14 +409,14 @@ public: virtual IXFA_DocProvider* GetDocProvider(IXFA_Doc* hDoc) = 0;
virtual FX_DWORD GetDocType(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 StartLoad(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartLoad(IXFA_Doc* hDoc) = 0;
+ virtual int32_t DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL) = 0;
virtual void StopLoad(IXFA_Doc* hDoc) = 0;
virtual IXFA_DocView* CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView = 0) = 0;
- virtual FX_INT32 CountPackages(IXFA_Doc* hDoc) = 0;
- virtual void GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage) = 0;
+ virtual int32_t CountPackages(IXFA_Doc* hDoc) = 0;
+ virtual void GetPackageName(IXFA_Doc* hDoc, int32_t iPackage, CFX_WideStringC &wsPackage) = 0;
virtual FX_BOOL SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL) = 0;
virtual FX_BOOL CloseDoc(IXFA_Doc* hDoc) = 0;
@@ -498,12 +498,12 @@ public: XFA_EVENTTYPE m_eType;
CFX_WideString m_wsResult;
FX_BOOL m_bCancelAction;
- FX_INT32 m_iCommitKey;
+ int32_t m_iCommitKey;
FX_BOOL m_bKeyDown;
FX_BOOL m_bModifier;
FX_BOOL m_bReenter;
- FX_INT32 m_iSelEnd;
- FX_INT32 m_iSelStart;
+ int32_t m_iSelEnd;
+ int32_t m_iSelStart;
FX_BOOL m_bShift;
CFX_WideString m_wsChange;
CFX_WideString m_wsFullText;
@@ -514,7 +514,7 @@ public: CFX_WideString m_wsSoapFaultCode;
CFX_WideString m_wsSoapFaultString;
FX_BOOL m_bIsFormReady;
- FX_INT32 m_iValidateActivities;
+ int32_t m_iValidateActivities;
};
#define XFA_EVENTERROR_Sucess 1
#define XFA_EVENTERROR_Error -1
@@ -529,18 +529,18 @@ public: virtual ~IXFA_DocView() { }
virtual IXFA_Doc* GetDoc() = 0;
- virtual FX_INT32 StartLayout(FX_INT32 iStartPage = 0) = 0;
- virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartLayout(int32_t iStartPage = 0) = 0;
+ virtual int32_t DoLayout(IFX_Pause *pPause = NULL) = 0;
virtual void StopLayout() = 0;
- virtual FX_INT32 GetLayoutStatus() = 0;
+ virtual int32_t GetLayoutStatus() = 0;
virtual void UpdateDocView() = 0;
- virtual FX_INT32 CountPageViews() = 0;
- virtual IXFA_PageView* GetPageView(FX_INT32 nIndex) = 0;
+ virtual int32_t CountPageViews() = 0;
+ virtual IXFA_PageView* GetPageView(int32_t nIndex) = 0;
virtual IXFA_Widget* GetWidgetByName(FX_WSTR wsName) = 0;
virtual CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName) = 0;
virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL) = 0;
- virtual FX_INT32 ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL) = 0;
+ virtual int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL) = 0;
virtual IXFA_WidgetHandler* GetWidgetHandler() = 0;
virtual IXFA_WidgetIterator* CreateWidgetIterator() = 0;
virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator(XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder) = 0;
@@ -561,12 +561,12 @@ public: virtual ~IXFA_PageView() { }
virtual IXFA_DocView* GetDocView() = 0;
- virtual FX_INT32 GetPageViewIndex() = 0;
+ virtual int32_t GetPageViewIndex() = 0;
virtual void GetPageViewRect(CFX_RectF &rtPage) = 0;
- virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate) = 0;
+ virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, int32_t iRotate) = 0;
- virtual FX_INT32 LoadPageView(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t LoadPageView(IFX_Pause *pPause = NULL) = 0;
virtual void UnloadPageView() = 0;
virtual IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual IXFA_WidgetIterator* CreateWidgetIterator(FX_DWORD dwTraverseWay = XFA_TRAVERSEWAY_Form, FX_DWORD dwWidgetFilter = XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType) = 0;
@@ -590,8 +590,8 @@ class IXFA_RenderContext {
public:
virtual void Release() = 0;
- virtual FX_INT32 StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& pMatrix, const CXFA_RenderOptions& options) = 0;
- virtual FX_INT32 DoRender(IFX_Pause* pPause = NULL) = 0;
+ virtual int32_t StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& pMatrix, const CXFA_RenderOptions& options) = 0;
+ virtual int32_t DoRender(IFX_Pause* pPause = NULL) = 0;
virtual void StopRender() = 0;
protected:
~IXFA_RenderContext() { }
@@ -638,7 +638,7 @@ public: virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE) = 0;
virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget) = 0;
- virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0) = 0;
+ virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, int32_t iNameType = 0) = 0;
virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip) = 0;
virtual void SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback) = 0;
virtual FX_LPVOID GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id) = 0;
@@ -648,7 +648,7 @@ public: virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
@@ -661,7 +661,7 @@ public: virtual void RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE) = 0;
virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType) = 0;
- virtual FX_INT32 ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) = 0;
+ virtual int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) = 0;
};
class IXFA_WidgetIterator
{
diff --git a/xfa/include/fxfa/fxfa_basic.h b/xfa/include/fxfa/fxfa_basic.h index 6e45060b19..dcf1ac2e95 100644 --- a/xfa/include/fxfa/fxfa_basic.h +++ b/xfa/include/fxfa/fxfa_basic.h @@ -76,7 +76,7 @@ enum XFA_XDPPACKET_FLAGS { XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16,
};
typedef struct _XFA_PACKETINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_XDPPACKET eName;
FX_LPCWSTR pURI;
@@ -919,14 +919,14 @@ enum XFA_ELEMENT { };
#define XFA_ELEMENT_UNKNOWN ((XFA_ELEMENT)-1)
typedef struct _XFA_ELEMENTINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_ELEMENT eName;
FX_DWORD dwPackets;
FX_DWORD eObjectType;
} XFA_ELEMENTINFO, * XFA_LPELEMENTINFO;
typedef XFA_ELEMENTINFO const * XFA_LPCELEMENTINFO;
-FX_INT32 XFA_GetElementCount();
+int32_t XFA_GetElementCount();
XFA_LPCELEMENTINFO XFA_GetElementByName(FX_WSTR wsName);
XFA_LPCELEMENTINFO XFA_GetElementByID(XFA_ELEMENT eName);
enum XFA_ATTRIBUTETYPE {
@@ -938,7 +938,7 @@ enum XFA_ATTRIBUTETYPE { XFA_ATTRIBUTETYPE_Measure,
};
typedef struct _XFA_ATTRIBUTEINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_ATTRIBUTE eName;
XFA_ATTRIBUTETYPE eType;
@@ -946,14 +946,14 @@ typedef struct _XFA_ATTRIBUTEINFO { FX_LPVOID pDefValue;
} XFA_ATTRIBUTEINFO, * XFA_LPATTRIBUTEINFO;
typedef XFA_ATTRIBUTEINFO const * XFA_LPCATTRIBUTEINFO;
-FX_INT32 XFA_GetAttributeCount();
+int32_t XFA_GetAttributeCount();
XFA_LPCATTRIBUTEINFO XFA_GetAttributeByName(FX_WSTR wsName);
XFA_LPCATTRIBUTEINFO XFA_GetAttributeByID(XFA_ATTRIBUTE eName);
FX_BOOL XFA_GetAttributeDefaultValue(FX_LPVOID &pValue, XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, XFA_ATTRIBUTETYPE eType, FX_DWORD dwPacket);
XFA_ATTRIBUTEENUM XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
CFX_WideStringC XFA_GetAttributeDefaultValue_Cdata(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
FX_BOOL XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
-FX_INT32 XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
+int32_t XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
typedef struct _XFA_ELEMENTHIERARCHY {
FX_WORD wStart;
@@ -966,25 +966,25 @@ typedef struct _XFA_SCRIPTHIERARCHY { FX_WORD wMethodCount;
FX_WORD wAttributeStart;
FX_WORD wAttributeCount;
- FX_SHORT wParentIndex;
+ int16_t wParentIndex;
} XFA_SCRIPTHIERARCHY, * XFA_LPSCRIPTHIERARCHY;
typedef XFA_SCRIPTHIERARCHY const * XFA_LPCSCRIPTHIERARCHY;
-FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, FX_INT32 &iCount);
-FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, FX_INT32 &iCount);
+FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t &iCount);
+FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t &iCount);
XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChild, FX_DWORD dwPacket);
XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket);
#define XFA_PROPERTYFLAG_OneOf 0x01
#define XFA_PROPERTYFLAG_DefaultOneOf 0x02
typedef struct _XFA_PROPERTY {
FX_WORD eName;
- FX_BYTE uOccur;
- FX_BYTE uFlags;
+ uint8_t uOccur;
+ uint8_t uFlags;
} XFA_PROPERTY, * XFA_LPPROPERTY;
typedef XFA_PROPERTY const * XFA_LPCPROPERTY;
-XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, FX_INT32 &iCount);
+XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, int32_t &iCount);
XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eProperty, FX_DWORD dwPacket);
typedef struct _XFA_ATTRIBUTEENUMINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_ATTRIBUTEENUM eName;
} XFA_ATTRIBUTEENUMINFO, * XFA_LPATTRIBUTEENUMINFO;
@@ -1049,12 +1049,12 @@ class CFXJSE_Arguments; class CXFA_Object;
typedef void (CXFA_Object::*XFA_METHOD_CALLBACK) (CFXJSE_Arguments* pArguments);
typedef struct _XFA_METHODINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_METHOD_CALLBACK lpfnCallback;
} XFA_METHODINFO, * XFA_LPMETHODINFO;
typedef XFA_METHODINFO const * XFA_LPCMETHODINFO;
-FX_INT32 XFA_GetMethodCount();
+int32_t XFA_GetMethodCount();
XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, FX_WSTR wsMethodName);
typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK) (FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
enum XFA_SCRIPT_TYPE {
@@ -1062,10 +1062,10 @@ enum XFA_SCRIPT_TYPE { XFA_SCRIPT_Object,
};
typedef struct _XFA_SCRIPTATTRIBUTEINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_ATTRIBUTE_CALLBACK lpfnCallback;
- FX_INT32 eAttribute;
+ int32_t eAttribute;
FX_WORD eValueType;
} XFA_SCRIPTATTRIBUTEINFO, * XFA_LPSCRIPTATTRIBUTEINFO;
typedef XFA_SCRIPTATTRIBUTEINFO const * XFA_LPCSCRIPTATTRIBUTEINFO;
diff --git a/xfa/include/fxfa/fxfa_objectacc.h b/xfa/include/fxfa/fxfa_objectacc.h index d78a87dd64..888000805f 100644 --- a/xfa/include/fxfa/fxfa_objectacc.h +++ b/xfa/include/fxfa/fxfa_objectacc.h @@ -89,28 +89,28 @@ public: CXFA_Fill(CXFA_Node* pNode);
~CXFA_Fill();
- FX_INT32 GetPresence();
+ int32_t GetPresence();
FX_ARGB GetColor(FX_BOOL bText = FALSE);
void SetColor(FX_ARGB color);
- FX_INT32 GetFillType();
+ int32_t GetFillType();
- FX_INT32 GetPattern(FX_ARGB& foreColor);
+ int32_t GetPattern(FX_ARGB& foreColor);
- FX_INT32 GetStipple(FX_ARGB& stippleColor);
+ int32_t GetStipple(FX_ARGB& stippleColor);
- FX_INT32 GetLinear(FX_ARGB& endColor);
+ int32_t GetLinear(FX_ARGB& endColor);
- FX_INT32 GetRadial(FX_ARGB& endColor);
- FX_BOOL SetPresence(FX_INT32 iPresence);
- FX_BOOL SetFillType(FX_INT32 iType);
- FX_BOOL SetPattern(FX_INT32 iPattern, FX_ARGB foreColor);
- FX_BOOL SetStipple(FX_INT32 iStipple, FX_ARGB stippleColor);
- FX_BOOL SetLinear(FX_INT32 iLinear, FX_ARGB endColor);
- FX_BOOL SetRadial(FX_INT32 iRadial, FX_ARGB endColor);
+ int32_t GetRadial(FX_ARGB& endColor);
+ FX_BOOL SetPresence(int32_t iPresence);
+ FX_BOOL SetFillType(int32_t iType);
+ FX_BOOL SetPattern(int32_t iPattern, FX_ARGB foreColor);
+ FX_BOOL SetStipple(int32_t iStipple, FX_ARGB stippleColor);
+ FX_BOOL SetLinear(int32_t iLinear, FX_ARGB endColor);
+ FX_BOOL SetRadial(int32_t iRadial, FX_ARGB endColor);
};
class CXFA_Margin : public CXFA_Data
{
@@ -138,17 +138,17 @@ public: FX_FLOAT GetLetterSpacing();
- FX_INT32 GetLineThrough();
+ int32_t GetLineThrough();
- FX_INT32 GetLineThroughPeriod();
+ int32_t GetLineThroughPeriod();
- FX_INT32 GetOverline();
+ int32_t GetOverline();
- FX_INT32 GetOverlinePeriod();
+ int32_t GetOverlinePeriod();
- FX_INT32 GetUnderline();
+ int32_t GetUnderline();
- FX_INT32 GetUnderlinePeriod();
+ int32_t GetUnderlinePeriod();
FX_FLOAT GetFontSize();
@@ -167,21 +167,21 @@ public: FX_BOOL SetHorizontalScale(FX_FLOAT fHorizontalScale);
FX_BOOL SetVerticalScale(FX_FLOAT fVerticalScale);
FX_BOOL SetLetterSpacing(FX_FLOAT fLetterSpacing, XFA_UNIT eUnit);
- FX_BOOL SetLineThrough(FX_INT32 iLineThrough);
- FX_BOOL SetLineThroughPeriod(FX_INT32 iLineThroughPeriod);
- FX_BOOL SetOverline(FX_INT32 iOverline);
- FX_BOOL SetOverlinePeriod(FX_INT32 iOverlinePeriod);
- FX_BOOL SetUnderline(FX_INT32 iUnderline);
- FX_BOOL SetUnderlinePeriod(FX_INT32 iUnderlinePeriod);
+ FX_BOOL SetLineThrough(int32_t iLineThrough);
+ FX_BOOL SetLineThroughPeriod(int32_t iLineThroughPeriod);
+ FX_BOOL SetOverline(int32_t iOverline);
+ FX_BOOL SetOverlinePeriod(int32_t iOverlinePeriod);
+ FX_BOOL SetUnderline(int32_t iUnderline);
+ FX_BOOL SetUnderlinePeriod(int32_t iUnderlinePeriod);
};
class CXFA_Caption : public CXFA_Data
{
public:
CXFA_Caption(CXFA_Node* pNode);
- FX_INT32 GetPresence();
+ int32_t GetPresence();
- FX_INT32 GetPlacementType();
+ int32_t GetPlacementType();
FX_FLOAT GetReserve();
@@ -192,8 +192,8 @@ public: CXFA_Value GetValue();
CXFA_Para GetPara();
- FX_BOOL SetPresence(FX_INT32 iPresence);
- FX_BOOL SetPlacementType(FX_INT32 iType);
+ FX_BOOL SetPresence(int32_t iPresence);
+ FX_BOOL SetPlacementType(int32_t iType);
FX_BOOL SetReserve(FX_FLOAT fReserve);
};
class CXFA_Para : public CXFA_Data
@@ -201,42 +201,42 @@ class CXFA_Para : public CXFA_Data public:
CXFA_Para(CXFA_Node* pNode);
- FX_INT32 GetHorizontalAlign();
+ int32_t GetHorizontalAlign();
- FX_INT32 GetVerticalAlign();
+ int32_t GetVerticalAlign();
FX_FLOAT GetLineHeight();
FX_FLOAT GetMarginLeft();
FX_FLOAT GetMarginRight();
- FX_INT32 GetOrphans();
+ int32_t GetOrphans();
FX_FLOAT GetRadixOffset();
FX_FLOAT GetSpaceAbove();
FX_FLOAT GetSpaceBelow();
FX_FLOAT GetTextIndent();
- FX_INT32 GetWidows();
- FX_BOOL SetHorizontalAlign(FX_INT32 iHorizontalAlign);
- FX_BOOL SetVerticalAlign(FX_INT32 iVerticalAlign);
+ int32_t GetWidows();
+ FX_BOOL SetHorizontalAlign(int32_t iHorizontalAlign);
+ FX_BOOL SetVerticalAlign(int32_t iVerticalAlign);
FX_BOOL SetLineHeight(FX_FLOAT fLineHeight);
FX_BOOL SetMarginLeft(FX_FLOAT fMarginLeft);
FX_BOOL SetMarginRight(FX_FLOAT fMarginRight);
- FX_BOOL SetOrphans(FX_INT32 iOrphans);
+ FX_BOOL SetOrphans(int32_t iOrphans);
FX_BOOL SetRadixOffset(FX_FLOAT fRadixOffset);
FX_BOOL SetSpaceAbove(FX_FLOAT fSpaceAbove);
FX_BOOL SetSpaceBelow(FX_FLOAT fSpaceBelow);
FX_BOOL SetTextIndent(FX_FLOAT fTextIndent);
- FX_BOOL SetWidows(FX_INT32 iWidows);
+ FX_BOOL SetWidows(int32_t iWidows);
};
class CXFA_Keep : public CXFA_Data
{
public:
CXFA_Keep(CXFA_Node *pNode, CXFA_Node *pParent);
- FX_INT32 GetIntact();
- FX_INT32 GetNext();
- FX_INT32 GetPrevious();
- FX_BOOL SetIntact(FX_INT32 iIntact);
- FX_BOOL SetNext(FX_INT32 iNext);
- FX_BOOL SetPrevious(FX_INT32 iPrevious);
+ int32_t GetIntact();
+ int32_t GetNext();
+ int32_t GetPrevious();
+ FX_BOOL SetIntact(int32_t iIntact);
+ FX_BOOL SetNext(int32_t iNext);
+ FX_BOOL SetPrevious(int32_t iPrevious);
private:
CXFA_Node *m_pParent;
};
@@ -260,13 +260,13 @@ public: CXFA_Event(CXFA_Node* pNode);
- FX_INT32 GetActivity();
+ int32_t GetActivity();
- FX_INT32 GetEventType();
+ int32_t GetEventType();
void GetRef(CFX_WideStringC &wsRef);
- FX_INT32 GetExecuteRunAt();
- FX_INT32 GetExecuteType();
+ int32_t GetExecuteRunAt();
+ int32_t GetExecuteType();
void GetExecuteConnection(CFX_WideString &wsConnection);
@@ -276,14 +276,14 @@ public: CXFA_Submit GetSubmit();
- FX_INT32 GetSignDataOperation();
+ int32_t GetSignDataOperation();
void GetSignDataTarget(CFX_WideString &wsTarget);
- FX_BOOL SetActivity(FX_INT32 iActivity);
- FX_BOOL SetEventType(FX_INT32 iEventType);
- FX_BOOL SetExecuteRunAt(FX_INT32 iExecuteRunAt);
- FX_BOOL SetExecuteType(FX_INT32 iExecuteType);
+ FX_BOOL SetActivity(int32_t iActivity);
+ FX_BOOL SetEventType(int32_t iEventType);
+ FX_BOOL SetExecuteRunAt(int32_t iExecuteRunAt);
+ FX_BOOL SetExecuteType(int32_t iExecuteType);
FX_BOOL SetExecuteConnection(const CFX_WideString& wsConnection);
- FX_BOOL SetSignDataOperation(FX_INT32 iOperation);
+ FX_BOOL SetSignDataOperation(int32_t iOperation);
FX_BOOL SetSignDataTarget(const CFX_WideString& wsTarget);
};
enum XFA_SCRIPTTYPE {
@@ -298,11 +298,11 @@ public: void GetBinding(CFX_WideString &wsBinding);
XFA_SCRIPTTYPE GetContentType();
- FX_INT32 GetRunAt();
+ int32_t GetRunAt();
void GetExpression(CFX_WideString &wsExpression);
FX_BOOL SetBinding(const CFX_WideString& wsBinding);
FX_BOOL SetContentType(XFA_SCRIPTTYPE eType);
- FX_BOOL SetRunAt(FX_INT32 iRunAt);
+ FX_BOOL SetRunAt(int32_t iRunAt);
FX_BOOL SetExpression(const CFX_WideString& wsExpression);
};
class CXFA_Submit : public CXFA_Data
@@ -310,11 +310,11 @@ class CXFA_Submit : public CXFA_Data public:
CXFA_Submit(CXFA_Node* pNode);
FX_BOOL IsSubmitEmbedPDF();
- FX_INT32 GetSubmitFormat();
+ int32_t GetSubmitFormat();
void GetSubmitTarget(CFX_WideStringC &wsTarget);
XFA_TEXTENCODING GetSubmitTextEncoding();
void GetSubmitXDPContent(CFX_WideStringC &wsContent);
- FX_BOOL SetSubmitFormat(FX_INT32 iSubmitFormat);
+ FX_BOOL SetSubmitFormat(int32_t iSubmitFormat);
FX_BOOL SetSubmitTarget(const CFX_WideString& wsTarget);
FX_BOOL SetSubmitTextEncoding(XFA_TEXTENCODING eTextEncoding);
FX_BOOL SetSubmitXDPContent(const CFX_WideString& wsContent);
@@ -339,23 +339,23 @@ class CXFA_Line : public CXFA_Data {
public:
CXFA_Line(CXFA_Node* pNode) : CXFA_Data(pNode) {}
- FX_INT32 GetHand();
+ int32_t GetHand();
FX_BOOL GetSlop();
CXFA_Edge GetEdge();
- FX_BOOL SetHand(FX_INT32 iHand);
- FX_BOOL SetSlop(FX_INT32 iSlop);
+ FX_BOOL SetHand(int32_t iHand);
+ FX_BOOL SetSlop(int32_t iSlop);
};
class CXFA_Text : public CXFA_Data
{
public:
CXFA_Text(CXFA_Node* pNode);
void GetName(CFX_WideStringC &wsName);
- FX_INT32 GetMaxChars();
+ int32_t GetMaxChars();
void GetRid(CFX_WideStringC &wsRid);
void GetContent(CFX_WideString &wsText);
void SetContent(CFX_WideString wsText, FX_BOOL bNotify = TRUE);
FX_BOOL SetName(const CFX_WideString& wsName);
- FX_BOOL SetMaxChars(FX_INT32 iMaxChars);
+ FX_BOOL SetMaxChars(int32_t iMaxChars);
FX_BOOL SetRid(const CFX_WideString& wsRid);
};
class CXFA_ExData : public CXFA_Data
@@ -364,30 +364,30 @@ public: CXFA_ExData(CXFA_Node* pNode);
void GetContentType(CFX_WideStringC &wsContentType);
void GetHref(CFX_WideStringC &wsHref);
- FX_INT32 GetMaxLength();
+ int32_t GetMaxLength();
void GetRid(CFX_WideStringC &wsRid);
- FX_INT32 GetTransferEncoding();
+ int32_t GetTransferEncoding();
void GetContent(CFX_WideString &wsText);
FX_BOOL SetContentType(const CFX_WideString& wsContentType);
FX_BOOL SetHref(const CFX_WideString& wsHref);
- FX_BOOL SetMaxLength(FX_INT32 iMaxLength);
+ FX_BOOL SetMaxLength(int32_t iMaxLength);
FX_BOOL SetRid(const CFX_WideString& wsRid);
- FX_BOOL SetTransferEncoding(FX_INT32 iTransferEncoding);
+ FX_BOOL SetTransferEncoding(int32_t iTransferEncoding);
FX_BOOL SetContent(const CFX_WideString& wsText, FX_BOOL bNotify = FALSE, FX_BOOL bScriptModify = FALSE, FX_BOOL bSyncData = TRUE);
};
class CXFA_Image : public CXFA_Data
{
public:
CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue);
- FX_INT32 GetAspect();
+ int32_t GetAspect();
FX_BOOL GetContentType(CFX_WideString &wsContentType);
FX_BOOL GetHref(CFX_WideString &wsHref);
- FX_INT32 GetTransferEncoding();
+ int32_t GetTransferEncoding();
FX_BOOL GetContent(CFX_WideString &wsText);
- FX_BOOL SetAspect(FX_INT32 iAspect);
+ FX_BOOL SetAspect(int32_t iAspect);
FX_BOOL SetContentType(const CFX_WideString& wsContentType);
FX_BOOL SetHref(const CFX_WideString& wsHref);
- FX_BOOL SetTransferEncoding(FX_INT32 iTransferEncoding);
+ FX_BOOL SetTransferEncoding(int32_t iTransferEncoding);
FX_BOOL SetContent(const CFX_WideString& wsText);
protected:
FX_BOOL m_bDefValue;
@@ -397,21 +397,21 @@ class CXFA_Calculate : public CXFA_Data public:
CXFA_Calculate(CXFA_Node* pNode);
- FX_INT32 GetOverride();
+ int32_t GetOverride();
CXFA_Script GetScript();
void GetMessageText(CFX_WideString &wsMessage);
- FX_BOOL SetOverride(FX_INT32 iOverride);
+ FX_BOOL SetOverride(int32_t iOverride);
FX_BOOL SetMessageText(const CFX_WideString& wsMessage);
};
class CXFA_Validate : public CXFA_Data
{
public:
CXFA_Validate(CXFA_Node* pNode);
- FX_INT32 GetFormatTest();
+ int32_t GetFormatTest();
FX_BOOL SetFormatTest(CFX_WideString wsValue);
- FX_INT32 GetNullTest();
+ int32_t GetNullTest();
FX_BOOL SetNullTest(CFX_WideString wsValue);
- FX_INT32 GetScriptTest();
+ int32_t GetScriptTest();
void GetFormatMessageText(CFX_WideString &wsMessage);
void SetFormatMessageText(CFX_WideString wsMessage);
void GetNullMessageText(CFX_WideString &wsMessage);
@@ -423,24 +423,24 @@ public: protected:
void GetMessageText(CFX_WideString &wsMessage, FX_WSTR wsMessageType);
void SetMessageText(CFX_WideString &wsMessage, FX_WSTR wsMessageType);
- FX_BOOL SetTestValue(FX_INT32 iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName);
+ FX_BOOL SetTestValue(int32_t iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName);
};
class CXFA_Variables : public CXFA_Data
{
public:
CXFA_Variables(CXFA_Node* pNode);
- FX_INT32 CountScripts();
- CXFA_Script GetScript(FX_INT32 nIndex);
+ int32_t CountScripts();
+ CXFA_Script GetScript(int32_t nIndex);
};
class CXFA_Bind : public CXFA_Data
{
public:
CXFA_Bind(CXFA_Node* pNode);
- FX_INT32 GetMatch();
+ int32_t GetMatch();
void GetRef(CFX_WideStringC &wsRef);
void GetPicture(CFX_WideString &wsPicture);
- FX_BOOL SetMatch(FX_INT32 iMatch);
+ FX_BOOL SetMatch(int32_t iMatch);
FX_BOOL SetRef(const CFX_WideString& wsRef);
FX_BOOL SetPicture(const CFX_WideString& wsPicture);
};
@@ -489,15 +489,15 @@ public: return GetClassID() == XFA_ELEMENT_Edge;
}
- FX_INT32 GetPresence() const;
+ int32_t GetPresence() const;
FX_BOOL IsVisible() const
{
return GetPresence() == XFA_ATTRIBUTEENUM_Visible;
}
- FX_INT32 GetCapType() const;
+ int32_t GetCapType() const;
- FX_INT32 GetStrokeType() const;
+ int32_t GetStrokeType() const;
FX_FLOAT GetThickness() const;
CXFA_Measurement GetMSThickness() const;
@@ -509,7 +509,7 @@ public: void SetColor(FX_ARGB argb);
- FX_INT32 GetJoinType() const;
+ int32_t GetJoinType() const;
FX_BOOL IsInverted() const;
@@ -551,19 +551,19 @@ public: return GetClassID() == XFA_ELEMENT_Rectangle;
}
- FX_INT32 GetBreak() const;
+ int32_t GetBreak() const;
- FX_INT32 GetHand() const;
+ int32_t GetHand() const;
- FX_INT32 GetPresence() const;
+ int32_t GetPresence() const;
- FX_INT32 CountCorners() const;
+ int32_t CountCorners() const;
- CXFA_Corner GetCorner(FX_INT32 nIndex) const;
+ CXFA_Corner GetCorner(int32_t nIndex) const;
- FX_INT32 CountEdges() const;
+ int32_t CountEdges() const;
- CXFA_Edge GetEdge(FX_INT32 nIndex = 0) const;
+ CXFA_Edge GetEdge(int32_t nIndex = 0) const;
void GetStrokes(CXFA_StrokeArray &strokes) const;
@@ -591,7 +591,7 @@ public: FX_BOOL SameStyles() const;
- FX_INT32 Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const;
+ int32_t Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const;
};
class CXFA_Arc : public CXFA_Box
{
@@ -627,12 +627,12 @@ public: XFA_ELEMENT GetUIType();
CFX_WideString GetRawValue();
- FX_INT32 GetAccess(FX_BOOL bTemplate = FALSE);
+ int32_t GetAccess(FX_BOOL bTemplate = FALSE);
FX_BOOL GetAccessKey(CFX_WideStringC &wsAccessKey);
- FX_INT32 GetAnchorType();
- FX_INT32 GetColSpan();
- FX_INT32 GetPresence();
- FX_INT32 GetRotate();
+ int32_t GetAnchorType();
+ int32_t GetColSpan();
+ int32_t GetPresence();
+ int32_t GetRotate();
CXFA_Border GetBorder(FX_BOOL bModified = FALSE);
CXFA_Caption GetCaption(FX_BOOL bModified = FALSE);
CXFA_Font GetFont(FX_BOOL bModified = FALSE);
@@ -640,7 +640,7 @@ public: CXFA_Para GetPara(FX_BOOL bModified = FALSE);
CXFA_Keep GetKeep(FX_BOOL bModified = FALSE);
void GetEventList(CXFA_NodeArray &events);
- FX_INT32 GetEventByActivity(FX_INT32 iActivity,
+ int32_t GetEventByActivity(int32_t iActivity,
CXFA_NodeArray &events,
FX_BOOL bIsFormReady = FALSE);
CXFA_Value GetDefaultValue(FX_BOOL bModified = FALSE);
@@ -659,12 +659,12 @@ public: FX_BOOL GetMaxWidth(FX_FLOAT &fMaxWidth);
FX_BOOL GetMaxHeight(FX_FLOAT &fMaxHeight);
CXFA_BindItems GetBindItems();
- FX_BOOL SetAccess(FX_INT32 iAccess, FX_BOOL bNotify = TRUE);
+ FX_BOOL SetAccess(int32_t iAccess, FX_BOOL bNotify = TRUE);
FX_BOOL SetAccessKey(const CFX_WideString& wsAccessKey);
- FX_BOOL SetAnchorType(FX_INT32 iType);
- FX_BOOL SetColSpan(FX_INT32 iColSpan);
- FX_BOOL SetPresence(FX_INT32 iPresence);
- FX_BOOL SetRotate(FX_INT32 iRotate);
+ FX_BOOL SetAnchorType(int32_t iType);
+ FX_BOOL SetColSpan(int32_t iColSpan);
+ FX_BOOL SetPresence(int32_t iPresence);
+ FX_BOOL SetRotate(int32_t iRotate);
FX_BOOL SetRelevant(const CFX_WideString& wsRelevant);
FX_BOOL SetStatus(FX_DWORD dwStatus);
FX_BOOL SetWidth(FX_FLOAT fWidth);
@@ -675,20 +675,20 @@ public: FX_BOOL SetMaxHeight(FX_FLOAT fMaxHeight);
FX_BOOL SetPos(FX_FLOAT x, FX_FLOAT y);
FX_BOOL SetName(const CFX_WideString& wsName);
- FX_BOOL SetButtonHighlight(FX_INT32 iButtonHighlight);
+ FX_BOOL SetButtonHighlight(int32_t iButtonHighlight);
FX_BOOL SetButtonRollover(const CFX_WideString &wsRollover, FX_BOOL bRichText);
FX_BOOL SetButtonDown(const CFX_WideString& wsDown, FX_BOOL bRichText);
- FX_BOOL SetCheckButtonShape(FX_INT32 iCheckButtonShape);
- FX_BOOL SetCheckButtonMark(FX_INT32 iCheckButtonMark);
+ FX_BOOL SetCheckButtonShape(int32_t iCheckButtonShape);
+ FX_BOOL SetCheckButtonMark(int32_t iCheckButtonMark);
FX_BOOL SetCheckButtonSize(FX_FLOAT fCheckButtonMark);
CXFA_Border GetUIBorder(FX_BOOL bModified = FALSE);
CXFA_Margin GetUIMargin(FX_BOOL bModified = FALSE);
void GetUIMargin(CFX_RectF &rtUIMargin);
- FX_INT32 GetButtonHighlight();
+ int32_t GetButtonHighlight();
FX_BOOL GetButtonRollover(CFX_WideString &wsRollover, FX_BOOL &bRichText);
FX_BOOL GetButtonDown(CFX_WideString &wsDown, FX_BOOL &bRichText);
- FX_INT32 GetCheckButtonShape();
- FX_INT32 GetCheckButtonMark();
+ int32_t GetCheckButtonShape();
+ int32_t GetCheckButtonMark();
FX_FLOAT GetCheckButtonSize();
FX_BOOL IsAllowNeutral();
FX_BOOL IsRadioButton();
@@ -703,32 +703,32 @@ public: FX_BOOL bSyncData = TRUE);
CXFA_Node* GetExclGroupFirstMember();
CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode);
- FX_INT32 GetChoiceListCommitOn();
+ int32_t GetChoiceListCommitOn();
FX_BOOL IsChoiceListAllowTextEntry();
- FX_INT32 GetChoiceListOpen();
+ int32_t GetChoiceListOpen();
FX_BOOL IsListBox();
- FX_INT32 CountChoiceListItems(FX_BOOL bSaveValue = FALSE);
- FX_BOOL GetChoiceListItem(CFX_WideString &wsText, FX_INT32 nIndex, FX_BOOL bSaveValue = FALSE);
+ int32_t CountChoiceListItems(FX_BOOL bSaveValue = FALSE);
+ FX_BOOL GetChoiceListItem(CFX_WideString &wsText, int32_t nIndex, FX_BOOL bSaveValue = FALSE);
void GetChoiceListItems(CFX_WideStringArray &wsTextArray, FX_BOOL bSaveValue = FALSE);
- FX_INT32 CountSelectedItems();
- FX_INT32 GetSelectedItem(FX_INT32 nIndex = 0);
+ int32_t CountSelectedItems();
+ int32_t GetSelectedItem(int32_t nIndex = 0);
void GetSelectedItems(CFX_Int32Array &iSelArray);
void GetSelectedItemsValue(CFX_WideStringArray &wsSelTextArray);
- FX_BOOL GetItemState(FX_INT32 nIndex);
- void SetItemState(FX_INT32 nIndex, FX_BOOL bSelected,
+ FX_BOOL GetItemState(int32_t nIndex);
+ void SetItemState(int32_t nIndex, FX_BOOL bSelected,
FX_BOOL bNotify = FALSE, FX_BOOL bScriptModify = FALSE,
FX_BOOL bSyncData = TRUE);
void SetSelectdItems(CFX_Int32Array &iSelArray, FX_BOOL bNotify = FALSE,
FX_BOOL bScriptModify = FALSE, FX_BOOL bSyncData = TRUE);
void ClearAllSelections();
void InsertItem(const CFX_WideString &wsLabel, const CFX_WideString &wsValue,
- FX_INT32 nIndex = -1, FX_BOOL bNotify = FALSE);
+ int32_t nIndex = -1, FX_BOOL bNotify = FALSE);
void GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel);
void GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue);
- FX_BOOL DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify = FALSE,
+ FX_BOOL DeleteItem(int32_t nIndex, FX_BOOL bNotify = FALSE,
FX_BOOL bScriptModify = FALSE, FX_BOOL bSyncData = TRUE);
- FX_INT32 GetHorizontalScrollPolicy();
- FX_INT32 GetNumberOfCells();
+ int32_t GetHorizontalScrollPolicy();
+ int32_t GetNumberOfCells();
FX_BOOL IsDateTimeEditUsePicker();
FX_BOOL SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
FX_BOOL GetPictureContent(CFX_WideString &wsPicture, XFA_VALUEPICTURE ePicture);
@@ -738,25 +738,25 @@ public: FX_BOOL GetFormatDataValue(FX_WSTR wsValue, CFX_WideString &wsFormatedValue);
void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput);
CFX_WideString GetBarcodeType();
- FX_BOOL GetBarcodeAttribute_CharEncoding(FX_INT32& val);
- FX_BOOL GetBarcodeAttribute_Checksum(FX_INT32& val);
- FX_BOOL GetBarcodeAttribute_DataLength(FX_INT32& val);
+ FX_BOOL GetBarcodeAttribute_CharEncoding(int32_t& val);
+ FX_BOOL GetBarcodeAttribute_Checksum(int32_t& val);
+ FX_BOOL GetBarcodeAttribute_DataLength(int32_t& val);
FX_BOOL GetBarcodeAttribute_StartChar(FX_CHAR& val);
FX_BOOL GetBarcodeAttribute_EndChar(FX_CHAR& val);
- FX_BOOL GetBarcodeAttribute_ECLevel(FX_INT32& val);
- FX_BOOL GetBarcodeAttribute_ModuleWidth(FX_INT32& val);
- FX_BOOL GetBarcodeAttribute_ModuleHeight(FX_INT32& val);
+ FX_BOOL GetBarcodeAttribute_ECLevel(int32_t& val);
+ FX_BOOL GetBarcodeAttribute_ModuleWidth(int32_t& val);
+ FX_BOOL GetBarcodeAttribute_ModuleHeight(int32_t& val);
FX_BOOL GetBarcodeAttribute_PrintChecksum(FX_BOOL& val);
- FX_BOOL GetBarcodeAttribute_TextLocation(FX_INT32& val);
+ FX_BOOL GetBarcodeAttribute_TextLocation(int32_t& val);
FX_BOOL GetBarcodeAttribute_Truncate(FX_BOOL& val);
FX_BOOL GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val);
void GetPasswordChar(CFX_WideString &wsPassWord);
FX_BOOL IsAllowRichText();
FX_BOOL IsMultiLine();
- FX_INT32 GetVerticalScrollPolicy();
- FX_INT32 GetMaxChars(XFA_ELEMENT& eType);
- FX_BOOL GetFracDigits(FX_INT32 &iFracDigits);
- FX_BOOL GetLeadDigits(FX_INT32 &iLeadDigits);
+ int32_t GetVerticalScrollPolicy();
+ int32_t GetMaxChars(XFA_ELEMENT& eType);
+ FX_BOOL GetFracDigits(int32_t &iFracDigits);
+ FX_BOOL GetLeadDigits(int32_t &iLeadDigits);
CXFA_Filter GetFilter(FX_BOOL bModified = FALSE);
CXFA_Manifest GetManifest(FX_BOOL bModified = FALSE);
@@ -764,7 +764,7 @@ public: FX_BOOL m_bPreNull;
protected:
void SyncValue(const CFX_WideString& wsValue, FX_BOOL bNotify);
- void InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, FX_INT32 nIndex = -1);
+ void InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, int32_t nIndex = -1);
void FormatNumStr(const CFX_WideString& wsValue, IFX_Locale* pLocale, CFX_WideString& wsOutput);
CXFA_Node* m_pUiChildNode;
@@ -774,12 +774,12 @@ class CXFA_Occur : public CXFA_Data {
public:
CXFA_Occur(CXFA_Node* pNode);
- FX_INT32 GetMax();
- FX_INT32 GetMin();
- FX_INT32 GetInitial();
- FX_BOOL GetOccurInfo(FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit);
- void SetMax(FX_INT32 iMax);
- void SetMin(FX_INT32 iMin);
+ int32_t GetMax();
+ int32_t GetMin();
+ int32_t GetInitial();
+ FX_BOOL GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit);
+ void SetMax(int32_t iMax);
+ void SetMin(int32_t iMin);
};
class CXFA_Filter : public CXFA_Data
{
@@ -803,7 +803,7 @@ public: CFX_WideString GetHandlerContent();
XFA_ATTRIBUTEENUM GetlockDocumentType();
CFX_WideString GetlockDocumentContent();
- FX_INT32 GetMDPPermissions();
+ int32_t GetMDPPermissions();
XFA_ATTRIBUTEENUM GetMDPSignatureType();
CXFA_Reasons GetReasons(FX_BOOL bModified = FALSE);
@@ -822,64 +822,64 @@ class CXFA_WrapCertificate : public CXFA_Data public:
CXFA_WrapCertificate(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetType();
- FX_INT32 CountCertificates();
- CXFA_Certificate GetCertificate(FX_INT32 nIndex);
+ int32_t CountCertificates();
+ CXFA_Certificate GetCertificate(int32_t nIndex);
};
class CXFA_Oids : public CXFA_Data
{
public:
CXFA_Oids(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetOidsType();
- FX_INT32 CountOids();
- CFX_WideString GetOidContent(FX_INT32 nIndex);
+ int32_t CountOids();
+ CFX_WideString GetOidContent(int32_t nIndex);
};
class CXFA_SubjectDNs : public CXFA_Data
{
public:
CXFA_SubjectDNs(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetSubjectDNsType();
- FX_INT32 CountSubjectDNs();
- CFX_WideString GetSubjectDNString(FX_INT32 nIndex, XFA_ATTRIBUTE eAttribute);
- CFX_WideString GetSubjectDNContent(FX_INT32 nIndex);
+ int32_t CountSubjectDNs();
+ CFX_WideString GetSubjectDNString(int32_t nIndex, XFA_ATTRIBUTE eAttribute);
+ CFX_WideString GetSubjectDNContent(int32_t nIndex);
};
class CXFA_DigestMethods : public CXFA_Data
{
public:
CXFA_DigestMethods(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetDigestMethodsType();
- FX_INT32 CountDigestMethods();
- CFX_WideString GetDigestMethodContent(FX_INT32 nIndex);
+ int32_t CountDigestMethods();
+ CFX_WideString GetDigestMethodContent(int32_t nIndex);
};
class CXFA_Encodings : public CXFA_Data
{
public:
CXFA_Encodings(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetEncodingsType();
- FX_INT32 CountEncodings();
- CFX_WideString GetEncodingContent(FX_INT32 nIndex);
+ int32_t CountEncodings();
+ CFX_WideString GetEncodingContent(int32_t nIndex);
};
class CXFA_EncryptionMethods : public CXFA_Data
{
public:
CXFA_EncryptionMethods(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetEncryptionMethodsType();
- FX_INT32 CountEncryptionMethods();
- CFX_WideString GetEncryptionMethodContent(FX_INT32 nIndex);
+ int32_t CountEncryptionMethods();
+ CFX_WideString GetEncryptionMethodContent(int32_t nIndex);
};
class CXFA_Reasons : public CXFA_Data
{
public:
CXFA_Reasons(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetReasonsType();
- FX_INT32 CountReasons();
- CFX_WideString GetReasonContent(FX_INT32 nIndex);
+ int32_t CountReasons();
+ CFX_WideString GetReasonContent(int32_t nIndex);
};
class CXFA_Manifest : public CXFA_Data
{
public:
CXFA_Manifest(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_ATTRIBUTEENUM GetAction();
- FX_INT32 CountReives();
- CFX_WideString GetRefContent(FX_INT32 nIndex);
+ int32_t CountReives();
+ CFX_WideString GetRefContent(int32_t nIndex);
};
#endif
diff --git a/xfa/include/fxfa/fxfa_widget.h b/xfa/include/fxfa/fxfa_widget.h index 4488502bf7..0ec3eaaaf4 100644 --- a/xfa/include/fxfa/fxfa_widget.h +++ b/xfa/include/fxfa/fxfa_widget.h @@ -25,7 +25,7 @@ public: CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode);
~CXFA_WidgetAcc();
- FX_BOOL GetName(CFX_WideString &wsName, FX_INT32 iNameType = 0);
+ FX_BOOL GetName(CFX_WideString &wsName, int32_t iNameType = 0);
FX_BOOL ProcessValueChanged();
public:
@@ -41,21 +41,21 @@ public: CXFA_FFApp* GetApp();
IXFA_AppProvider* GetAppProvider();
- FX_INT32 ProcessEvent(FX_INT32 iActivity, CXFA_EventParam* pEventParam);
- FX_INT32 ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam);
- FX_INT32 ProcessCalculate();
- FX_INT32 ProcessValidate(FX_INT32 iFlags = 0);
- FX_INT32 ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue = NULL);
+ int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam);
+ int32_t ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam);
+ int32_t ProcessCalculate();
+ int32_t ProcessValidate(int32_t iFlags = 0);
+ int32_t ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue = NULL);
CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget);
void StartWidgetLayout(FX_FLOAT &fCalcWidth, FX_FLOAT& fCalcHeight);
- FX_BOOL FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight);
+ FX_BOOL FindSplitPos(int32_t iBlockIndex, FX_FLOAT &fCalcHeight);
FX_BOOL LoadCaption();
FX_BOOL LoadText();
FX_BOOL LoadImageImage();
FX_BOOL LoadImageEditImage();
- void GetImageDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
- void GetImageEditDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
+ void GetImageDpi(int32_t &iImageXDpi, int32_t &iImageYDpi);
+ void GetImageEditDpi(int32_t &iImageXDpi, int32_t &iImageYDpi);
CXFA_TextLayout* GetCaptionTextLayout();
CXFA_TextLayout* GetTextLayout();
CFX_DIBitmap* GetImageImage();
@@ -73,9 +73,9 @@ public: FX_FLOAT GetLineHeight();
CXFA_WidgetLayoutData* GetWidgetLayoutData();
protected:
- void ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag);
- FX_INT32 ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag);
- FX_INT32 ProcessNullTestValidate(CXFA_Validate validate, FX_INT32 iFlags, FX_BOOL bVersionFlag);
+ void ProcessScriptTestValidate(CXFA_Validate validate, int32_t iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag);
+ int32_t ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag);
+ int32_t ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, FX_BOOL bVersionFlag);
void GetValidateCaptionName(CFX_WideString& wsCaptionName, FX_BOOL bVersionFlag);
void GetValidateMessage(IXFA_AppProvider* pAppProvider, CFX_WideString& wsMessage, FX_BOOL bError, FX_BOOL bVersionFlag);
void CalcCaptionSize(CFX_SizeF &szCap);
diff --git a/xfa/include/fxgraphics/fx_graphics.h b/xfa/include/fxgraphics/fx_graphics.h index cb86116fa9..99fe7e194f 100644 --- a/xfa/include/fxgraphics/fx_graphics.h +++ b/xfa/include/fxgraphics/fx_graphics.h @@ -23,7 +23,7 @@ typedef int FX_ERR; #define _FX_ERR_CHECK_GOTO_POSITION_IF_FAIL(arg, pos) {if ((arg) != FX_ERR_Succeeded) goto pos;}
#define FX_SHADING_Steps 256
-typedef FX_INT32 FX_DashStyle;
+typedef int32_t FX_DashStyle;
enum {
FX_DASHSTYLE_Solid = 0,
FX_DASHSTYLE_Dash = 1,
@@ -31,7 +31,7 @@ enum { FX_DASHSTYLE_DashDot = 3,
FX_DASHSTYLE_DashDotDot = 4
};
-typedef FX_INT32 FX_StrokeAlignment;
+typedef int32_t FX_StrokeAlignment;
enum {
FX_STROKEALIGNMENT_Center = 0,
FX_STROKEALIGNMENT_Inset = 1,
@@ -39,7 +39,7 @@ enum { FX_STROKEALIGNMENT_Left = 3,
FX_STROKEALIGNMENT_Right = 4
};
-typedef FX_INT32 FX_HatchStyle;
+typedef int32_t FX_HatchStyle;
enum {
FX_HATCHSTYLE_Horizontal = 0,
FX_HATCHSTYLE_Vertical = 1,
@@ -95,8 +95,8 @@ enum { FX_HATCHSTYLE_OutlinedDiamond = 51,
FX_HATCHSTYLE_SolidDiamond = 52
};
-typedef FX_INT32 FX_DeviceCap;
-typedef FX_INT32 FX_FillMode;
+typedef int32_t FX_DeviceCap;
+typedef int32_t FX_FillMode;
class CFX_RenderDevice;
class CFX_GraphStateData;
class CFX_Matrix;
@@ -121,8 +121,8 @@ public: FX_ERR Create(CFX_RenderDevice * renderDevice, FX_BOOL isAntialiasing = TRUE);
- FX_ERR Create(FX_INT32 width,
- FX_INT32 height,
+ FX_ERR Create(int32_t width,
+ int32_t height,
FXDIB_Format format,
FX_BOOL isNative = TRUE,
FX_BOOL isAntialiasing = TRUE);
@@ -132,7 +132,7 @@ public: - FX_ERR GetDeviceCap(const FX_INT32 capID, FX_DeviceCap & capVal);
+ FX_ERR GetDeviceCap(const int32_t capID, FX_DeviceCap & capVal);
FX_ERR IsPrinterDevice(FX_BOOL & isPrinter);
FX_ERR EnableAntialiasing(FX_BOOL isAntialiasing);
@@ -148,11 +148,11 @@ public: FX_ERR SetLineCap(CFX_GraphStateData::LineCap lineCap);
- FX_ERR GetDashCount(FX_INT32 & dashCount);
+ FX_ERR GetDashCount(int32_t & dashCount);
FX_ERR GetLineDash(FX_FLOAT & dashPhase, FX_FLOAT * dashArray);
- FX_ERR SetLineDash(FX_FLOAT dashPhase, FX_FLOAT * dashArray, FX_INT32 dashCount);
+ FX_ERR SetLineDash(FX_FLOAT dashPhase, FX_FLOAT * dashArray, int32_t dashCount);
FX_ERR SetLineDash(FX_DashStyle dashStyle);
@@ -224,7 +224,7 @@ public: FX_ERR SetCharSpacing(const FX_FLOAT spacing);
- FX_ERR SetTextDrawingMode(const FX_INT32 mode);
+ FX_ERR SetTextDrawingMode(const int32_t mode);
FX_ERR ShowText(const CFX_PointF & point,
@@ -295,7 +295,7 @@ private: protected:
- FX_INT32 _type;
+ int32_t _type;
private:
struct TInfo {
CFX_GraphStateData _graphState;
@@ -417,7 +417,7 @@ public: FX_ERR Set(CFX_Shading * shading);
private:
- FX_INT32 _type;
+ int32_t _type;
union {
struct {
FX_ARGB _argb;
@@ -448,7 +448,7 @@ public: virtual ~CFX_Pattern();
private:
- FX_INT32 _type;
+ int32_t _type;
CFX_Matrix _matrix;
union {
struct {
@@ -498,7 +498,7 @@ public: private:
FX_ERR InitArgbArray();
private:
- FX_INT32 _type;
+ int32_t _type;
CFX_PointF _beginPoint;
CFX_PointF _endPoint;
FX_FLOAT _beginRadius;
diff --git a/xfa/include/fxjse/fxjse.h b/xfa/include/fxjse/fxjse.h index aeec9af0a0..c0ec9c91d6 100644 --- a/xfa/include/fxjse/fxjse.h +++ b/xfa/include/fxjse/fxjse.h @@ -41,18 +41,18 @@ class CFXJSE_Arguments {
public:
FXJSE_HRUNTIME GetRuntime() const;
- FX_INT32 GetLength() const;
- FXJSE_HVALUE GetValue(FX_INT32 index) const;
- FX_BOOL GetBoolean(FX_INT32 index) const;
- FX_INT32 GetInt32(FX_INT32 index) const;
- FX_FLOAT GetFloat(FX_INT32 index) const;
- CFX_ByteString GetUTF8String(FX_INT32 index) const;
- FX_LPVOID GetObject(FX_INT32 index, FXJSE_HCLASS hClass = NULL) const;
+ int32_t GetLength() const;
+ FXJSE_HVALUE GetValue(int32_t index) const;
+ FX_BOOL GetBoolean(int32_t index) const;
+ int32_t GetInt32(int32_t index) const;
+ FX_FLOAT GetFloat(int32_t index) const;
+ CFX_ByteString GetUTF8String(int32_t index) const;
+ FX_LPVOID GetObject(int32_t index, FXJSE_HCLASS hClass = NULL) const;
FXJSE_HVALUE GetReturnValue();
};
typedef void (*FXJSE_FuncCallback) (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
typedef void (*FXJSE_PropAccessor) (FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue);
-typedef FX_INT32(*FXJSE_PropTypeGetter) (FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
+typedef int32_t(*FXJSE_PropTypeGetter) (FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
typedef FX_BOOL (*FXJSE_PropDeleter) (FXJSE_HOBJECT hObject, FX_BSTR szPropName);
typedef struct _FXJSE_FUNCTION {
FX_LPCSTR name;
@@ -75,8 +75,8 @@ typedef struct _FXJSE_CLASS { FXJSE_FuncCallback constructor;
FXJSE_PROPERTY* properties;
FXJSE_FUNCTION* methods;
- FX_INT32 propNum;
- FX_INT32 methNum;
+ int32_t propNum;
+ int32_t methNum;
FXJSE_PropTypeGetter dynPropTypeGetter;
FXJSE_PropAccessor dynPropGetter;
FXJSE_PropAccessor dynPropSetter;
@@ -101,31 +101,31 @@ FX_BOOL FXJSE_Value_IsDate (FXJSE_HVALUE hValue); FX_BOOL FXJSE_Value_ToBoolean (FXJSE_HVALUE hValue);
FX_FLOAT FXJSE_Value_ToFloat (FXJSE_HVALUE hValue);
FXJSE_DOUBLE FXJSE_Value_ToDouble (FXJSE_HVALUE hValue);
-FX_INT32 FXJSE_Value_ToInteger (FXJSE_HVALUE hValue);
+int32_t FXJSE_Value_ToInteger (FXJSE_HVALUE hValue);
void FXJSE_Value_ToUTF8String (FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput);
FX_LPVOID FXJSE_Value_ToObject (FXJSE_HVALUE hValue, FXJSE_HCLASS hClass);
void FXJSE_Value_SetUndefined (FXJSE_HVALUE hValue);
void FXJSE_Value_SetNull (FXJSE_HVALUE hValue);
void FXJSE_Value_SetBoolean (FXJSE_HVALUE hValue, FX_BOOL bBoolean);
void FXJSE_Value_SetUTF8String (FXJSE_HVALUE hValue, FX_BSTR szString);
-void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, FX_INT32 nInteger);
+void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, int32_t nInteger);
void FXJSE_Value_SetFloat (FXJSE_HVALUE hValue, FX_FLOAT fFloat);
void FXJSE_Value_SetDouble (FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble);
void FXJSE_Value_SetObject (FXJSE_HVALUE hValue, FX_LPVOID lpObject, FXJSE_HCLASS hClass);
-void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, FX_UINT32 uValueCount, FXJSE_HVALUE* rgValues);
+void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, uint32_t uValueCount, FXJSE_HVALUE* rgValues);
void FXJSE_Value_SetDate (FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble);
void FXJSE_Value_Set (FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue);
FX_BOOL FXJSE_Value_GetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue);
FX_BOOL FXJSE_Value_SetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue);
+FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue);
+FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue);
FX_BOOL FXJSE_Value_DeleteObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName);
FX_BOOL FXJSE_Value_ObjectHasOwnProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FX_BOOL bUseTypeGetter);
FX_BOOL FXJSE_Value_SetObjectOwnProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_CallFunction (FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs);
+FX_BOOL FXJSE_Value_CallFunction (FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs);
FX_BOOL FXJSE_Value_SetFunctionBind (FXJSE_HVALUE hValue, FXJSE_HVALUE hOldFunction, FXJSE_HVALUE hNewThis);
FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext, FX_LPCSTR szScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hNewThisObject = NULL);
void FXJSE_ThrowMessage(FX_BSTR utf8Name, FX_BSTR utf8Message);
FX_BOOL FXJSE_ReturnValue_GetMessage(FXJSE_HVALUE hRetValue, CFX_ByteString& utf8Name, CFX_ByteString& utf8Message);
-FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, FX_INT32& nLine, FX_INT32& nCol);
+FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, int32_t& nLine, int32_t& nCol);
#endif
diff --git a/xfa/src/fdp/include/fde_brs.h b/xfa/src/fdp/include/fde_brs.h index 04a4f48ad5..dacf31fd2a 100644 --- a/xfa/src/fdp/include/fde_brs.h +++ b/xfa/src/fdp/include/fde_brs.h @@ -33,9 +33,9 @@ typedef CFX_ArrayTemplate<FDE_GRADIENTCOLOR> CFDE_GradientColors; class IFDE_Brush
{
public:
- static IFDE_Brush* Create(FX_INT32 iType);
+ static IFDE_Brush* Create(int32_t iType);
virtual void Release() = 0;
- virtual FX_INT32 GetType() const = 0;
+ virtual int32_t GetType() const = 0;
};
class IFDE_SolidBrush : public IFDE_Brush
{
@@ -112,16 +112,16 @@ class IFDE_HatchBrush : public IFDE_Brush public:
virtual FX_ARGB GetColor(FX_BOOL bForegroundColor) const = 0;
virtual void SetColor(FX_ARGB color, FX_BOOL bForegroundColor) = 0;
- virtual FX_INT32 GetHatchStyle() const = 0;
- virtual FX_BOOL SetHatchStyle(FX_INT32 iHatchStyle) = 0;
+ virtual int32_t GetHatchStyle() const = 0;
+ virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle) = 0;
};
class IFDE_TextureBrush : public IFDE_Brush
{
public:
virtual IFDE_Image* GetImage() const = 0;
virtual void SetImage(IFDE_Image *pImage, FX_BOOL bAutoRelease) = 0;
- virtual FX_INT32 GetWrapMode() const = 0;
- virtual void SetWrapMode(FX_INT32 iWrapMode) = 0;
+ virtual int32_t GetWrapMode() const = 0;
+ virtual void SetWrapMode(int32_t iWrapMode) = 0;
};
#define FDE_LINEARGRADIENTMODE_Horizontal 0
#define FDE_LINEARGRADIENTMODE_Vertical 1
@@ -134,10 +134,10 @@ public: virtual void SetLinearPoints(const CFX_PointF &startingPoint, const CFX_PointF &endingPoint) = 0;
virtual void GetLinearColors(FX_ARGB &startingColor, FX_ARGB &endingColor) const = 0;
virtual void SetLinearColors(const FX_ARGB &startingColor, const FX_ARGB &endingColor) = 0;
- virtual FX_INT32 CountGradientColors() const = 0;
+ virtual int32_t CountGradientColors() const = 0;
virtual FX_BOOL GetGradientColors(CFDE_GradientColors &colors) const = 0;
virtual FX_BOOL SetGradientColors(const CFDE_GradientColors &colors) = 0;
- virtual FX_INT32 GetWrapMode() const = 0;
- virtual void SetWrapMode(FX_INT32 iWrapMode) = 0;
+ virtual int32_t GetWrapMode() const = 0;
+ virtual void SetWrapMode(int32_t iWrapMode) = 0;
};
#endif
diff --git a/xfa/src/fdp/include/fde_css.h b/xfa/src/fdp/include/fde_css.h index 2870c8d27a..0c9b323954 100644 --- a/xfa/src/fdp/include/fde_css.h +++ b/xfa/src/fdp/include/fde_css.h @@ -242,11 +242,11 @@ public: virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const = 0;
virtual FX_ARGB GetRGBColor() const = 0;
virtual FX_FLOAT GetFloat() const = 0;
- virtual FX_LPCWSTR GetString(FX_INT32 &iLength) const = 0;
+ virtual FX_LPCWSTR GetString(int32_t &iLength) const = 0;
virtual FDE_CSSPROPERTYVALUE GetEnum() const = 0;
virtual FX_LPCWSTR GetFuncName() const = 0;
- virtual FX_INT32 CountArgs() const = 0;
- virtual IFDE_CSSValue* GetArgs(FX_INT32 index) const = 0;
+ virtual int32_t CountArgs() const = 0;
+ virtual IFDE_CSSValue* GetArgs(int32_t index) const = 0;
};
class IFDE_CSSValueList : public IFDE_CSSValue
{
@@ -255,8 +255,8 @@ public: {
return FDE_CSSVALUETYPE_List;
}
- virtual FX_INT32 CountValues() const = 0;
- virtual IFDE_CSSValue* GetValue(FX_INT32 index) const = 0;
+ virtual int32_t CountValues() const = 0;
+ virtual IFDE_CSSValue* GetValue(int32_t index) const = 0;
};
enum FDE_CSSPROPERTY {
FDE_CSSPROPERTY_WritingMode,
@@ -429,8 +429,8 @@ public: {
return FDE_CSSRULETYPE_Style;
}
- virtual FX_INT32 CountSelectorLists() const = 0;
- virtual IFDE_CSSSelector* GetSelectorList(FX_INT32 index) const = 0;
+ virtual int32_t CountSelectorLists() const = 0;
+ virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const = 0;
virtual IFDE_CSSDeclaration* GetDeclaration() const = 0;
};
class IFDE_CSSMediaRule : public IFDE_CSSRule
@@ -441,8 +441,8 @@ public: return FDE_CSSRULETYPE_Media;
}
virtual FX_DWORD GetMediaList() const = 0;
- virtual FX_INT32 CountRules() const = 0;
- virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0;
+ virtual int32_t CountRules() const = 0;
+ virtual IFDE_CSSRule* GetRule(int32_t index) = 0;
};
class IFDE_CSSFontFaceRule : public IFDE_CSSRule
{
@@ -458,13 +458,13 @@ class IFDE_CSSStyleSheet : public IFX_Unknown public:
static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet();
static IFDE_CSSStyleSheet* LoadFromStream(const CFX_WideString &szUrl, IFX_Stream *pStream, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
- static IFDE_CSSStyleSheet* LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
+ static IFDE_CSSStyleSheet* LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
virtual FX_BOOL GetUrl(CFX_WideString &szUrl) = 0;
virtual FX_DWORD GetMediaList() const = 0;
virtual FX_WORD GetCodePage() const = 0;
- virtual FX_INT32 CountRules() const = 0;
- virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0;
+ virtual int32_t CountRules() const = 0;
+ virtual IFDE_CSSRule* GetRule(int32_t index) = 0;
};
typedef CFX_ArrayTemplate<IFDE_CSSStyleSheet*> CFDE_CSSStyleSheetArray;
#define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET"))
@@ -474,7 +474,7 @@ class IFDE_CSSStyleSheetCache public:
static IFDE_CSSStyleSheetCache* Create();
virtual void Release() = 0;
- virtual void SetMaxItems(FX_INT32 iMaxCount = 5) = 0;
+ virtual void SetMaxItems(int32_t iMaxCount = 5) = 0;
virtual void AddStyleSheet(FX_BSTR szKey, IFDE_CSSStyleSheet *pStyleSheet) = 0;
virtual IFDE_CSSStyleSheet* GetStyleSheet(FX_BSTR szKey) const = 0;
virtual void RemoveStyleSheet(FX_BSTR szKey) = 0;
@@ -503,11 +503,11 @@ class IFDE_CSSSyntaxParser public:
static IFDE_CSSSyntaxParser* Create();
virtual void Release() = 0;
- virtual FX_BOOL Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
- virtual FX_BOOL Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
+ virtual FX_BOOL Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
+ virtual FX_BOOL Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse() = 0;
- virtual FX_LPCWSTR GetCurrentString(FX_INT32 &iLength) const = 0;
+ virtual FX_LPCWSTR GetCurrentString(int32_t &iLength) const = 0;
};
enum FDE_CSSLENGTHUNIT {
FDE_CSSLENGTHUNIT_Auto,
@@ -526,7 +526,7 @@ struct FDE_CSSLENGTH { }
FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue)
{
- m_iData = ((FX_INTPTR)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit;
+ m_iData = ((intptr_t)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit;
return *this;
}
FDE_CSSLENGTHUNIT GetUnit() const
@@ -542,7 +542,7 @@ struct FDE_CSSLENGTH { return (m_iData >> FDE_CSSUNITBITS) != 0;
}
private:
- FX_INTPTR m_iData;
+ intptr_t m_iData;
};
struct FDE_CSSPOINT {
FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit)
@@ -867,19 +867,19 @@ public: class IFDE_CSSGeneratedContentStyle
{
public:
- virtual FX_INT32 CountCounters() = 0;
- virtual FX_LPCWSTR GetCounterIdentifier(FX_INT32 index) = 0;
- virtual FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue) = 0;
- virtual FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue) = 0;
+ virtual int32_t CountCounters() = 0;
+ virtual FX_LPCWSTR GetCounterIdentifier(int32_t index) = 0;
+ virtual FX_BOOL GetCounterReset(int32_t index, int32_t &iValue) = 0;
+ virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue) = 0;
virtual IFDE_CSSValueList* GetContent() const = 0;
- virtual FX_INT32 CountQuotes() const = 0;
- virtual FX_LPCWSTR GetQuotes(FX_INT32 index) const = 0;
+ virtual int32_t CountQuotes() const = 0;
+ virtual FX_LPCWSTR GetQuotes(int32_t index) const = 0;
};
class IFDE_CSSFontStyle
{
public:
- virtual FX_INT32 CountFontFamilies() const = 0;
- virtual FX_LPCWSTR GetFontFamily(FX_INT32 index) const = 0;
+ virtual int32_t CountFontFamilies() const = 0;
+ virtual FX_LPCWSTR GetFontFamily(int32_t index) const = 0;
virtual FX_WORD GetFontWeight() const = 0;
virtual FDE_CSSFONTVARIANT GetFontVariant() const = 0;
virtual FDE_CSSFONTSTYLE GetFontStyle() const = 0;
@@ -955,12 +955,12 @@ public: virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0;
virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0;
virtual FDE_CSSWORDBREAK GetWordBreak() const = 0;
- virtual FX_INT32 GetWidows() const = 0;
+ virtual int32_t GetWidows() const = 0;
virtual FX_ARGB GetTextEmphasisColor() const = 0;
virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0;
virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0;
virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0;
- virtual FX_INT32 GetOrphans() const = 0;
+ virtual int32_t GetOrphans() const = 0;
virtual FDE_CSSLINEBREAK GetLineBreak() const = 0;
virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0;
virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0;
@@ -980,12 +980,12 @@ public: virtual void SetWordSpacing(const FDE_CSSLENGTH &wordSpacing) = 0;
virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0;
virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0;
- virtual void SetWidows(FX_INT32 iWidows) = 0;
+ virtual void SetWidows(int32_t iWidows) = 0;
virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0;
virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0;
virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0;
virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0;
- virtual void SetOrphans(FX_INT32 iOrphans) = 0;
+ virtual void SetOrphans(int32_t iOrphans) = 0;
virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) = 0;
};
class IFDE_CSSBackgroundStyle
@@ -1076,7 +1076,7 @@ public: virtual void UpdateStyleIndex(FX_DWORD dwMediaList) = 0;
virtual IFDE_CSSAccelerator* InitAccelerator() = 0;
virtual IFDE_CSSComputedStyle* CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle) = 0;
- virtual FX_INT32 MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0;
- virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle) = 0;
+ virtual int32_t MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0;
+ virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle) = 0;
};
#endif
diff --git a/xfa/src/fdp/include/fde_img.h b/xfa/src/fdp/include/fde_img.h index 808bc4c304..92ed9daac6 100644 --- a/xfa/src/fdp/include/fde_img.h +++ b/xfa/src/fdp/include/fde_img.h @@ -18,21 +18,21 @@ class IFDE_Image; class IFDE_Image
{
public:
- static IFDE_Image* Create(IFX_Stream *pStream, FX_INT32 iFormat = FDE_IMAGEFORMAT_Unknown);
+ static IFDE_Image* Create(IFX_Stream *pStream, int32_t iFormat = FDE_IMAGEFORMAT_Unknown);
virtual void Release() = 0;
virtual FX_BOOL LoadImage() = 0;
virtual void FreeImage() = 0;
- virtual FX_INT32 CountFrames() const = 0;
- virtual FX_BOOL LoadFrame(FX_INT32 index) = 0;
+ virtual int32_t CountFrames() const = 0;
+ virtual FX_BOOL LoadFrame(int32_t index) = 0;
virtual CFX_DIBitmap* GetFrameImage() = 0;
- virtual FX_INT32 GetImageFormat() const = 0;
- virtual FX_INT32 GetImageWidth() const = 0;
- virtual FX_INT32 GetImageHeight() const = 0;
- virtual FX_INT32 GetDelayTime(FX_INT32 iFrameIndex) const = 0;
- virtual FX_INT32 GetLoopCount() const = 0;
- virtual FX_BOOL StartLoadImage(CFX_DIBitmap *pDIBitmap, FX_INT32 dibX, FX_INT32 dibY, FX_INT32 dibCX, FX_INT32 dibCY,
- FX_INT32 imgX, FX_INT32 imgY, FX_INT32 imgCX, FX_INT32 imgCY, FX_INT32 iFrameIndex = 0) = 0;
- virtual FX_INT32 DoLoadImage(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t GetImageFormat() const = 0;
+ virtual int32_t GetImageWidth() const = 0;
+ virtual int32_t GetImageHeight() const = 0;
+ virtual int32_t GetDelayTime(int32_t iFrameIndex) const = 0;
+ virtual int32_t GetLoopCount() const = 0;
+ virtual FX_BOOL StartLoadImage(CFX_DIBitmap *pDIBitmap, int32_t dibX, int32_t dibY, int32_t dibCX, int32_t dibCY,
+ int32_t imgX, int32_t imgY, int32_t imgCX, int32_t imgCY, int32_t iFrameIndex = 0) = 0;
+ virtual int32_t DoLoadImage(IFX_Pause *pPause = NULL) = 0;
virtual void StopLoadImage() = 0;
};
#define FDE_IMAGEFILTER_Unknown -1
@@ -45,11 +45,11 @@ public: #define FDE_IMAGEFILTER_Brightness 6
#define FDE_IMAGEFILTER_Contrast 7
typedef struct _FDE_IMAGEFILTERPARAMS : public CFX_Target {
- FX_INT32 iFilterType;
+ int32_t iFilterType;
} FDE_IMAGEFILTERPARAMS, * FDE_LPIMAGEFILTERPARAMS;
typedef FDE_IMAGEFILTERPARAMS const * FDE_LPCIMAGEFILTERPARAMS;
typedef struct _FDE_OPACITYPARAMS : public FDE_IMAGEFILTERPARAMS {
- FX_INT32 iOpacity;
+ int32_t iOpacity;
} FDE_OPACITYPARAMS, * FDE_LPOPACITYPARAMS;
typedef FDE_OPACITYPARAMS const * FDE_LPCOPACITYPARAMS;
typedef struct _FDE_BLACKWHITEPARAMS : public FDE_IMAGEFILTERPARAMS {
@@ -66,11 +66,11 @@ typedef struct _FDE_MASKCOLORPARAMS : public FDE_IMAGEFILTERPARAMS { } FDE_MASKCOLORPARAMS, * FDE_LPMASKCOLORPARAMS;
typedef FDE_MASKCOLORPARAMS const * FDE_LPCMASKCOLORPARAMS;
typedef struct _FDE_BRIGHTNESSPARAMS : public FDE_IMAGEFILTERPARAMS {
- FX_INT32 iBrightness;
+ int32_t iBrightness;
} FDE_BRIGHTNESSPARAMS, * FDE_LPBRIGHTNESSPARAMS;
typedef FDE_BRIGHTNESSPARAMS const * FDE_LPCBRIGHTNESSPARAMS;
typedef struct _FDE_CONTRASTPARAMS : public FDE_IMAGEFILTERPARAMS {
- FX_INT32 iContrast;
+ int32_t iContrast;
} FDE_CONTRASTPARAMS, * FDE_LPCONTRASTPARAMS;
typedef FDE_CONTRASTPARAMS const * FDE_LPCCONTRASTPARAMS;
#endif
diff --git a/xfa/src/fdp/include/fde_mem.h b/xfa/src/fdp/include/fde_mem.h index 516e67c945..a7eb40a9e2 100644 --- a/xfa/src/fdp/include/fde_mem.h +++ b/xfa/src/fdp/include/fde_mem.h @@ -9,8 +9,8 @@ #ifdef __cplusplus
extern "C" {
#endif
-#define FDE_Alloc(size) FX_Alloc(FX_BYTE, size)
-#define FDE_Realloc(ptr, newSize) FX_Realloc(FX_BYTE, ptr, newSize)
+#define FDE_Alloc(size) FX_Alloc(uint8_t, size)
+#define FDE_Realloc(ptr, newSize) FX_Realloc(uint8_t, ptr, newSize)
#define FDE_Free(ptr) FX_Free(ptr)
#define FDE_New FXTARGET_New
#define FDE_Delete FXTARGET_Delete
diff --git a/xfa/src/fdp/include/fde_pen.h b/xfa/src/fdp/include/fde_pen.h index 7730b6a964..074dc3c3e7 100644 --- a/xfa/src/fdp/include/fde_pen.h +++ b/xfa/src/fdp/include/fde_pen.h @@ -36,25 +36,25 @@ class IFDE_Pen public:
static IFDE_Pen* Create();
virtual void Release() = 0;
- virtual FX_INT32 GetType() const = 0;
+ virtual int32_t GetType() const = 0;
virtual FX_ARGB GetColor() const = 0;
virtual void SetColor(FX_ARGB color) = 0;
virtual IFDE_Brush* GetBrush() const = 0;
virtual void SetBrush(IFDE_Brush *pBrush, FX_BOOL bAutoRelease) = 0;
- virtual FX_INT32 GetLineCap() const = 0;
- virtual void SetLineCap(FX_INT32 iLineCap) = 0;
- virtual FX_INT32 GetDashStyle() const = 0;
- virtual void SetDashStyle(FX_INT32 iDashStyle) = 0;
+ virtual int32_t GetLineCap() const = 0;
+ virtual void SetLineCap(int32_t iLineCap) = 0;
+ virtual int32_t GetDashStyle() const = 0;
+ virtual void SetDashStyle(int32_t iDashStyle) = 0;
virtual FX_FLOAT GetDashPhase() const = 0;
virtual void SetDashPhase(FX_FLOAT fPhase) = 0;
- virtual FX_INT32 CountDashArray() const = 0;
- virtual FX_INT32 GetDashArray(CFX_FloatArray &dashArray) const = 0;
+ virtual int32_t CountDashArray() const = 0;
+ virtual int32_t GetDashArray(CFX_FloatArray &dashArray) const = 0;
virtual void SetDashArray(const CFX_FloatArray &dashArray) = 0;
- virtual FX_INT32 GetLineJoin() const = 0;
- virtual void SetLineJoin(FX_INT32 iLineJoin) = 0;
+ virtual int32_t GetLineJoin() const = 0;
+ virtual void SetLineJoin(int32_t iLineJoin) = 0;
virtual FX_FLOAT GetMiterLimit() const = 0;
virtual void SetMiterLimit(FX_FLOAT fMiterLimit) = 0;
- virtual FX_INT32 CountCompoundPatterns() const = 0;
+ virtual int32_t CountCompoundPatterns() const = 0;
virtual FX_BOOL GetCompoundPatterns(CFDE_CompoundPatterns &compoundPatterns) const = 0;
virtual FX_BOOL SetCompoundPatterns(const CFDE_CompoundPatterns &compoundPatterns) = 0;
};
diff --git a/xfa/src/fdp/include/fde_psr.h b/xfa/src/fdp/include/fde_psr.h index 64070e6648..974f4cc879 100644 --- a/xfa/src/fdp/include/fde_psr.h +++ b/xfa/src/fdp/include/fde_psr.h @@ -35,12 +35,12 @@ public: class IFDE_TextSet : public IFDE_VisualSet
{
public:
- virtual FX_INT32 GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) = 0;
+ virtual int32_t GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) = 0;
virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText) = 0;
virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0;
virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0;
- virtual FX_INT32 GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL) = 0;
- virtual FX_INT32 GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) = 0;
+ virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL) = 0;
+ virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) = 0;
};
class IFDE_ImageSet : public IFDE_VisualSet
{
@@ -58,8 +58,8 @@ class IFDE_PathSet : public IFDE_VisualSet {
public:
virtual IFDE_Path* GetPath(FDE_HVISUALOBJ hPath) = 0;
- virtual FX_INT32 GetFillMode(FDE_HVISUALOBJ hPath) = 0;
- virtual FX_INT32 GetRenderMode(FDE_HVISUALOBJ hPath) = 0;
+ virtual int32_t GetFillMode(FDE_HVISUALOBJ hPath) = 0;
+ virtual int32_t GetRenderMode(FDE_HVISUALOBJ hPath) = 0;
virtual IFDE_Pen* GetPen(FDE_HVISUALOBJ hPath) = 0;
virtual FX_FLOAT GetPenWidth(FDE_HVISUALOBJ hPath) = 0;
virtual IFDE_Brush* GetBrush(FDE_HVISUALOBJ hPath) = 0;
@@ -76,10 +76,10 @@ class IFDE_WidgetSet : public IFDE_VisualSet {
public:
virtual FDE_WIDGETOBJ GetWidgetType(FDE_HVISUALOBJ hWidget) = 0;
- virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_FLOAT fDefVal = 0.0f) = 0;
- virtual FX_INT32 GetInteger(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_INT32 iDefVal = 0) = 0;
- virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_WideString &wsValue) = 0;
- virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_RectFArray &rects) = 0;
+ virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, int32_t iParameter, FX_FLOAT fDefVal = 0.0f) = 0;
+ virtual int32_t GetInteger(FDE_HVISUALOBJ hWidget, int32_t iParameter, int32_t iDefVal = 0) = 0;
+ virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, int32_t iParameter, CFX_WideString &wsValue) = 0;
+ virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, int32_t iParameter, CFX_RectFArray &rects) = 0;
};
class IFDE_VisualSetIterator
{
diff --git a/xfa/src/fdp/include/fde_rdr.h b/xfa/src/fdp/include/fde_rdr.h index 74c5d24516..cbae1c26fa 100644 --- a/xfa/src/fdp/include/fde_rdr.h +++ b/xfa/src/fdp/include/fde_rdr.h @@ -9,7 +9,7 @@ class IFDE_Page;
class IFDE_RenderDevice;
class IFDE_RenderContext;
-void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, FX_INT32 iRotate, FX_DWORD dwCoordinatesType = 0);
+void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, int32_t iRotate, FX_DWORD dwCoordinatesType = 0);
enum FDE_RENDERSTATUS {
FDE_RENDERSTATUS_Reset = 0,
FDE_RENDERSTATUS_Paused ,
diff --git a/xfa/src/fdp/include/fde_rdv.h b/xfa/src/fdp/include/fde_rdv.h index ee1e922c48..eb79a81c9b 100644 --- a/xfa/src/fdp/include/fde_rdv.h +++ b/xfa/src/fdp/include/fde_rdv.h @@ -22,8 +22,8 @@ public: static IFDE_RenderDevice* Create(CFX_RenderDevice *pDevice);
virtual void Release() = 0;
- virtual FX_INT32 GetWidth() const = 0;
- virtual FX_INT32 GetHeight() const = 0;
+ virtual int32_t GetWidth() const = 0;
+ virtual int32_t GetHeight() const = 0;
virtual FDE_HDEVICESTATE SaveState() = 0;
virtual void RestoreState(FDE_HDEVICESTATE hState) = 0;
virtual FX_BOOL SetClipPath(const IFDE_Path *pClip) = 0;
@@ -35,7 +35,7 @@ public: virtual FX_FLOAT GetDpiY() const = 0;
virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL) = 0;
- virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL) = 0;
virtual FX_BOOL DrawBezier(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_PointF &pt3, const CFX_PointF &pt4, const CFX_Matrix *pMatrix = NULL) = 0;
virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL) = 0;
virtual FX_BOOL DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL) = 0;
diff --git a/xfa/src/fdp/include/fde_tto.h b/xfa/src/fdp/include/fde_tto.h index 25dead13ca..8b4d1d4787 100644 --- a/xfa/src/fdp/include/fde_tto.h +++ b/xfa/src/fdp/include/fde_tto.h @@ -43,7 +43,7 @@ public: virtual void SetTabWidth(FX_FLOAT fTabWidth) = 0;
virtual void SetEllipsisString(const CFX_WideString &wsEllipsis) = 0;
virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0;
- virtual void SetAlignment(FX_INT32 iAlignment) = 0;
+ virtual void SetAlignment(int32_t iAlignment) = 0;
virtual void SetLineSpace(FX_FLOAT fLineSpace) = 0;
virtual void SetDIBitmap(CFX_DIBitmap *pDIB) = 0;
virtual void SetRenderDevice(CFX_RenderDevice *pDevice) = 0;
@@ -51,19 +51,19 @@ public: virtual void SetClipRect(const CFX_RectF &rtClip) = 0;
virtual void SetMatrix(const CFX_Matrix &matrix) = 0;
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size) = 0;
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0;
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect) = 0;
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0;
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y) = 0;
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0;
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect) = 0;
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) = 0;
virtual void SetLogicClipRect(const CFX_RectF &rtClip) = 0;
- virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0;
- virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0;
- virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0;
- virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0;
- virtual FX_INT32 GetTotalLines() = 0;
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) = 0;
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) = 0;
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) = 0;
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) = 0;
+ virtual int32_t GetTotalLines() = 0;
};
#endif
diff --git a/xfa/src/fdp/include/fde_xml.h b/xfa/src/fdp/include/fde_xml.h index b8b136b5aa..eddb9a1835 100644 --- a/xfa/src/fdp/include/fde_xml.h +++ b/xfa/src/fdp/include/fde_xml.h @@ -32,7 +32,7 @@ enum FDE_XMLNODETYPE { FDE_XMLNODE_CharData ,
};
typedef struct _FDE_XMLNODE {
- FX_INT32 iNodeNum;
+ int32_t iNodeNum;
FDE_XMLNODETYPE eNodeType;
} FDE_XMLNODE, * FDE_LPXMLNODE;
typedef FDE_XMLNODE const * FDE_LPCXMLNODE;
@@ -48,16 +48,16 @@ class IFDE_XMLNode public:
virtual void Release() = 0;
virtual FDE_XMLNODETYPE GetType() const = 0;
- virtual FX_INT32 CountChildNodes() const = 0;
- virtual IFDE_XMLNode* GetChildNode(FX_INT32 index) const = 0;
- virtual FX_INT32 GetChildNodeIndex(IFDE_XMLNode *pNode) const = 0;
- virtual IFDE_XMLNode* GetPath(FX_LPCWSTR pPath, FX_INT32 iLength = -1, FX_BOOL bQualifiedName = TRUE) const = 0;
- virtual FX_INT32 InsertChildNode(IFDE_XMLNode *pNode, FX_INT32 index = -1) = 0;
+ virtual int32_t CountChildNodes() const = 0;
+ virtual IFDE_XMLNode* GetChildNode(int32_t index) const = 0;
+ virtual int32_t GetChildNodeIndex(IFDE_XMLNode *pNode) const = 0;
+ virtual IFDE_XMLNode* GetPath(FX_LPCWSTR pPath, int32_t iLength = -1, FX_BOOL bQualifiedName = TRUE) const = 0;
+ virtual int32_t InsertChildNode(IFDE_XMLNode *pNode, int32_t index = -1) = 0;
virtual void RemoveChildNode(IFDE_XMLNode *pNode) = 0;
virtual void DeleteChildren() = 0;
enum NodeItem {Root = 0, Parent, FirstSibling, PriorSibling, NextSibling, LastSibling, FirstNeighbor, PriorNeighbor, NextNeighbor, LastNeighbor, FirstChild, LastChild};
virtual IFDE_XMLNode* GetNodeItem(NodeItem eItem) const = 0;
- virtual FX_INT32 GetNodeLevel() const = 0;
+ virtual int32_t GetNodeLevel() const = 0;
virtual FX_BOOL InsertNodeItem(IFDE_XMLNode::NodeItem eItem, IFDE_XMLNode *pNode) = 0;
virtual IFDE_XMLNode* RemoveNodeItem(IFDE_XMLNode::NodeItem eItem) = 0;
virtual IFDE_XMLNode* Clone(FX_BOOL bRecursive) = 0;
@@ -68,20 +68,20 @@ class IFDE_XMLInstruction : public IFDE_XMLNode public:
static IFDE_XMLInstruction* Create(const CFX_WideString &wsTarget);
virtual void GetTargetName(CFX_WideString &wsTarget) const = 0;
- virtual FX_INT32 CountAttributes() const = 0;
- virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
+ virtual int32_t CountAttributes() const = 0;
+ virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0;
virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0;
virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0;
- virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0;
- virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0;
+ virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const = 0;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) = 0;
virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0;
virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0;
virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0;
- virtual FX_INT32 CountData() const = 0;
- virtual FX_BOOL GetData(FX_INT32 index, CFX_WideString &wsData) const = 0;
+ virtual int32_t CountData() const = 0;
+ virtual FX_BOOL GetData(int32_t index, CFX_WideString &wsData) const = 0;
virtual void AppendData(const CFX_WideString &wsData) = 0;
- virtual void RemoveData(FX_INT32 index) = 0;
+ virtual void RemoveData(int32_t index) = 0;
};
class IFDE_XMLElement : public IFDE_XMLNode
{
@@ -91,13 +91,13 @@ public: virtual void GetLocalTagName(CFX_WideString &wsTag) const = 0;
virtual void GetNamespacePrefix(CFX_WideString &wsPrefix) const = 0;
virtual void GetNamespaceURI(CFX_WideString &wsNamespace) const = 0;
- virtual FX_INT32 CountAttributes() const = 0;
- virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
+ virtual int32_t CountAttributes() const = 0;
+ virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0;
virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0;
virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0;
- virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0;
- virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0;
+ virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const = 0;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) = 0;
virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0;
virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0;
virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0;
@@ -137,9 +137,9 @@ class IFDE_XMLDoc public:
static IFDE_XMLDoc* Create();
virtual void Release() = 0;
- virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize = 8192, FX_INT32 iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL) = 0;
+ virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize = 8192, int32_t iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL) = 0;
virtual FX_BOOL LoadXML(IFDE_XMLParser *pXMLParser) = 0;
- virtual FX_INT32 DoLoad(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t DoLoad(IFX_Pause *pPause = NULL) = 0;
virtual void CloseXML() = 0;
virtual IFDE_XMLNode* GetRoot() const = 0;
virtual void SaveXML(IFX_Stream *pXMLStream = NULL, FX_BOOL bSaveBOM = TRUE) = 0;
@@ -149,7 +149,7 @@ class IFDE_XMLParser {
public:
virtual void Release() = 0;
- virtual FX_INT32 DoParser(IFX_Pause *pPause) = 0;
+ virtual int32_t DoParser(IFX_Pause *pPause) = 0;
};
#define FDE_XMLSYNTAXSTATUS_None 0x00
#define FDE_XMLSYNTAXSTATUS_InstructionOpen 0x01
@@ -171,13 +171,13 @@ class IFDE_XMLSyntaxParser public:
static IFDE_XMLSyntaxParser* Create();
virtual void Release() = 0;
- virtual void Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize = 256) = 0;
+ virtual void Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize = 256) = 0;
virtual FX_DWORD DoSyntaxParse() = 0;
- virtual FX_INT32 GetStatus() const = 0;
- virtual FX_INT32 GetCurrentPos() const = 0;
+ virtual int32_t GetStatus() const = 0;
+ virtual int32_t GetCurrentPos() const = 0;
virtual FX_FILESIZE GetCurrentBinaryPos() const = 0;
- virtual FX_INT32 GetCurrentNodeNumber() const = 0;
- virtual FX_INT32 GetLastNodeNumber() const = 0;
+ virtual int32_t GetCurrentNodeNumber() const = 0;
+ virtual int32_t GetLastNodeNumber() const = 0;
virtual void GetTargetName(CFX_WideString &wsTarget) const = 0;
virtual void GetTagName(CFX_WideString &wsTag) const = 0;
virtual void GetAttributeName(CFX_WideString &wsAttriName) const = 0;
diff --git a/xfa/src/fdp/src/css/fde_csscache.h b/xfa/src/fdp/src/css/fde_csscache.h index f4b8cffd57..82c0e4f7e0 100644 --- a/xfa/src/fdp/src/css/fde_csscache.h +++ b/xfa/src/fdp/src/css/fde_csscache.h @@ -22,7 +22,7 @@ public: FDE_Delete this;
}
- virtual void SetMaxItems(FX_INT32 iMaxCount = 5)
+ virtual void SetMaxItems(int32_t iMaxCount = 5)
{
FXSYS_assert(iMaxCount >= 3);
m_iMaxItems = iMaxCount;
@@ -35,7 +35,7 @@ protected: void RemoveLowestActivityItem();
CFX_MapByteStringToPtr m_Stylesheets;
IFX_MEMAllocator *m_pFixedStore;
- FX_INT32 m_iMaxItems;
+ int32_t m_iMaxItems;
};
typedef struct _FDE_CSSTAGCACHE : public CFX_Target {
public:
@@ -57,11 +57,11 @@ public: {
return dwTagHash;
}
- FX_INT32 CountHashClass() const
+ int32_t CountHashClass() const
{
return dwClassHashs.GetSize();
}
- void SetClassIndex(FX_INT32 index)
+ void SetClassIndex(int32_t index)
{
iClassIndex = index;
}
@@ -74,7 +74,7 @@ protected: _FDE_CSSTAGCACHE *pParent;
FX_DWORD dwIDHash;
FX_DWORD dwTagHash;
- FX_INT32 iClassIndex;
+ int32_t iClassIndex;
CFDE_DWordArray dwClassHashs;
} FDE_CSSTAGCACHE, * FDE_LPCSSTAGCACHE;
typedef CFX_ObjectStackTemplate<FDE_CSSTAGCACHE> CFDE_CSSTagStack;
diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.cpp b/xfa/src/fdp/src/css/fde_cssdatatable.cpp index ad9f0772f9..7f42d10ad0 100644 --- a/xfa/src/fdp/src/css/fde_cssdatatable.cpp +++ b/xfa/src/fdp/src/css/fde_cssdatatable.cpp @@ -417,12 +417,12 @@ extern "C" { {
return (ePersudo < FDE_CSSPERSUDO_NONE) ? (g_FDE_CSSPersudoType + ePersudo) : NULL;
}
- FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, FX_INT32 iLength)
+ FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, int32_t iLength)
{
FXSYS_assert(pszName != NULL && iLength > 0);
FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE);
- FX_INT32 iEnd = FDE_CSSPROPERTY_MAX - 1;
- FX_INT32 iMid, iStart = 0;
+ int32_t iEnd = FDE_CSSPROPERTY_MAX - 1;
+ int32_t iMid, iStart = 0;
FX_DWORD dwMid;
do {
iMid = (iStart + iEnd) / 2;
@@ -441,12 +441,12 @@ extern "C" { {
return (eName < FDE_CSSPROPERTY_MAX) ? (g_FDE_CSSProperties + eName) : NULL;
}
- FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, FX_INT32 iLength)
+ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, int32_t iLength)
{
FXSYS_assert(pszName != NULL && iLength > 0);
FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE);
- FX_INT32 iEnd = FDE_CSSPROPERTYVALUE_MAX - 1;
- FX_INT32 iMid, iStart = 0;
+ int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1;
+ int32_t iMid, iStart = 0;
FX_DWORD dwMid;
do {
iMid = (iStart + iEnd) / 2;
@@ -465,12 +465,12 @@ extern "C" { {
return (eName < FDE_CSSPROPERTYVALUE_MAX) ? (g_FDE_CSSPropertyValues + eName) : NULL;
}
- FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, FX_INT32 iLength)
+ FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, int32_t iLength)
{
FXSYS_assert(pszName != NULL && iLength > 0);
FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE);
- FX_INT32 iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1;
- FX_INT32 iMid, iStart = 0;
+ int32_t iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1;
+ int32_t iMid, iStart = 0;
FX_WORD uMid;
do {
iMid = (iStart + iEnd) / 2;
@@ -485,12 +485,12 @@ extern "C" { } while (iStart <= iEnd);
return NULL;
}
- FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, FX_INT32 iLength)
+ FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, int32_t iLength)
{
FXSYS_assert(pszName != NULL && iLength > 0);
FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE);
- FX_INT32 iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1;
- FX_INT32 iMid, iStart = 0;
+ int32_t iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1;
+ int32_t iMid, iStart = 0;
FX_WORD wMid;
do {
iMid = (iStart + iEnd) / 2;
@@ -505,12 +505,12 @@ extern "C" { } while (iStart <= iEnd);
return NULL;
}
- FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, FX_INT32 iLength)
+ FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, int32_t iLength)
{
FXSYS_assert(pszName != NULL && iLength > 0);
FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE);
- FX_INT32 iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1;
- FX_INT32 iMid, iStart = 0;
+ int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1;
+ int32_t iMid, iStart = 0;
FX_DWORD dwMid;
do {
iMid = (iStart + iEnd) / 2;
@@ -525,10 +525,10 @@ extern "C" { } while (iStart <= iEnd);
return NULL;
}
- FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit)
+ FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, int32_t iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit)
{
FXSYS_assert(pszValue != NULL && iValueLen > 0);
- FX_INT32 iUsedLen = 0;
+ int32_t iUsedLen = 0;
fValue = FX_wcstof(pszValue, iValueLen, &iUsedLen);
if (iUsedLen <= 0) {
return FALSE;
@@ -547,7 +547,7 @@ extern "C" { return TRUE;
}
- FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength)
+ FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength)
{
FXSYS_assert(pszValue != NULL && iValueLen > 0);
iOffset = 0;
@@ -561,7 +561,7 @@ extern "C" { return iValueLen > 0;
}
- FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength)
+ FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength)
{
FXSYS_assert(pszValue != NULL && iValueLen > 0);
if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' || FX_wcsnicmp(L"url(", pszValue, 4)) {
@@ -574,22 +574,22 @@ extern "C" { return FALSE;
}
- FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_ARGB &dwColor)
+ FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, int32_t iValueLen, FX_ARGB &dwColor)
{
FXSYS_assert(pszValue != NULL && iValueLen > 0);
if (*pszValue == '#') {
switch (iValueLen) {
case 4: {
- FX_BYTE red = FX_Hex2Dec((FX_BYTE)pszValue[1], (FX_BYTE)pszValue[1]);
- FX_BYTE green = FX_Hex2Dec((FX_BYTE)pszValue[2], (FX_BYTE)pszValue[2]);
- FX_BYTE blue = FX_Hex2Dec((FX_BYTE)pszValue[3], (FX_BYTE)pszValue[3]);
+ uint8_t red = FX_Hex2Dec((uint8_t)pszValue[1], (uint8_t)pszValue[1]);
+ uint8_t green = FX_Hex2Dec((uint8_t)pszValue[2], (uint8_t)pszValue[2]);
+ uint8_t blue = FX_Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[3]);
dwColor = ArgbEncode(255, red, green, blue);
}
return TRUE;
case 7: {
- FX_BYTE red = FX_Hex2Dec((FX_BYTE)pszValue[1], (FX_BYTE)pszValue[2]);
- FX_BYTE green = FX_Hex2Dec((FX_BYTE)pszValue[3], (FX_BYTE)pszValue[4]);
- FX_BYTE blue = FX_Hex2Dec((FX_BYTE)pszValue[5], (FX_BYTE)pszValue[6]);
+ uint8_t red = FX_Hex2Dec((uint8_t)pszValue[1], (uint8_t)pszValue[2]);
+ uint8_t green = FX_Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[4]);
+ uint8_t blue = FX_Hex2Dec((uint8_t)pszValue[5], (uint8_t)pszValue[6]);
dwColor = ArgbEncode(255, red, green, blue);
}
return TRUE;
@@ -598,11 +598,11 @@ extern "C" { if (pszValue[iValueLen - 1] != ')' || FX_wcsnicmp(L"rgb(", pszValue, 4)) {
return FALSE;
}
- FX_BYTE rgb[3] = {0};
+ uint8_t rgb[3] = {0};
FX_FLOAT fValue;
FDE_CSSPRIMITIVETYPE eType;
CFDE_CSSValueListParser list(pszValue + 4, iValueLen - 5, ',');
- for (FX_INT32 i = 0; i < 3; ++i) {
+ for (int32_t i = 0; i < 3; ++i) {
if (!list.NextValue(eType, pszValue, iValueLen)) {
return FALSE;
}
@@ -631,11 +631,11 @@ extern "C" { CFDE_CSSValueList::CFDE_CSSValueList(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list)
{
m_iCount = list.GetSize();
- FX_INT32 iByteCount = m_iCount * sizeof(IFDE_CSSValue*);
+ int32_t iByteCount = m_iCount * sizeof(IFDE_CSSValue*);
m_ppList = (IFDE_CSSValue**)pStaticStore->Alloc(iByteCount);
FXSYS_memcpy(m_ppList, list.GetData(), iByteCount);
}
-FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, FX_INT32 &iLength)
+FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, int32_t &iLength)
{
while (m_pCur < m_pEnd && (*m_pCur <= ' ' || *m_pCur == m_Separator)) {
++m_pCur;
@@ -689,7 +689,7 @@ FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWS }
return m_pCur <= m_pEnd && iLength > 0;
}
-FX_INT32 CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX_BOOL bBrContinue )
+int32_t CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX_BOOL bBrContinue )
{
FX_LPCWSTR pStart = m_pCur;
if (!bBrContinue) {
@@ -698,7 +698,7 @@ FX_INT32 CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX else
while (++m_pCur < m_pEnd && *m_pCur != wch) ;
} else {
- FX_INT32 iBracketCount = 0;
+ int32_t iBracketCount = 0;
if (bWSSeparator) {
while (m_pCur < m_pEnd && *m_pCur != wch && *m_pCur > ' ') {
if (*m_pCur == '(') {
diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.h b/xfa/src/fdp/src/css/fde_cssdatatable.h index 0ebcccfab7..ef8e0fb04e 100644 --- a/xfa/src/fdp/src/css/fde_cssdatatable.h +++ b/xfa/src/fdp/src/css/fde_cssdatatable.h @@ -13,11 +13,11 @@ public: {
FXSYS_assert(pArgList != NULL);
}
- FX_INT32 CountArgs() const
+ int32_t CountArgs() const
{
return m_pArgList->CountValues();
}
- IFDE_CSSValue* GetArgs(FX_INT32 index) const
+ IFDE_CSSValue* GetArgs(int32_t index) const
{
return m_pArgList->GetValue(index);
}
@@ -61,7 +61,7 @@ public: FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_Number && m_eType <= FDE_CSSPRIMITIVETYPE_PC);
return m_fNumber;
}
- virtual FX_LPCWSTR GetString(FX_INT32 &iLength) const
+ virtual FX_LPCWSTR GetString(int32_t &iLength) const
{
FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_String && m_eType <= FDE_CSSPRIMITIVETYPE_URI);
iLength = FXSYS_wcslen(m_pString);
@@ -77,12 +77,12 @@ public: FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function);
return m_pFunction->GetFuncName();
}
- virtual FX_INT32 CountArgs() const
+ virtual int32_t CountArgs() const
{
FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function);
return m_pFunction->CountArgs();
}
- virtual IFDE_CSSValue* GetArgs(FX_INT32 index) const
+ virtual IFDE_CSSValue* GetArgs(int32_t index) const
{
FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function);
return m_pFunction->GetArgs(index);
@@ -103,30 +103,30 @@ class CFDE_CSSValueList : public IFDE_CSSValueList, public CFX_Target {
public:
CFDE_CSSValueList(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list);
- virtual FX_INT32 CountValues() const
+ virtual int32_t CountValues() const
{
return m_iCount;
}
- virtual IFDE_CSSValue* GetValue(FX_INT32 index) const
+ virtual IFDE_CSSValue* GetValue(int32_t index) const
{
return m_ppList[index];
}
protected:
IFDE_CSSValue **m_ppList;
- FX_INT32 m_iCount;
+ int32_t m_iCount;
};
class CFDE_CSSValueListParser : public CFX_Target
{
public:
- CFDE_CSSValueListParser(FX_LPCWSTR psz, FX_INT32 iLen, FX_WCHAR separator)
+ CFDE_CSSValueListParser(FX_LPCWSTR psz, int32_t iLen, FX_WCHAR separator)
: m_Separator(separator), m_pCur(psz), m_pEnd(psz + iLen)
{
FXSYS_assert(psz != NULL && iLen > 0);
}
- FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, FX_INT32 &iLength);
+ FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, int32_t &iLength);
FX_WCHAR m_Separator;
protected:
- FX_INT32 SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator = FALSE, FX_BOOL bBrContinue = FALSE);
+ int32_t SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator = FALSE, FX_BOOL bBrContinue = FALSE);
FX_LPCWSTR m_pCur;
FX_LPCWSTR m_pEnd;
};
@@ -148,7 +148,7 @@ extern "C" { };
typedef FDE_CSSPROPERTYTABLE const * FDE_LPCCSSPROPERTYTABLE;
- FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, FX_INT32 iLength);
+ FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, int32_t iLength);
FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName);
struct FDE_CSSPROPERTYVALUETABLE {
FDE_CSSPROPERTYVALUE eName;
@@ -157,26 +157,26 @@ extern "C" { };
typedef FDE_CSSPROPERTYVALUETABLE const * FDE_LPCCSSPROPERTYVALUETABLE;
- FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, FX_INT32 iLength);
+ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, int32_t iLength);
FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum(FDE_CSSPROPERTYVALUE eName);
struct FDE_CSSMEDIATYPETABLE {
FX_WORD wHash;
FX_WORD wValue;
};
typedef FDE_CSSMEDIATYPETABLE const * FDE_LPCCSSMEDIATYPETABLE;
- FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, FX_INT32 iLength);
+ FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, int32_t iLength);
struct FDE_CSSLENGTHUNITTABLE {
FX_WORD wHash;
FX_WORD wValue;
};
typedef FDE_CSSLENGTHUNITTABLE const * FDE_LPCCSSLENGTHUNITTABLE;
- FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, FX_INT32 iLength);
+ FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, int32_t iLength);
struct FDE_CSSCOLORTABLE {
FX_DWORD dwHash;
FX_ARGB dwValue;
};
typedef FDE_CSSCOLORTABLE const * FDE_LPCCSSCOLORTABLE;
- FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, FX_INT32 iLength);
+ FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, int32_t iLength);
struct FDE_CSSPERSUDOTABLE {
FDE_CSSPERSUDO eName;
FX_LPCWSTR pszName;
@@ -185,10 +185,10 @@ extern "C" { typedef FDE_CSSPERSUDOTABLE const * FDE_LPCCSSPERSUDOTABLE;
FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo);
- FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit);
- FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength);
- FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_ARGB &dwColor);
- FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength);
+ FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, int32_t iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit);
+ FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength);
+ FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, int32_t iValueLen, FX_ARGB &dwColor);
+ FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength);
#ifdef _cplusplus
};
#endif
diff --git a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp index 59f4a44879..9898708539 100644 --- a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp +++ b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp @@ -43,14 +43,14 @@ void CFDE_CSSDeclaration::GetNextCustom(FX_POSITION &pos, CFX_WideString &wsName wsValue = pProperty->pwsValue;
pos = (FX_POSITION)pProperty->pNext;
}
-FX_LPCWSTR CFDE_CSSDeclaration::CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+FX_LPCWSTR CFDE_CSSDeclaration::CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FXSYS_assert(iValueLen > 0);
CFX_MapPtrToPtr *pCache = pArgs->pStringCache;
FX_LPVOID pKey = NULL;
if (pCache) {
FX_LPVOID pszCached = NULL;
- pKey = (FX_LPVOID)(FX_UINTPTR)FX_HashCode_String_GetW(pszValue, iValueLen, FALSE);
+ pKey = (FX_LPVOID)(uintptr_t)FX_HashCode_String_GetW(pszValue, iValueLen, FALSE);
if (pCache->Lookup(pKey, pszCached)) {
return (FX_LPCWSTR)pszCached;
}
@@ -92,7 +92,7 @@ void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MEMAllocator *pStaticStore, FDE_ m_pLastProperty = pHolder;
}
}
-FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FXSYS_assert(iValueLen > 0);
FX_BOOL bImportant = FALSE;
@@ -114,8 +114,8 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST FDE_CSSVALUETYPE_MaybeFunction,
FDE_CSSVALUETYPE_MaybeString,
};
- static const FX_INT32 g_ValueGuessCount = sizeof(g_ValueGuessOrder) / sizeof(FX_DWORD);
- for (FX_INT32 i = 0; i < g_ValueGuessCount; ++i) {
+ static const int32_t g_ValueGuessCount = sizeof(g_ValueGuessOrder) / sizeof(FX_DWORD);
+ for (int32_t i = 0; i < g_ValueGuessCount; ++i) {
const FX_DWORD dwMatch = dwType & g_ValueGuessOrder[i];
if (dwMatch == 0) {
continue;
@@ -229,7 +229,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST }
return FALSE;
}
-FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, FX_INT32 iNameLen, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, int32_t iNameLen, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FDE_LPCSSCUSTOMPROPERTY pProperty = FDE_NewWith(pArgs->pStaticStore) FDE_CSSCUSTOMPROPERTY;
pProperty->pwsName = CopyToLocal(pArgs, pszName, iNameLen);
@@ -243,7 +243,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST }
return TRUE;
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FX_FLOAT fValue;
FDE_CSSPRIMITIVETYPE eUnit;
@@ -252,12 +252,12 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX }
return NewNumberValue(pArgs->pStaticStore, eUnit, fValue);
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FDE_LPCCSSPROPERTYVALUETABLE pValue = FDE_GetCSSPropertyValueByName(pszValue, iValueLen);
return pValue ? NewEnumValue(pArgs->pStaticStore, pValue->eName) : NULL;
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
FX_ARGB dwColor;
if (!FDE_ParseCSSColor(pszValue, iValueLen, dwColor)) {
@@ -265,9 +265,9 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_ }
return FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(dwColor);
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
- FX_INT32 iOffset;
+ int32_t iOffset;
if (!FDE_ParseCSSURI(pszValue, iValueLen, iOffset, iValueLen)) {
return NULL;
}
@@ -277,9 +277,9 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LP pszValue = CopyToLocal(pArgs, pszValue + iOffset, iValueLen);
return pszValue ? FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE_URI, pszValue) : NULL;
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
- FX_INT32 iOffset;
+ int32_t iOffset;
if (!FDE_ParseCSSString(pszValue, iValueLen, iOffset, iValueLen)) {
return NULL;
}
@@ -289,12 +289,12 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX pszValue = CopyToLocal(pArgs, pszValue + iOffset, iValueLen);
return pszValue ? FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE_String, pszValue) : NULL;
}
-IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen)
+IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen)
{
if (pszValue[iValueLen - 1] != ')') {
return NULL;
}
- FX_INT32 iStartBracket = 0;
+ int32_t iStartBracket = 0;
while (pszValue[iStartBracket] != '(') {
if (iStartBracket < iValueLen) {
iStartBracket++;
@@ -343,7 +343,7 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, CFDE_CSSFunction *pFunction = FDE_NewWith(pArgs->pStaticStore) CFDE_CSSFunction(pszFuncName, pArgumentList);
return FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(pFunction);
}
-FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator* pStaticStore = (IFX_MEMAllocator*)pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -400,7 +400,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, pArgs->pProperty->eName, FDE_NewWith(pStaticStore) CFDE_CSSValueList(pStaticStore, list), bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -447,7 +447,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, pArgs->pProperty->eName, FDE_NewWith(pStaticStore) CFDE_CSSValueList(pStaticStore, listFull), bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
FX_WCHAR separator = (pArgs->pProperty->eName == FDE_CSSPROPERTY_FontFamily) ? ',' : ' ';
@@ -557,7 +557,7 @@ FX_BOOL CFDE_CSSDeclaration::Add4ValuesProperty(IFX_MEMAllocator *pStaticStore, }
return FALSE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, FX_INT32 iValueLen, IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const
+FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, int32_t iValueLen, IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const
{
pColor = pStyle = pWidth = NULL;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -645,7 +645,7 @@ void CFDE_CSSDeclaration::AddBorderProperty(IFX_MEMAllocator *pStaticStore, IFDE AddPropertyHolder(pStaticStore, eWidth, pWidth, bImportant);
AddPropertyHolder(pStaticStore, eColor, pColor, bImportant);
}
-FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -718,7 +718,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ListStyleType, pType, bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -844,7 +844,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArg AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_BackgroundAttachment, pAttachment, bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, '/');
@@ -918,7 +918,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_ break;
}
if (eType == FDE_CSSPRIMITIVETYPE_Number) {
- switch ((FX_INT32)fValue) {
+ switch ((int32_t)fValue) {
case 100:
case 200:
case 300:
@@ -971,7 +971,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_ }
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -1058,7 +1058,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArg AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnRuleColor, pColumnRuleColor, bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -1101,7 +1101,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pA }
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
@@ -1150,7 +1150,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnCount, pColumnCount, bImportant);
return TRUE;
}
-FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant)
+FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant)
{
IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
diff --git a/xfa/src/fdp/src/css/fde_cssdeclaration.h b/xfa/src/fdp/src/css/fde_cssdeclaration.h index ca0add9dea..91595d21d9 100644 --- a/xfa/src/fdp/src/css/fde_cssdeclaration.h +++ b/xfa/src/fdp/src/css/fde_cssdeclaration.h @@ -8,8 +8,8 @@ #define _FDE_CSSDECLARATION
#include "fde_cssdatatable.h"
typedef struct _FDE_CSSPROPERTYHOLDER : public CFX_Target {
- FX_INT16 eProperty;
- FX_INT16 bImportant;
+ int16_t eProperty;
+ int16_t bImportant;
IFDE_CSSValue *pValue;
_FDE_CSSPROPERTYHOLDER *pNext;
} FDE_CSSPROPERTYHOLDER, *FDE_LPCSSPROPERTYHOLDER;
@@ -33,32 +33,32 @@ public: virtual void GetNextProperty(FX_POSITION &pos, FDE_CSSPROPERTY &eProperty, IFDE_CSSValue *&pValue, FX_BOOL &bImportant) const;
virtual FX_POSITION GetStartCustom() const;
virtual void GetNextCustom(FX_POSITION &pos, CFX_WideString &wsName, CFX_WideString &wsValue) const;
- FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, FX_INT32 iNameLen, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
+ FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, int32_t iNameLen, FX_LPCWSTR pszValue, int32_t iValueLen);
protected:
- FX_BOOL ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, FX_INT32 iValueLen,
+ FX_BOOL ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, int32_t iValueLen,
IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const;
void AddBorderProperty(IFX_MEMAllocator *pStaticStore, IFDE_CSSValue *pColor, IFDE_CSSValue *pStyle, IFDE_CSSValue *pWidth, FX_BOOL bImportant,
FDE_CSSPROPERTY eColor, FDE_CSSPROPERTY eStyle, FDE_CSSPROPERTY eWidth);
- FX_BOOL ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
- FX_BOOL ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
+ FX_BOOL ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant);
FX_BOOL Add4ValuesProperty(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list, FX_BOOL bImportant,
FDE_CSSPROPERTY eLeft, FDE_CSSPROPERTY eTop, FDE_CSSPROPERTY eRight, FDE_CSSPROPERTY eBottom);
- IFDE_CSSValue* ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- IFDE_CSSValue* ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- IFDE_CSSValue* ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- IFDE_CSSValue* ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- IFDE_CSSValue* ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- IFDE_CSSValue* ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
- FX_LPCWSTR CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen);
+ IFDE_CSSValue* ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ IFDE_CSSValue* ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ IFDE_CSSValue* ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ IFDE_CSSValue* ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ IFDE_CSSValue* ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ IFDE_CSSValue* ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
+ FX_LPCWSTR CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen);
void AddPropertyHolder(IFX_MEMAllocator *pStaticStore, FDE_CSSPROPERTY eProperty, IFDE_CSSValue *pValue, FX_BOOL bImportant);
IFDE_CSSPrimitiveValue* NewNumberValue(IFX_MEMAllocator *pStaticStore, FDE_CSSPRIMITIVETYPE eUnit, FX_FLOAT fValue) const;
IFDE_CSSPrimitiveValue* NewEnumValue(IFX_MEMAllocator *pStaticStore, FDE_CSSPROPERTYVALUE eValue) const;
diff --git a/xfa/src/fdp/src/css/fde_cssstyleselector.cpp b/xfa/src/fdp/src/css/fde_cssstyleselector.cpp index e21bfe007a..e4c8be6409 100644 --- a/xfa/src/fdp/src/css/fde_cssstyleselector.cpp +++ b/xfa/src/fdp/src/css/fde_cssstyleselector.cpp @@ -8,10 +8,10 @@ #include "fde_csscache.h"
#include "fde_cssdeclaration.h"
#include "fde_cssstyleselector.h"
-FX_INT32 CFDE_CSSCounterStyle::FindIndex(FX_LPCWSTR pszIdentifier)
+int32_t CFDE_CSSCounterStyle::FindIndex(FX_LPCWSTR pszIdentifier)
{
- FX_INT32 iCount = m_arrCounterData.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_arrCounterData.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
if (FXSYS_wcscmp(pszIdentifier, m_arrCounterData.ElementAt(i).m_pszIdent) == 0) {
return i;
}
@@ -23,30 +23,30 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList *pList) if (pList == NULL) {
return;
}
- FX_INT32 iCount = pList->CountValues();
+ int32_t iCount = pList->CountValues();
FX_FLOAT fDefValue = 1.0;
FX_BOOL bDefIncrement = TRUE;
if (pList == m_pCounterReset) {
fDefValue = 0.0;
bDefIncrement = FALSE;
}
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
IFDE_CSSValueList *pCounter = (IFDE_CSSValueList*)pList->GetValue(i);
- FX_INT32 iLen;
+ int32_t iLen;
FX_LPCWSTR pszIdentifier = ((IFDE_CSSPrimitiveValue*)(pCounter->GetValue(0)))->GetString(iLen);
FX_FLOAT fValue = fDefValue;
if (pCounter->CountValues() > 1) {
fValue = ((IFDE_CSSPrimitiveValue*)(pCounter->GetValue(1)))->GetFloat();
}
- FX_INT32 iIndex = FindIndex(pszIdentifier);
+ int32_t iIndex = FindIndex(pszIdentifier);
if (iIndex == -1) {
FDE_CSSCOUNTERDATA data;
data.m_pszIdent = pszIdentifier;
if (bDefIncrement) {
data.m_bIncrement = TRUE;
- data.m_iIncVal = (FX_INT32)fValue;
+ data.m_iIncVal = (int32_t)fValue;
} else {
- data.m_iResetVal = (FX_INT32)fValue;
+ data.m_iResetVal = (int32_t)fValue;
data.m_bReset = TRUE;
}
m_arrCounterData.Add(data);
@@ -54,10 +54,10 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList *pList) FDE_CSSCOUNTERDATA &data = m_arrCounterData.ElementAt(iIndex);
if (bDefIncrement) {
data.m_bIncrement = TRUE;
- data.m_iIncVal += (FX_INT32)fValue;
+ data.m_iIncVal += (int32_t)fValue;
} else {
data.m_bReset = TRUE;
- data.m_iResetVal = (FX_INT32)fValue;
+ data.m_iResetVal = (int32_t)fValue;
}
}
}
@@ -107,12 +107,12 @@ void CFDE_CSSRuleCollection::Clear() }
void CFDE_CSSRuleCollection::AddRulesFrom(const CFDE_CSSStyleSheetArray &sheets, FX_DWORD dwMediaList, IFX_FontMgr *pFontMgr)
{
- FX_INT32 iSheets = sheets.GetSize();
- for (FX_INT32 i = 0; i < iSheets; ++i) {
+ int32_t iSheets = sheets.GetSize();
+ for (int32_t i = 0; i < iSheets; ++i) {
IFDE_CSSStyleSheet *pSheet = sheets.GetAt(i);
if (FX_DWORD dwMatchMedia = pSheet->GetMediaList() & dwMediaList) {
- FX_INT32 iRules = pSheet->CountRules();
- for (FX_INT32 j = 0; j < iRules; j++) {
+ int32_t iRules = pSheet->CountRules();
+ for (int32_t j = 0; j < iRules; j++) {
AddRulesFrom(pSheet, pSheet->GetRule(j), dwMatchMedia, pFontMgr);
}
}
@@ -124,8 +124,8 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ case FDE_CSSRULETYPE_Style: {
IFDE_CSSStyleRule *pStyleRule = (IFDE_CSSStyleRule*)pRule;
IFDE_CSSDeclaration *pDeclaration = pStyleRule->GetDeclaration();
- FX_INT32 iSelectors = pStyleRule->CountSelectorLists();
- for (FX_INT32 i = 0; i < iSelectors; ++i) {
+ int32_t iSelectors = pStyleRule->CountSelectorLists();
+ for (int32_t i = 0; i < iSelectors; ++i) {
IFDE_CSSSelector *pSelector = pStyleRule->GetSelectorList(i);
if (pSelector->GetType() == FDE_CSSSELECTORTYPE_Persudo) {
FDE_LPCSSRULEDATA pData = NewRuleData(pSelector, pDeclaration);
@@ -163,8 +163,8 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ case FDE_CSSRULETYPE_Media: {
IFDE_CSSMediaRule *pMediaRule = (IFDE_CSSMediaRule*)pRule;
if (pMediaRule->GetMediaList() & dwMediaList) {
- FX_INT32 iRules = pMediaRule->CountRules();
- for (FX_INT32 i = 0; i < iRules; ++i) {
+ int32_t iRules = pMediaRule->CountRules();
+ for (int32_t i = 0; i < iRules; ++i) {
AddRulesFrom(pStyleSheet, pMediaRule->GetRule(i), dwMediaList, pFontMgr);
}
}
@@ -176,7 +176,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ }
void CFDE_CSSRuleCollection::AddRuleTo(CFX_MapPtrToPtr &map, FX_DWORD dwKey, IFDE_CSSSelector *pSel, IFDE_CSSDeclaration *pDecl)
{
- FX_LPVOID pKey = (FX_LPVOID)(FX_UINTPTR)dwKey;
+ FX_LPVOID pKey = (FX_LPVOID)(uintptr_t)dwKey;
FDE_LPCSSRULEDATA pData = NewRuleData(pSel, pDecl);
FDE_LPCSSRULEDATA pList = NULL;
if (!map.Lookup(pKey, (FX_LPVOID&)pList)) {
@@ -292,7 +292,7 @@ void CFDE_CSSStyleSelector::UpdateStyleIndex(FX_DWORD dwMediaList) Reset();
m_pRuleDataStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 1024, 0);
FXSYS_assert(m_pRuleDataStore != NULL);
- for (FX_INT32 iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) {
+ for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) {
CFDE_CSSRuleCollection &rules = m_RuleCollection[iGroup];
rules.m_pStaticStore = m_pRuleDataStore;
rules.AddRulesFrom(m_SheetGroups[iGroup], dwMediaList, m_pFontMgr);
@@ -300,7 +300,7 @@ void CFDE_CSSStyleSelector::UpdateStyleIndex(FX_DWORD dwMediaList) }
void CFDE_CSSStyleSelector::Reset()
{
- for (FX_INT32 iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) {
+ for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) {
m_RuleCollection[iGroup].Clear();
}
if (m_pRuleDataStore != NULL) {
@@ -308,13 +308,13 @@ void CFDE_CSSStyleSelector::Reset() m_pRuleDataStore = NULL;
}
}
-FX_INT32 CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType)
+int32_t CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType)
{
FXSYS_assert(m_pAccelerator != NULL && pTag != NULL);
FDE_LPCSSTAGCACHE pCache = m_pAccelerator->GetTopElement();
FXSYS_assert(pCache != NULL && pCache->GetTag() == pTag);
matchedDecls.RemoveAt(0, matchedDecls.GetSize());
- for (FX_INT32 ePriority = FDE_CSSSTYLESHEETPRIORITY_MAX - 1; ePriority >= 0; --ePriority) {
+ for (int32_t ePriority = FDE_CSSSTYLESHEETPRIORITY_MAX - 1; ePriority >= 0; --ePriority) {
FDE_CSSSTYLESHEETGROUP eGroup = m_ePriorities[ePriority];
CFDE_CSSRuleCollection &rules = m_RuleCollection[eGroup];
if (rules.CountSelectors() == 0) {
@@ -325,8 +325,8 @@ FX_INT32 CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFD if (pCache->HashTag()) {
MatchRules(pCache, rules.GetTagRuleData(pCache->HashTag()), ePersudoType);
}
- FX_INT32 iCount = pCache->CountHashClass();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = pCache->CountHashClass();
+ for (int32_t i = 0; i < iCount; i++) {
pCache->SetClassIndex(i);
MatchRules(pCache, rules.GetClassRuleData(pCache->HashClass()), ePersudoType);
}
@@ -399,10 +399,10 @@ FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_LPCSSTAGCACHE pCache, IFDE_CSSS }
void CFDE_CSSStyleSelector::SortRulesTo(CFDE_CSSDeclarationArray &matchDecls)
{
- for (FX_INT32 j = m_MatchedRules.GetUpperBound(); j >= 0; --j) {
+ for (int32_t j = m_MatchedRules.GetUpperBound(); j >= 0; --j) {
FDE_LPCSSRULEDATA &pMin = m_MatchedRules.ElementAt(j);
FX_DWORD dwMin = pMin->dwPriority;
- for (FX_INT32 i = j - 1; i >= 0; --i) {
+ for (int32_t i = j - 1; i >= 0; --i) {
FDE_LPCSSRULEDATA &pCur = m_MatchedRules.ElementAt(i);
if (dwMin > pCur->dwPriority) {
dwMin = pCur->dwPriority;
@@ -414,7 +414,7 @@ void CFDE_CSSStyleSelector::SortRulesTo(CFDE_CSSDeclarationArray &matchDecls) matchDecls.Add(pMin->pDeclaration);
}
}
-void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle)
+void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle)
{
CFDE_CSSComputedStyle *pComputedStyle = (CFDE_CSSComputedStyle*)pDestStyle;
FXSYS_assert(pTag && iDeclCount >= 0 && pComputedStyle != NULL);
@@ -464,12 +464,12 @@ void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_C ApplyDeclarations(FALSE, ppDeclArray, iDeclCount, pDestStyle);
}
}
-void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle)
+void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle)
{
CFDE_CSSComputedStyle *pComputedStyle = (CFDE_CSSComputedStyle*)pDestStyle;
IFDE_CSSValue *pVal;
FX_BOOL bImportant;
- FX_INT32 i;
+ int32_t i;
if (bPriority) {
IFDE_CSSValue *pLastest = NULL, *pImportant = NULL;
for (i = 0; i < iDeclCount; ++i) {
@@ -525,7 +525,7 @@ void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSD }
}
}
-void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, FX_INT32 iLen)
+void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, int32_t iLen)
{
FXSYS_assert(pDecl != NULL && psz != NULL && iLen > 0);
IFDE_CSSSyntaxParser *pSyntax = IFDE_CSSSyntaxParser::Create();
@@ -533,7 +533,7 @@ void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPC return;
}
if (pSyntax->Init(psz, iLen, 32, TRUE)) {
- FX_INT32 iLen;
+ int32_t iLen;
FX_LPCWSTR psz;
FDE_CSSPROPERTYARGS args;
args.pStringCache = NULL;
@@ -612,7 +612,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) {
FDE_CSSINHERITS.m_wFontWeight = ToFontWeight(pPrimitive->GetEnum());
} else if (eType == FDE_CSSPRIMITIVETYPE_Number) {
- FX_INT32 iValue = (FX_INT32)pPrimitive->GetFloat() / 100;
+ int32_t iValue = (int32_t)pPrimitive->GetFloat() / 100;
if (iValue >= 1 && iValue <= 9) {
FDE_CSSINHERITS.m_wFontWeight = iValue * 100;
}
@@ -807,12 +807,12 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal break;
case FDE_CSSPROPERTY_Widows:
if (eType == FDE_CSSPRIMITIVETYPE_Number) {
- FDE_CSSINHERITS.m_iWidows = (FX_INT32)pPrimitive->GetFloat();
+ FDE_CSSINHERITS.m_iWidows = (int32_t)pPrimitive->GetFloat();
}
break;
case FDE_CSSPROPERTY_Orphans:
if (eType == FDE_CSSPRIMITIVETYPE_Number) {
- FDE_CSSINHERITS.m_iOrphans = (FX_INT32)pPrimitive->GetFloat();
+ FDE_CSSINHERITS.m_iOrphans = (int32_t)pPrimitive->GetFloat();
}
break;
case FDE_CSSPROPERTY_TextEmphasisColor:
@@ -894,7 +894,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) {
FDE_CSSNONINHERITS.m_pszBKGImage = NULL;
} else if (eType == FDE_CSSPRIMITIVETYPE_URI) {
- FX_INT32 iLength;
+ int32_t iLength;
FDE_CSSNONINHERITS.m_pszBKGImage = pPrimitive->GetString(iLength);
}
break;
@@ -919,7 +919,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) {
FDE_CSSINHERITS.m_pszListStyleImage = NULL;
} else if (eType == FDE_CSSPRIMITIVETYPE_URI) {
- FX_INT32 iLength;
+ int32_t iLength;
FDE_CSSINHERITS.m_pszListStyleImage = pPrimitive->GetString(iLength);
}
break;
@@ -961,7 +961,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal }
} else if (pValue->GetType() == FDE_CSSVALUETYPE_List) {
IFDE_CSSValueList *pList = (IFDE_CSSValueList*)pValue;
- FX_INT32 iCount = pList->CountValues();
+ int32_t iCount = pList->CountValues();
if (iCount > 0) {
switch (eProperty) {
case FDE_CSSPROPERTY_FontFamily:
@@ -991,7 +991,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal FDE_CSSINHERITS.m_pQuotes = pList;
break;
case FDE_CSSPROPERTY_TextCombine: {
- for (FX_INT32 i = 0; i < pList->CountValues(); i++) {
+ for (int32_t i = 0; i < pList->CountValues(); i++) {
IFDE_CSSPrimitiveValue *pVal = (IFDE_CSSPrimitiveValue*)pList->GetValue(i);
switch (pVal->GetPrimitiveType()) {
case FDE_CSSPRIMITIVETYPE_Enum: {
@@ -1023,7 +1023,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal case FDE_CSSPROPERTY_TextEmphasisStyle: {
FDE_CSSTEXTEMPHASISFILL eFill;
FDE_CSSTEXTEMPHASISMARK eMark;
- for (FX_INT32 i = 0; i < pList->CountValues(); i++) {
+ for (int32_t i = 0; i < pList->CountValues(); i++) {
IFDE_CSSPrimitiveValue *pVal = (IFDE_CSSPrimitiveValue*)pList->GetValue(i);
switch (pVal->GetPrimitiveType()) {
case FDE_CSSPRIMITIVETYPE_Enum: {
@@ -1037,7 +1037,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal break;
case FDE_CSSPRIMITIVETYPE_String: {
FDE_CSSINHERITS.m_eTextEmphasisMark = FDE_CSSTEXTEMPHASISMARK_Custom;
- FX_INT32 iLen;
+ int32_t iLen;
FDE_CSSINHERITS.m_pszTextEmphasisCustomMark = pVal->GetString(iLen);
}
break;
@@ -1668,7 +1668,7 @@ FDE_CSSWHITESPACE CFDE_CSSStyleSelector::ToWhiteSpace(FDE_CSSPROPERTYVALUE eValu FX_DWORD CFDE_CSSStyleSelector::ToTextDecoration(IFDE_CSSValueList *pValue)
{
FX_DWORD dwDecoration = 0;
- for (FX_INT32 i = pValue->CountValues() - 1; i >= 0; --i) {
+ for (int32_t i = pValue->CountValues() - 1; i >= 0; --i) {
IFDE_CSSPrimitiveValue *pPrimitive = (IFDE_CSSPrimitiveValue*)pValue->GetValue(i);
if (pPrimitive->GetPrimitiveType() == FDE_CSSPRIMITIVETYPE_Enum) {
switch (pPrimitive->GetEnum()) {
diff --git a/xfa/src/fdp/src/css/fde_cssstyleselector.h b/xfa/src/fdp/src/css/fde_cssstyleselector.h index 4100299664..803522bfb4 100644 --- a/xfa/src/fdp/src/css/fde_cssstyleselector.h +++ b/xfa/src/fdp/src/css/fde_cssstyleselector.h @@ -27,24 +27,24 @@ public: void AddRulesFrom(const CFDE_CSSStyleSheetArray &sheets, FX_DWORD dwMediaList, IFX_FontMgr *pFontMgr);
void Clear();
- FX_INT32 CountSelectors() const
+ int32_t CountSelectors() const
{
return m_iSelectors;
}
FDE_LPCSSRULEDATA GetIDRuleData(FX_DWORD dwIDHash)
{
FX_LPVOID pData;
- return m_IDRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
+ return m_IDRules.Lookup((FX_LPVOID)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
}
FDE_LPCSSRULEDATA GetTagRuleData(FX_DWORD dwTagHasn)
{
FX_LPVOID pData;
- return m_TagRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
+ return m_TagRules.Lookup((FX_LPVOID)(uintptr_t)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
}
FDE_LPCSSRULEDATA GetClassRuleData(FX_DWORD dwIDHash)
{
FX_LPVOID pData;
- return m_ClassRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
+ return m_ClassRules.Lookup((FX_LPVOID)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;
}
FDE_LPCSSRULEDATA GetUniversalRuleData()
{
@@ -65,7 +65,7 @@ protected: CFX_MapPtrToPtr m_ClassRules;
FDE_LPCSSRULEDATA m_pUniversalRules;
FDE_LPCSSRULEDATA m_pPersudoRules;
- FX_INT32 m_iSelectors;
+ int32_t m_iSelectors;
};
class CFDE_CSSAccelerator;
class CFDE_CSSComputedStyle;
@@ -88,15 +88,15 @@ public: virtual void UpdateStyleIndex(FX_DWORD dwMediaList);
virtual IFDE_CSSAccelerator* InitAccelerator();
virtual IFDE_CSSComputedStyle* CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle);
- virtual FX_INT32 MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE);
- virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle);
+ virtual int32_t MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE);
+ virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle);
protected:
void Reset();
void MatchRules(FDE_LPCSSTAGCACHE pCache, FDE_LPCSSRULEDATA pList, FDE_CSSPERSUDO ePersudoType);
void SortRulesTo(CFDE_CSSDeclarationArray &matchDecls);
FX_BOOL MatchSelector(FDE_LPCSSTAGCACHE pCache, IFDE_CSSSelector *pSel, FDE_CSSPERSUDO ePersudoType);
- void AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, FX_INT32 iLen);
- void ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle);
+ void AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, int32_t iLen);
+ void ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle);
void ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSValue *pValue, CFDE_CSSComputedStyle *pComputedStyle);
FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, FX_FLOAT fValue, FX_FLOAT fPercentBase);
@@ -151,12 +151,12 @@ public: {
FX_memset(this, 0, sizeof(_FDE_CSSCOUNTERDATA));
}
- FX_BOOL GetCounterIncrement(FX_INT32 &iValue)
+ FX_BOOL GetCounterIncrement(int32_t &iValue)
{
iValue = m_iIncVal;
return m_bIncrement;
}
- FX_BOOL GetCounterReset(FX_INT32 &iValue)
+ FX_BOOL GetCounterReset(int32_t &iValue)
{
iValue = m_iResetVal;
return m_bReset;
@@ -164,8 +164,8 @@ public: FX_LPCWSTR m_pszIdent;
FX_BOOL m_bIncrement;
FX_BOOL m_bReset;
- FX_INT32 m_iIncVal;
- FX_INT32 m_iResetVal;
+ int32_t m_iIncVal;
+ int32_t m_iResetVal;
} FDE_CSSCOUNTERDATA, *FDE_LPCSSCOUNTERDATA;
class CFDE_CSSCounterStyle
{
@@ -181,22 +181,22 @@ public: m_pCounterReset = pList;
m_bIndexDirty = TRUE;
}
- FX_INT32 CountCounters()
+ int32_t CountCounters()
{
UpdateIndex();
return m_arrCounterData.GetSize();
}
- FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue)
+ FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue)
{
UpdateIndex();
return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue);
}
- FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue)
+ FX_BOOL GetCounterReset(int32_t index, int32_t &iValue)
{
UpdateIndex();
return m_arrCounterData.ElementAt(index).GetCounterReset(iValue);
}
- FX_LPCWSTR GetCounterIdentifier(FX_INT32 index)
+ FX_LPCWSTR GetCounterIdentifier(int32_t index)
{
UpdateIndex();
return m_arrCounterData.ElementAt(index).m_pszIdent;
@@ -204,7 +204,7 @@ public: protected:
void UpdateIndex();
void DoUpdateIndex(IFDE_CSSValueList *pList);
- FX_INT32 FindIndex(FX_LPCWSTR pszIdentifier);
+ int32_t FindIndex(FX_LPCWSTR pszIdentifier);
IFDE_CSSValueList *m_pCounterInc;
IFDE_CSSValueList *m_pCounterReset;
CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData;
@@ -240,8 +240,8 @@ public: FX_ARGB m_dwFontColor;
FX_ARGB m_dwTextEmphasisColor;
FX_WORD m_wFontWeight;
- FX_INT32 m_iWidows;
- FX_INT32 m_iOrphans;
+ int32_t m_iWidows;
+ int32_t m_iOrphans;
FX_LPCWSTR m_pszTextEmphasisCustomMark;
FX_WORD m_eFontVariant : 1;
FX_WORD m_eFontStyle : 1;
@@ -413,7 +413,7 @@ public: }
virtual FX_BOOL GetCustomStyle(FX_WSTR wsName, CFX_WideString &wsValue) const
{
- for (FX_INT32 i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {
+ for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {
if (wsName == m_CustomProperties[i]) {
wsValue = m_CustomProperties[i + 1];
return TRUE;
@@ -445,19 +445,19 @@ public: {
return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide;
}
- virtual FX_INT32 CountCounters()
+ virtual int32_t CountCounters()
{
return (m_NonInheritedData.m_pCounterStyle == NULL) ? 0 : m_NonInheritedData.m_pCounterStyle->CountCounters();
}
- virtual FX_LPCWSTR GetCounterIdentifier(FX_INT32 index)
+ virtual FX_LPCWSTR GetCounterIdentifier(int32_t index)
{
return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index);
}
- virtual FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue)
+ virtual FX_BOOL GetCounterReset(int32_t index, int32_t &iValue)
{
return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue);
}
- virtual FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue)
+ virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue)
{
return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index, iValue);
}
@@ -465,11 +465,11 @@ public: {
return m_NonInheritedData.m_pContentList;
}
- virtual FX_INT32 CountQuotes() const
+ virtual int32_t CountQuotes() const
{
return m_InheritedData.m_pQuotes == NULL ? 0 : m_InheritedData.m_pQuotes->CountValues();
}
- virtual FX_LPCWSTR GetQuotes(FX_INT32 index) const
+ virtual FX_LPCWSTR GetQuotes(int32_t index) const
{
FXSYS_assert(m_InheritedData.m_pQuotes != NULL && m_InheritedData.m_pQuotes->CountValues() > index);
return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue(index)))->GetString(index);
@@ -522,11 +522,11 @@ public: {
m_NonInheritedData.m_ColumnWidth = columnWidth;
}
- virtual FX_INT32 CountFontFamilies() const
+ virtual int32_t CountFontFamilies() const
{
return m_InheritedData.m_pFontFamily ? m_InheritedData.m_pFontFamily->CountValues() : 0;
}
- virtual FX_LPCWSTR GetFontFamily(FX_INT32 index) const
+ virtual FX_LPCWSTR GetFontFamily(int32_t index) const
{
return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue(index)))->GetString(index);
}
@@ -782,7 +782,7 @@ public: {
return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak;
}
- virtual FX_INT32 GetWidows() const
+ virtual int32_t GetWidows() const
{
return m_InheritedData.m_iWidows;
}
@@ -802,7 +802,7 @@ public: {
return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside;
}
- virtual FX_INT32 GetOrphans() const
+ virtual int32_t GetOrphans() const
{
return m_InheritedData.m_iOrphans;
}
@@ -881,7 +881,7 @@ public: {
m_InheritedData.m_eWordBreak = eWordBreak;
}
- virtual void SetWidows(FX_INT32 iWidows)
+ virtual void SetWidows(int32_t iWidows)
{
m_InheritedData.m_iWidows = iWidows;
}
@@ -901,7 +901,7 @@ public: {
m_NonInheritedData.m_ePageBreakInside = ePageBreakInside;
}
- virtual void SetOrphans(FX_INT32 iOrphans)
+ virtual void SetOrphans(int32_t iOrphans)
{
m_InheritedData.m_iOrphans = iOrphans;
}
@@ -949,11 +949,11 @@ public: {
return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY;
}
- virtual FX_INT32 CountCursorUrls() const
+ virtual int32_t CountCursorUrls() const
{
return m_InheritedData.m_pCursorUris == NULL ? 0 : m_InheritedData.m_pCursorUris->CountValues();
}
- virtual FX_LPCWSTR GetCursorUrl(FX_INT32 index) const
+ virtual FX_LPCWSTR GetCursorUrl(int32_t index) const
{
FXSYS_assert(m_InheritedData.m_pCursorUris != NULL);
return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue(index)))->GetString(index);
diff --git a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp index 1ffce6862e..006995a754 100644 --- a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp +++ b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp @@ -35,7 +35,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString &szU }
return pStyleSheet;
}
-IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList )
+IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList )
{
CFDE_CSSStyleSheet *pStyleSheet = FDE_New CFDE_CSSStyleSheet(dwMediaList);
if (pStyleSheet == NULL) {
@@ -61,7 +61,7 @@ CFDE_CSSStyleSheet::~CFDE_CSSStyleSheet() }
void CFDE_CSSStyleSheet::Reset()
{
- for (FX_INT32 i = m_RuleArray.GetSize() - 1; i >= 0; --i) {
+ for (int32_t i = m_RuleArray.GetSize() - 1; i >= 0; --i) {
IFDE_CSSRule *pRule = m_RuleArray.GetAt(i);
switch (pRule->GetType()) {
case FDE_CSSRULETYPE_Style:
@@ -98,11 +98,11 @@ FX_DWORD CFDE_CSSStyleSheet::Release() }
return dwRefCount;
}
-FX_INT32 CFDE_CSSStyleSheet::CountRules() const
+int32_t CFDE_CSSStyleSheet::CountRules() const
{
return m_RuleArray.GetSize();
}
-IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(FX_INT32 index)
+IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(int32_t index)
{
return m_RuleArray.GetAt(index);
}
@@ -122,7 +122,7 @@ FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString &szUrl, IFX_Stre m_szUrl = szUrl;
return bRet;
}
-FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage)
+FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage)
{
FXSYS_assert(pBuffer != NULL && iBufSize > 0);
IFDE_CSSSyntaxParser *pSyntax = IFDE_CSSSyntaxParser::Create();
@@ -175,7 +175,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadMediaRule(IFDE_CSSSyntaxParser *pSyn for (;;) {
switch (pSyntax->DoSyntaxParse()) {
case FDE_CSSSYNTAXSTATUS_MediaType: {
- FX_INT32 iLen;
+ int32_t iLen;
FX_LPCWSTR psz = pSyntax->GetCurrentString(iLen);
FDE_LPCCSSMEDIATYPETABLE pMediaType = FDE_GetCSSMediaTypeByName(psz, iLen);
if (pMediaType != NULL) {
@@ -210,7 +210,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadStyleRule(IFDE_CSSSyntaxParser *pSyn m_Selectors.RemoveAt(0, m_Selectors.GetSize());
CFDE_CSSStyleRule *pStyleRule = NULL;
FX_LPCWSTR pszValue = NULL;
- FX_INT32 iValueLen = 0;
+ int32_t iValueLen = 0;
FDE_CSSPROPERTYARGS propertyArgs;
propertyArgs.pStaticStore = m_pAllocator;
propertyArgs.pStringCache = &m_StringCache;
@@ -270,7 +270,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadFontFaceRule(IFDE_CSSSyntaxParser *p {
CFDE_CSSFontFaceRule *pFontFaceRule = NULL;
FX_LPCWSTR pszValue = NULL;
- FX_INT32 iValueLen = 0;
+ int32_t iValueLen = 0;
FDE_CSSPROPERTYARGS propertyArgs;
propertyArgs.pStaticStore = m_pAllocator;
propertyArgs.pStringCache = &m_StringCache;
@@ -339,13 +339,13 @@ void CFDE_CSSStyleRule::SetSelector(IFX_MEMAllocator *pStaticStore, const CFDE_C FXSYS_assert(m_ppSelector == NULL);
m_iSelectors = list.GetSize();
m_ppSelector = (IFDE_CSSSelector**)pStaticStore->Alloc(m_iSelectors * sizeof(IFDE_CSSSelector*));
- for (FX_INT32 i = 0; i < m_iSelectors; ++i) {
+ for (int32_t i = 0; i < m_iSelectors; ++i) {
m_ppSelector[i] = list.GetAt(i);
}
}
CFDE_CSSMediaRule::~CFDE_CSSMediaRule()
{
- for (FX_INT32 i = m_RuleArray.GetSize() - 1; i >= 0; --i) {
+ for (int32_t i = m_RuleArray.GetSize() - 1; i >= 0; --i) {
IFDE_CSSRule *pRule = m_RuleArray.GetAt(i);
switch (pRule->GetType()) {
case FDE_CSSRULETYPE_Style:
@@ -361,7 +361,7 @@ inline FX_BOOL FDE_IsCSSChar(FX_WCHAR wch) {
return (wch >= 'a' && wch <= 'z') || (wch >= 'A' && wch <= 'Z');
}
-FX_INT32 FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd)
+int32_t FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd)
{
FXSYS_assert(*psz == ':');
FX_LPCWSTR pStart = psz;
@@ -375,7 +375,7 @@ FX_INT32 FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) }
return psz - pStart;
}
-FX_INT32 FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd)
+int32_t FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd)
{
FX_LPCWSTR pStart = psz;
while (psz < pEnd) {
@@ -390,7 +390,7 @@ FX_INT32 FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) }
return psz - pStart;
}
-IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 iLen)
+IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t iLen)
{
FXSYS_assert(pStaticStore != NULL && psz != NULL && iLen > 0);
FX_LPCWSTR pStart = psz;
@@ -420,7 +420,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F pFirst = pLast = p;
}
FXSYS_assert(pLast != NULL);
- FX_INT32 iNameLen = FDE_GetCSSNameLen(++psz, pEnd);
+ int32_t iNameLen = FDE_GetCSSNameLen(++psz, pEnd);
if (iNameLen == 0) {
return NULL;
}
@@ -434,7 +434,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F pLast = p;
psz += iNameLen;
} else if (FDE_IsCSSChar(wch) || wch == '*') {
- FX_INT32 iNameLen = wch == '*' ? 1 : FDE_GetCSSNameLen(psz, pEnd);
+ int32_t iNameLen = wch == '*' ? 1 : FDE_GetCSSNameLen(psz, pEnd);
if (iNameLen == 0) {
return NULL;
}
@@ -451,7 +451,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F }
psz += iNameLen;
} else if (wch == ':') {
- FX_INT32 iNameLen = FDE_GetCSSPersudoLen(psz, pEnd);
+ int32_t iNameLen = FDE_GetCSSPersudoLen(psz, pEnd);
if (iNameLen == 0) {
return NULL;
}
diff --git a/xfa/src/fdp/src/css/fde_cssstylesheet.h b/xfa/src/fdp/src/css/fde_cssstylesheet.h index 04251a0c6b..fea4176171 100644 --- a/xfa/src/fdp/src/css/fde_cssstylesheet.h +++ b/xfa/src/fdp/src/css/fde_cssstylesheet.h @@ -10,7 +10,7 @@ class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target
{
public:
- CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, FX_LPCWSTR psz, FX_INT32 iLen, FX_BOOL bIgnoreCase)
+ CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, FX_LPCWSTR psz, int32_t iLen, FX_BOOL bIgnoreCase)
: m_eType(eType), m_dwHash(FX_HashCode_String_GetW(psz, iLen, bIgnoreCase)), m_pNext(NULL)
{
}
@@ -28,13 +28,13 @@ public: {
return m_pNext;
}
- static IFDE_CSSSelector* FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 iLen);
+ static IFDE_CSSSelector* FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t iLen);
void SetNext(IFDE_CSSSelector *pNext)
{
m_pNext = pNext;
}
protected:
- static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 &iOff, FX_INT32 iLen, FDE_CSSSELECTORTYPE eType);
+ static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t &iOff, int32_t iLen, FDE_CSSSELECTORTYPE eType);
void SetType(FDE_CSSSELECTORTYPE eType)
{
m_eType = eType;
@@ -48,11 +48,11 @@ class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target {
public:
CFDE_CSSStyleRule() : m_ppSelector(NULL), m_iSelectors(0) { }
- virtual FX_INT32 CountSelectorLists() const
+ virtual int32_t CountSelectorLists() const
{
return m_iSelectors;
}
- virtual IFDE_CSSSelector* GetSelectorList(FX_INT32 index) const
+ virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const
{
return m_ppSelector[index];
}
@@ -69,7 +69,7 @@ public: protected:
CFDE_CSSDeclaration m_Declaration;
IFDE_CSSSelector **m_ppSelector;
- FX_INT32 m_iSelectors;
+ int32_t m_iSelectors;
};
class CFDE_CSSMediaRule : public IFDE_CSSMediaRule, public CFX_Target
{
@@ -82,11 +82,11 @@ public: return m_dwMediaList;
}
- virtual FX_INT32 CountRules() const
+ virtual int32_t CountRules() const
{
return m_RuleArray.GetSize();
}
- virtual IFDE_CSSRule* GetRule(FX_INT32 index)
+ virtual IFDE_CSSRule* GetRule(int32_t index)
{
return m_RuleArray.GetAt(index);
}
@@ -138,10 +138,10 @@ public: {
return m_wCodePage;
}
- virtual FX_INT32 CountRules() const;
- virtual IFDE_CSSRule* GetRule(FX_INT32 index);
+ virtual int32_t CountRules() const;
+ virtual IFDE_CSSRule* GetRule(int32_t index);
FX_BOOL LoadFromStream(const CFX_WideString &szUrl, IFX_Stream *pStream, FX_WORD wCodePage);
- FX_BOOL LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage);
+ FX_BOOL LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage);
protected:
void Reset();
FX_BOOL LoadFromSyntax(IFDE_CSSSyntaxParser *pSyntax);
diff --git a/xfa/src/fdp/src/css/fde_csssyntax.cpp b/xfa/src/fdp/src/css/fde_csssyntax.cpp index b7e5da9d6c..f1cb877b32 100644 --- a/xfa/src/fdp/src/css/fde_csssyntax.cpp +++ b/xfa/src/fdp/src/css/fde_csssyntax.cpp @@ -38,20 +38,20 @@ CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() m_TextData.Reset();
m_TextPlane.Reset();
}
-FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize , FX_BOOL bOnlyDeclaration )
+FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize , FX_BOOL bOnlyDeclaration )
{
FXSYS_assert(pStream != NULL && iCSSPlaneSize > 0 && iTextDataSize > 0);
Reset(bOnlyDeclaration);
if (!m_TextData.EstimateSize(iTextDataSize)) {
return FALSE;
}
- FX_BYTE bom[4];
+ uint8_t bom[4];
m_pStream = pStream;
m_iStreamPos = m_pStream->GetBOM(bom);
m_iPlaneSize = iCSSPlaneSize;
return TRUE;
}
-FX_BOOL CFDE_CSSSyntaxParser::Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize , FX_BOOL bOnlyDeclaration )
+FX_BOOL CFDE_CSSSyntaxParser::Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize , FX_BOOL bOnlyDeclaration )
{
FXSYS_assert(pBuffer != NULL && iBufferSize > 0 && iTextDatSize > 0);
Reset(bOnlyDeclaration);
@@ -83,7 +83,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() return m_eStatus = FDE_CSSSYNTAXSTATUS_EOS;
}
FX_BOOL bEOS;
- FX_INT32 iLen = m_TextPlane.LoadFromStream(m_pStream, m_iStreamPos, m_iPlaneSize, bEOS);
+ int32_t iLen = m_TextPlane.LoadFromStream(m_pStream, m_iStreamPos, m_iPlaneSize, bEOS);
m_iStreamPos = m_pStream->GetPosition();
if (iLen < 1) {
if (m_eMode == FDE_CSSSYNTAXMODE_PropertyValue && m_TextData.GetLength() > 0) {
@@ -280,7 +280,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() return m_eStatus = FDE_CSSSYNTAXSTATUS_Error;
}
if (wch <= ' ' || wch == ';') {
- FX_INT32 iURIStart, iURILength = m_TextData.GetLength();
+ int32_t iURIStart, iURILength = m_TextData.GetLength();
if (iURILength > 0 && FDE_ParseCSSURI(m_TextData.GetBuffer(), iURILength, iURIStart, iURILength)) {
m_TextData.Subtract(iURIStart, iURILength);
SwitchMode(FDE_CSSSYNTAXMODE_MediaType);
@@ -298,7 +298,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() if (wch > ' ') {
AppendChar(wch);
} else {
- FX_INT32 iLen = m_TextData.GetLength();
+ int32_t iLen = m_TextData.GetLength();
FX_LPCWSTR psz = m_TextData.GetBuffer();
if (FXSYS_wcsncmp(L"charset", psz, iLen) == 0) {
SwitchMode(FDE_CSSSYNTAXMODE_Charset);
@@ -378,7 +378,7 @@ inline FX_BOOL CFDE_CSSSyntaxParser::AppendChar(FX_WCHAR wch) }
return FALSE;
}
-inline FX_INT32 CFDE_CSSSyntaxParser::SaveTextData()
+inline int32_t CFDE_CSSSyntaxParser::SaveTextData()
{
m_iTextDatLen = m_TextData.TrimEnd();
m_TextData.Clear();
@@ -389,9 +389,9 @@ inline void CFDE_CSSSyntaxParser::SwitchMode(FDE_CSSSYNTAXMODE eMode) m_eMode = eMode;
SaveTextData();
}
-inline FX_INT32 CFDE_CSSSyntaxParser::SwitchToComment()
+inline int32_t CFDE_CSSSyntaxParser::SwitchToComment()
{
- FX_INT32 iLength = m_TextData.GetLength();
+ int32_t iLength = m_TextData.GetLength();
m_ModeStack.Push(m_eMode);
SwitchMode(FDE_CSSSYNTAXMODE_Comment);
return iLength;
@@ -406,7 +406,7 @@ inline FX_BOOL CFDE_CSSSyntaxParser::RestoreMode() m_ModeStack.Pop();
return TRUE;
}
-FX_LPCWSTR CFDE_CSSSyntaxParser::GetCurrentString(FX_INT32 &iLength) const
+FX_LPCWSTR CFDE_CSSSyntaxParser::GetCurrentString(int32_t &iLength) const
{
iLength = m_iTextDatLen;
return m_TextData.GetBuffer();
@@ -431,21 +431,21 @@ void CFDE_CSSTextBuf::Reset() }
m_iDatPos = m_iDatLen = m_iBufLen;
}
-FX_BOOL CFDE_CSSTextBuf::AttachBuffer(FX_LPCWSTR pBuffer, FX_INT32 iBufLen)
+FX_BOOL CFDE_CSSTextBuf::AttachBuffer(FX_LPCWSTR pBuffer, int32_t iBufLen)
{
Reset();
m_pBuffer = (FX_LPWSTR)pBuffer;
m_iDatLen = m_iBufLen = iBufLen;
return m_bExtBuf = TRUE;
}
-FX_BOOL CFDE_CSSTextBuf::EstimateSize(FX_INT32 iAllocSize)
+FX_BOOL CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize)
{
FXSYS_assert(iAllocSize > 0);
Clear();
m_bExtBuf = FALSE;
return ExpandBuf(iAllocSize);
}
-FX_INT32 CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStreamOffset, FX_INT32 iMaxChars, FX_BOOL &bEOS)
+int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, int32_t iStreamOffset, int32_t iMaxChars, FX_BOOL &bEOS)
{
FXSYS_assert(iStreamOffset >= 0 && iMaxChars > 0);
Clear();
@@ -461,7 +461,7 @@ FX_INT32 CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStrea pTxtStream->Unlock();
return m_iDatLen;
}
-FX_BOOL CFDE_CSSTextBuf::ExpandBuf(FX_INT32 iDesiredSize)
+FX_BOOL CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize)
{
if (m_bExtBuf) {
return FALSE;
@@ -480,7 +480,7 @@ FX_BOOL CFDE_CSSTextBuf::ExpandBuf(FX_INT32 iDesiredSize) return TRUE;
}
}
-void CFDE_CSSTextBuf::Subtract(FX_INT32 iStart, FX_INT32 iLength)
+void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength)
{
FXSYS_assert(iStart >= 0 && iLength > 0);
if (iLength > m_iDatLen - iStart) {
diff --git a/xfa/src/fdp/src/css/fde_csssyntax.h b/xfa/src/fdp/src/css/fde_csssyntax.h index c18e0f9717..4ab132d2c8 100644 --- a/xfa/src/fdp/src/css/fde_csssyntax.h +++ b/xfa/src/fdp/src/css/fde_csssyntax.h @@ -11,9 +11,9 @@ class CFDE_CSSTextBuf : public CFX_Target public:
CFDE_CSSTextBuf();
~CFDE_CSSTextBuf();
- FX_BOOL AttachBuffer(FX_LPCWSTR pBuffer, FX_INT32 iBufLen);
- FX_BOOL EstimateSize(FX_INT32 iAllocSize);
- FX_INT32 LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStreamOffset, FX_INT32 iMaxChars, FX_BOOL &bEOS);
+ FX_BOOL AttachBuffer(FX_LPCWSTR pBuffer, int32_t iBufLen);
+ FX_BOOL EstimateSize(int32_t iAllocSize);
+ int32_t LoadFromStream(IFX_Stream *pTxtStream, int32_t iStreamOffset, int32_t iMaxChars, FX_BOOL &bEOS);
FX_BOOL AppendChar(FX_WCHAR wch)
{
if (m_iDatLen >= m_iBufLen && !ExpandBuf(m_iBufLen * 2)) {
@@ -26,7 +26,7 @@ public: m_iDatPos = m_iDatLen = 0;
}
void Reset();
- FX_INT32 TrimEnd()
+ int32_t TrimEnd()
{
while (m_iDatLen > 0 && m_pBuffer[m_iDatLen - 1] <= ' ') {
--m_iDatLen;
@@ -34,12 +34,12 @@ public: AppendChar(0);
return --m_iDatLen;
}
- void Subtract(FX_INT32 iStart, FX_INT32 iLength);
+ void Subtract(int32_t iStart, int32_t iLength);
FX_BOOL IsEOF() const
{
return m_iDatPos >= m_iDatLen;
}
- FX_WCHAR GetAt(FX_INT32 index) const
+ FX_WCHAR GetAt(int32_t index) const
{
return m_pBuffer[index];
}
@@ -55,7 +55,7 @@ public: {
m_iDatPos++;
}
- FX_INT32 GetLength() const
+ int32_t GetLength() const
{
return m_iDatLen;
}
@@ -64,12 +64,12 @@ public: return m_pBuffer;
}
protected:
- FX_BOOL ExpandBuf(FX_INT32 iDesiredSize);
+ FX_BOOL ExpandBuf(int32_t iDesiredSize);
FX_BOOL m_bExtBuf;
FX_LPWSTR m_pBuffer;
- FX_INT32 m_iBufLen;
- FX_INT32 m_iDatLen;
- FX_INT32 m_iDatPos;
+ int32_t m_iBufLen;
+ int32_t m_iDatLen;
+ int32_t m_iDatPos;
};
#define FDE_CSSSYNTAXCHECK_AllowCharset 1
#define FDE_CSSSYNTAXCHECK_AllowImport 2
@@ -96,18 +96,18 @@ public: {
FDE_Delete this;
}
- virtual FX_BOOL Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE);
- virtual FX_BOOL Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE);
+ virtual FX_BOOL Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE);
+ virtual FX_BOOL Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE);
virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse();
- virtual FX_LPCWSTR GetCurrentString(FX_INT32 &iLength) const;
+ virtual FX_LPCWSTR GetCurrentString(int32_t &iLength) const;
protected:
void Reset(FX_BOOL bOnlyDeclaration);
void SwitchMode(FDE_CSSSYNTAXMODE eMode);
- FX_INT32 SwitchToComment();
+ int32_t SwitchToComment();
FX_BOOL RestoreMode();
FX_BOOL AppendChar(FX_WCHAR wch);
- FX_INT32 SaveTextData();
+ int32_t SaveTextData();
FX_BOOL IsCharsetEnabled() const
{
return (m_dwCheck & FDE_CSSSYNTAXCHECK_AllowCharset) != 0;
@@ -122,11 +122,11 @@ protected: m_dwCheck = 0;
}
IFX_Stream *m_pStream;
- FX_INT32 m_iStreamPos;
- FX_INT32 m_iPlaneSize;
+ int32_t m_iStreamPos;
+ int32_t m_iPlaneSize;
CFDE_CSSTextBuf m_TextData;
CFDE_CSSTextBuf m_TextPlane;
- FX_INT32 m_iTextDatLen;
+ int32_t m_iTextDatLen;
FX_DWORD m_dwCheck;
FDE_CSSSYNTAXMODE m_eMode;
FDE_CSSSYNTAXSTATUS m_eStatus;
diff --git a/xfa/src/fdp/src/fde/fde_devbasic.cpp b/xfa/src/fdp/src/fde/fde_devbasic.cpp index 780f1188c8..f6e893ef2e 100644 --- a/xfa/src/fdp/src/fde/fde_devbasic.cpp +++ b/xfa/src/fdp/src/fde/fde_devbasic.cpp @@ -61,7 +61,7 @@ static const FDE_HATCHDATA gs_HatchBitmapData[FDE_HATCHSTYLE_Total] = { {16, 16, {0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,}},
{16, 16, {0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}},
};
-FDE_LPCHATCHDATA FDE_DEVGetHatchData(FX_INT32 iHatchStyle)
+FDE_LPCHATCHDATA FDE_DEVGetHatchData(int32_t iHatchStyle)
{
if (iHatchStyle < FDE_HATCHSTYLE_Min || iHatchStyle > FDE_HATCHSTYLE_Max) {
return NULL;
diff --git a/xfa/src/fdp/src/fde/fde_devbasic.h b/xfa/src/fdp/src/fde/fde_devbasic.h index 36d2471b2c..caf52a9327 100644 --- a/xfa/src/fdp/src/fde/fde_devbasic.h +++ b/xfa/src/fdp/src/fde/fde_devbasic.h @@ -7,10 +7,10 @@ #ifndef _FDE_DEVICE_BASIC_IMP
#define _FDE_DEVICE_BASIC_IMP
struct FDE_HATCHDATA {
- FX_INT32 iWidth;
- FX_INT32 iHeight;
- FX_BYTE MaskBits[64];
+ int32_t iWidth;
+ int32_t iHeight;
+ uint8_t MaskBits[64];
};
typedef FDE_HATCHDATA const * FDE_LPCHATCHDATA;
-FDE_LPCHATCHDATA FDE_DEVGetHatchData(FX_INT32 iHatchStyle);
+FDE_LPCHATCHDATA FDE_DEVGetHatchData(int32_t iHatchStyle);
#endif
diff --git a/xfa/src/fdp/src/fde/fde_gdidevice.cpp b/xfa/src/fdp/src/fde/fde_gdidevice.cpp index ad7f6cc9e5..7f773efd96 100644 --- a/xfa/src/fdp/src/fde/fde_gdidevice.cpp +++ b/xfa/src/fdp/src/fde/fde_gdidevice.cpp @@ -47,11 +47,11 @@ CFDE_GdiDevice::~CFDE_GdiDevice() FDE_Free(m_pGlyphBuf);
}
}
-FX_INT32 CFDE_GdiDevice::GetWidth() const
+int32_t CFDE_GdiDevice::GetWidth() const
{
return m_pBitmap->GetWidth();
}
-FX_INT32 CFDE_GdiDevice::GetHeight() const
+int32_t CFDE_GdiDevice::GetHeight() const
{
return m_pBitmap->GetHeight();
}
@@ -144,7 +144,7 @@ FX_BOOL CFDE_GdiDevice::DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect CFDE_GdiImage img(&bmp);
return DrawImage(&img, pSrcRect, dstRect, pImgMatrix, pDevMatrix);
}
-FX_BOOL CFDE_GdiDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix)
+FX_BOOL CFDE_GdiDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix)
{
FXSYS_assert(pBrush != NULL && pFont != NULL && pCharPos != NULL);
FX_ARGB argb = 0xFF000000;
diff --git a/xfa/src/fdp/src/fde/fde_gdidevice.h b/xfa/src/fdp/src/fde/fde_gdidevice.h index c22ed2b4ba..86f7bac176 100644 --- a/xfa/src/fdp/src/fde/fde_gdidevice.h +++ b/xfa/src/fdp/src/fde/fde_gdidevice.h @@ -20,8 +20,8 @@ public: FDE_Delete this;
}
- virtual FX_INT32 GetWidth() const;
- virtual FX_INT32 GetHeight() const;
+ virtual int32_t GetWidth() const;
+ virtual int32_t GetHeight() const;
virtual FDE_HDEVICESTATE SaveState();
virtual void RestoreState(FDE_HDEVICESTATE hState);
virtual FX_BOOL SetClipPath(const IFDE_Path *pClip);
@@ -34,7 +34,7 @@ public: virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL);
virtual FX_BOOL DrawImage(IFDE_Image *pImg, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL);
- virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL);
+ virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawArc(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, FX_FLOAT startAngle, FX_FLOAT sweepAngle, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawBezier(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_PointF &pt3, const CFX_PointF &pt4, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL);
diff --git a/xfa/src/fdp/src/fde/fde_gedevice.cpp b/xfa/src/fdp/src/fde/fde_gedevice.cpp index 81d7ef5a0c..1ecbb1434b 100644 --- a/xfa/src/fdp/src/fde/fde_gedevice.cpp +++ b/xfa/src/fdp/src/fde/fde_gedevice.cpp @@ -12,7 +12,7 @@ #ifdef _cplusplus
exten "C" {
#endif
- FX_BOOL FDE_GetStockHatchMask(FX_INT32 iHatchStyle, CFX_DIBitmap & hatchMask)
+ FX_BOOL FDE_GetStockHatchMask(int32_t iHatchStyle, CFX_DIBitmap & hatchMask)
{
FDE_LPCHATCHDATA pData = FDE_DEVGetHatchData(iHatchStyle);
if (!pData) {
@@ -63,11 +63,11 @@ CFDE_FxgeDevice::~CFDE_FxgeDevice() delete m_pDevice;
}
}
-FX_INT32 CFDE_FxgeDevice::GetWidth() const
+int32_t CFDE_FxgeDevice::GetWidth() const
{
return m_pDevice->GetWidth();
}
-FX_INT32 CFDE_FxgeDevice::GetHeight() const
+int32_t CFDE_FxgeDevice::GetHeight() const
{
return m_pDevice->GetHeight();
}
@@ -85,8 +85,8 @@ void CFDE_FxgeDevice::RestoreState(FDE_HDEVICESTATE hState) FX_BOOL CFDE_FxgeDevice::SetClipRect(const CFX_RectF &rtClip)
{
m_rtClip = rtClip;
- FX_RECT rt((FX_INT32)FXSYS_floor(rtClip.left), (FX_INT32)FXSYS_floor(rtClip.top),
- (FX_INT32)FXSYS_ceil(rtClip.right()), (FX_INT32)FXSYS_ceil(rtClip.bottom()));
+ FX_RECT rt((int32_t)FXSYS_floor(rtClip.left), (int32_t)FXSYS_floor(rtClip.top),
+ (int32_t)FXSYS_ceil(rtClip.right()), (int32_t)FXSYS_ceil(rtClip.bottom()));
return m_pDevice->SetClip_Rect(&rt);
}
const CFX_RectF& CFDE_FxgeDevice::GetClipRect()
@@ -140,7 +140,7 @@ FX_BOOL CFDE_FxgeDevice::DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRec m_pDevice->CancelDIBits(handle);
return handle != NULL;
}
-FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix)
+FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix)
{
FXSYS_assert(pBrush != NULL && pFont != NULL && pCharPos != NULL && iCount > 0);
CFX_FontCache *pCache = CFX_GEModule::Get()->GetFontCache();
@@ -151,7 +151,7 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F if ((pFont->GetFontStyles() & FX_FONTSTYLE_Italic) != 0 && !pFxFont->IsItalic()) {
FXTEXT_CHARPOS *pCP = (FXTEXT_CHARPOS*)pCharPos;
FX_FLOAT *pAM;
- for (FX_INT32 i = 0; i < iCount; ++i) {
+ for (int32_t i = 0; i < iCount; ++i) {
static const FX_FLOAT mc = 0.267949f;
pAM = pCP->m_AdjustMatrix;
pAM[2] = mc * pAM[0] + pAM[2];
@@ -163,7 +163,7 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F IFX_Font *pCurFont = NULL;
IFX_Font *pSTFont = NULL;
FXTEXT_CHARPOS *pCurCP = NULL;
- FX_INT32 iCurCount = 0;
+ int32_t iCurCount = 0;
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
FX_DWORD dwFontStyle = pFont->GetFontStyles();
CFX_Font FxFont;
@@ -174,8 +174,8 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F SubstFxFont.m_ItalicAngle = dwFontStyle & FX_FONTSTYLE_Italic ? -12 : 0;
SubstFxFont.m_bItlicCJK = dwFontStyle & FX_FONTSTYLE_Italic ? TRUE : FALSE;
#endif
- for (FX_INT32 i = 0; i < iCount; ++i) {
- pSTFont = pFont->GetSubstFont((FX_INT32)pCP->m_GlyphIndex);
+ for (int32_t i = 0; i < iCount; ++i) {
+ pSTFont = pFont->GetSubstFont((int32_t)pCP->m_GlyphIndex);
pCP->m_GlyphIndex &= 0x00FFFFFF;
pCP->m_bFontStyle = FALSE;
if (pCurFont != pSTFont) {
@@ -340,10 +340,10 @@ FX_BOOL CFDE_FxgeDevice::CreatePen(IFDE_Pen *pPen, FX_FLOAT fPenWidth, CFX_Graph pPen->GetDashArray(dashArray);
break;
}
- FX_INT32 iDashCount = dashArray.GetSize();
+ int32_t iDashCount = dashArray.GetSize();
if (iDashCount > 0) {
graphState.SetDashCount(iDashCount);
- for (FX_INT32 i = 0; i < iDashCount; ++i) {
+ for (int32_t i = 0; i < iDashCount; ++i) {
graphState.m_DashArray[i] = dashArray[i] * fPenWidth;
}
}
@@ -365,7 +365,7 @@ FX_BOOL CFDE_FxgeDevice::FillPath(IFDE_Brush *pBrush, const IFDE_Path *pPath, co if (pBrush == NULL) {
return FALSE;
}
- FX_INT32 iType = pBrush->GetType();
+ int32_t iType = pBrush->GetType();
if (iType < 0 || iType > FDE_BRUSHTYPE_MAX) {
return FALSE;
}
@@ -381,7 +381,7 @@ FX_BOOL CFDE_FxgeDevice::FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *p {
FXSYS_assert(pPath && pBrush && pBrush->GetType() == FDE_BRUSHTYPE_Hatch);
IFDE_HatchBrush *pHatchBrush = (IFDE_HatchBrush*)pBrush;
- FX_INT32 iStyle = pHatchBrush->GetHatchStyle();
+ int32_t iStyle = pHatchBrush->GetHatchStyle();
if (iStyle < FDE_HATCHSTYLE_Min || iStyle > FDE_HATCHSTYLE_Max) {
return FALSE;
}
@@ -401,8 +401,8 @@ FX_BOOL CFDE_FxgeDevice::FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *p m_pDevice->StartRendering();
m_pDevice->SetClip_PathFill(pPath, (const CFX_AffineMatrix*)pMatrix, FXFILL_WINDING);
m_pDevice->FillRect(&rect, dwBackColor);
- for (FX_INT32 j = rect.bottom; j < rect.top; j += mask.GetHeight())
- for (FX_INT32 i = rect.left; i < rect.right; i += mask.GetWidth()) {
+ for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight())
+ for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) {
m_pDevice->SetBitMask(&mask, i, j, dwForeColor);
}
m_pDevice->EndRendering();
@@ -430,7 +430,7 @@ FX_BOOL CFDE_FxgeDevice::FillTexturePath(IFDE_Brush *pBrush, const CFX_PathData pImage->StopLoadImage();
return WrapTexture(pTextureBrush->GetWrapMode(), &bmp, pPath, pMatrix);
}
-FX_BOOL CFDE_FxgeDevice::WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix)
+FX_BOOL CFDE_FxgeDevice::WrapTexture(int32_t iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix)
{
CFX_FloatRect rectf = pPath->GetBoundingBox();
if (pMatrix) {
@@ -457,12 +457,12 @@ FX_BOOL CFDE_FxgeDevice::WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBi pFlip[0][1] = bFlipX ? pBitmap->FlipImage(TRUE, FALSE) : pBitmap;
pFlip[1][0] = bFlipY ? pBitmap->FlipImage(FALSE, TRUE) : pBitmap;
pFlip[1][1] = (bFlipX || bFlipY) ? pBitmap->FlipImage(bFlipX, bFlipY) : pBitmap;
- FX_INT32 iCounterY = 0;
- for (FX_INT32 j = rect.top; j < rect.bottom; j += pBitmap->GetHeight()) {
- FX_INT32 indexY = iCounterY++ % 2;
- FX_INT32 iCounterX = 0;
- for (FX_INT32 i = rect.left; i < rect.right; i += pBitmap->GetWidth()) {
- FX_INT32 indexX = iCounterX++ % 2;
+ int32_t iCounterY = 0;
+ for (int32_t j = rect.top; j < rect.bottom; j += pBitmap->GetHeight()) {
+ int32_t indexY = iCounterY++ % 2;
+ int32_t iCounterX = 0;
+ for (int32_t i = rect.left; i < rect.right; i += pBitmap->GetWidth()) {
+ int32_t indexX = iCounterX++ % 2;
m_pDevice->SetDIBits(pFlip[indexY][indexX], i, j);
}
}
@@ -516,7 +516,7 @@ FX_BOOL CFDE_FxgeDevice::FillLinearGradientPath(IFDE_Brush *pBrush, const CFX_Pa CFX_FxgeDevice dev;
dev.Attach(&bmp);
pt1 = pt0;
- FX_INT32 iSteps = FXSYS_round(FXSYS_ceil(fSteps));
+ int32_t iSteps = FXSYS_round(FXSYS_ceil(fSteps));
while (--iSteps >= 0) {
cr0 = ArgbEncode(FXSYS_round(a0), FXSYS_round(r0), FXSYS_round(g0), FXSYS_round(b0));
dev.DrawCosmeticLine(pt0.x, pt0.y, pt1.x, pt1.y, cr0);
diff --git a/xfa/src/fdp/src/fde/fde_gedevice.h b/xfa/src/fdp/src/fde/fde_gedevice.h index 6290e53390..ab16cc7cae 100644 --- a/xfa/src/fdp/src/fde/fde_gedevice.h +++ b/xfa/src/fdp/src/fde/fde_gedevice.h @@ -17,8 +17,8 @@ public: FDE_Delete this;
}
- virtual FX_INT32 GetWidth() const;
- virtual FX_INT32 GetHeight() const;
+ virtual int32_t GetWidth() const;
+ virtual int32_t GetHeight() const;
virtual FDE_HDEVICESTATE SaveState();
virtual void RestoreState(FDE_HDEVICESTATE hState);
virtual FX_BOOL SetClipPath(const IFDE_Path *pClip);
@@ -30,7 +30,7 @@ public: virtual FX_FLOAT GetDpiY() const;
virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL);
- virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL);
+ virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawBezier(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_PointF &pt3, const CFX_PointF &pt4, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL);
virtual FX_BOOL DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL);
@@ -48,16 +48,16 @@ public: FX_BOOL FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);
FX_BOOL FillTexturePath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);
FX_BOOL FillLinearGradientPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);
- FX_BOOL DrawSolidString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);
- FX_BOOL DrawStringPath(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);
+ FX_BOOL DrawSolidString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);
+ FX_BOOL DrawStringPath(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);
protected:
FX_BOOL CreatePen(IFDE_Pen *pPen, FX_FLOAT fPenWidth, CFX_GraphStateData &graphState);
- FX_BOOL WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);
+ FX_BOOL WrapTexture(int32_t iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);
CFX_RenderDevice *m_pDevice;
CFX_RectF m_rtClip;
FX_BOOL m_bOwnerDevice;
FXTEXT_CHARPOS *m_pCharPos;
- FX_INT32 m_iCharCount;
+ int32_t m_iCharCount;
};
#endif
#endif
diff --git a/xfa/src/fdp/src/fde/fde_geobject.cpp b/xfa/src/fdp/src/fde/fde_geobject.cpp index 9f34cf3051..819563619e 100644 --- a/xfa/src/fdp/src/fde/fde_geobject.cpp +++ b/xfa/src/fdp/src/fde/fde_geobject.cpp @@ -24,12 +24,12 @@ FX_BOOL CFDE_Path::CloseFigure() }
return TRUE;
}
-FX_PATHPOINT* CFDE_Path::GetLastPoint(FX_INT32 iCount ) const
+FX_PATHPOINT* CFDE_Path::GetLastPoint(int32_t iCount ) const
{
if (iCount < 1) {
return NULL;
}
- FX_INT32 iPoints = m_Path.GetPointCount();
+ int32_t iPoints = m_Path.GetPointCount();
if (iCount > iPoints) {
return NULL;
}
@@ -40,12 +40,12 @@ FX_BOOL CFDE_Path::FigureClosed() const FX_PATHPOINT *pPoint = GetLastPoint();
return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : TRUE;
}
-FX_PATHPOINT* CFDE_Path::AddPoints(FX_INT32 iCount)
+FX_PATHPOINT* CFDE_Path::AddPoints(int32_t iCount)
{
if (iCount < 1) {
return NULL;
}
- FX_INT32 iPoints = m_Path.GetPointCount();
+ int32_t iPoints = m_Path.GetPointCount();
m_Path.AddPointCount(iCount);
return m_Path.GetPoints() + iPoints;
}
@@ -121,7 +121,7 @@ void CFDE_Path::AddBezier(const CFX_PointsF &points) }
void CFDE_Path::AddBeziers(const CFX_PointsF &points)
{
- FX_INT32 iCount = points.GetSize();
+ int32_t iCount = points.GetSize();
if (iCount < 4) {
return;
}
@@ -134,7 +134,7 @@ void CFDE_Path::AddBeziers(const CFX_PointsF &points) }
void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangents, FX_BOOL bClosed, FX_FLOAT fTension) const
{
- FX_INT32 iCount = points.GetSize();
+ int32_t iCount = points.GetSize();
tangents.SetSize(iCount);
if (iCount < 3) {
return;
@@ -142,9 +142,9 @@ void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangent FX_FLOAT fCoefficient = fTension / 3.0f;
FX_LPCPOINTF pPoints = points.GetData();
FX_LPPOINTF pTangents = tangents.GetData();
- for (FX_INT32 i = 0; i < iCount; ++i) {
- FX_INT32 r = i + 1;
- FX_INT32 s = i - 1;
+ for (int32_t i = 0; i < iCount; ++i) {
+ int32_t r = i + 1;
+ int32_t s = i - 1;
if (r >= iCount) {
r = bClosed ? (r - iCount) : (iCount - 1);
}
@@ -157,7 +157,7 @@ void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangent }
void CFDE_Path::AddCurve(const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension)
{
- FX_INT32 iLast = points.GetUpperBound();
+ int32_t iLast = points.GetUpperBound();
if (iLast < 1) {
return;
}
@@ -166,8 +166,8 @@ void CFDE_Path::AddCurve(const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fT FX_LPCPOINTF pPoints = points.GetData();
FX_LPPOINTF pTangents = tangents.GetData();
MoveTo(pPoints[0]);
- for (FX_INT32 i = 0; i < iLast; ++i) {
- FX_INT32 j = i + 1;
+ for (int32_t i = 0; i < iLast; ++i) {
+ int32_t j = i + 1;
CFX_PointF p1;
p1.Set(pPoints[i].x + pTangents[i].x, pPoints[i].y + pTangents[i].y);
CFX_PointF p2;
@@ -191,7 +191,7 @@ void CFDE_Path::AddEllipse(const CFX_RectF &rect) {
FX_FLOAT fStartAngle = 0;
FX_FLOAT fEndAngle = FX_PI / 2;
- for (FX_INT32 i = 0; i < 4; ++i) {
+ for (int32_t i = 0; i < 4; ++i) {
ArcTo(i == 0, rect, fStartAngle, fEndAngle);
fStartAngle += FX_PI / 2;
fEndAngle += FX_PI / 2;
@@ -212,7 +212,7 @@ void CFDE_Path::AddPath(const IFDE_Path *pSrc, FX_BOOL bConnect) if (pPath == NULL) {
return;
}
- FX_INT32 iCount = pPath->m_Path.GetPointCount();
+ int32_t iCount = pPath->m_Path.GetPointCount();
if (iCount < 1) {
return;
}
@@ -223,7 +223,7 @@ void CFDE_Path::AddPath(const IFDE_Path *pSrc, FX_BOOL bConnect) }
void CFDE_Path::AddPolygon(const CFX_PointsF &points)
{
- FX_INT32 iCount = points.GetSize();
+ int32_t iCount = points.GetSize();
if (iCount < 2) {
return;
}
@@ -236,7 +236,7 @@ void CFDE_Path::AddPolygon(const CFX_PointsF &points) }
void CFDE_Path::AddLines(const CFX_PointsF &points)
{
- FX_INT32 iCount = points.GetSize();
+ int32_t iCount = points.GetSize();
if (iCount < 2) {
return;
}
diff --git a/xfa/src/fdp/src/fde/fde_geobject.h b/xfa/src/fdp/src/fde/fde_geobject.h index 8552b6f7b8..3b1b22901d 100644 --- a/xfa/src/fdp/src/fde/fde_geobject.h +++ b/xfa/src/fdp/src/fde/fde_geobject.h @@ -31,8 +31,8 @@ public: virtual void AddRectangle(const CFX_RectF &rect);
virtual void GetBBox(CFX_RectF &bbox) const;
virtual void GetBBox(CFX_RectF &bbox, FX_FLOAT fLineWidth, FX_FLOAT fMiterLimit) const;
- FX_PATHPOINT* AddPoints(FX_INT32 iCount);
- FX_PATHPOINT* GetLastPoint(FX_INT32 iCount = 1) const;
+ FX_PATHPOINT* AddPoints(int32_t iCount);
+ FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const;
FX_BOOL FigureClosed() const;
void MoveTo(FX_FLOAT fx, FX_FLOAT fy);
void LineTo(FX_FLOAT fx, FX_FLOAT fy);
diff --git a/xfa/src/fdp/src/fde/fde_object.cpp b/xfa/src/fdp/src/fde/fde_object.cpp index d8a555a7bd..71a1b43991 100644 --- a/xfa/src/fdp/src/fde/fde_object.cpp +++ b/xfa/src/fdp/src/fde/fde_object.cpp @@ -10,7 +10,7 @@ IFDE_Pen* IFDE_Pen::Create() {
return FDE_New CFDE_Pen();
}
-IFDE_Brush* IFDE_Brush::Create(FX_INT32 iType)
+IFDE_Brush* IFDE_Brush::Create(int32_t iType)
{
switch (iType) {
case FDE_BRUSHTYPE_Solid:
diff --git a/xfa/src/fdp/src/fde/fde_object.h b/xfa/src/fdp/src/fde/fde_object.h index 553d77fb21..190865f612 100644 --- a/xfa/src/fdp/src/fde/fde_object.h +++ b/xfa/src/fdp/src/fde/fde_object.h @@ -32,7 +32,7 @@ public: FDE_Delete this;
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return m_pBrush ? m_pBrush->GetType() : FDE_PENTYPE_SolidColor;
}
@@ -57,19 +57,19 @@ public: m_Color = ((IFDE_SolidBrush*)m_pBrush)->GetColor();
}
}
- virtual FX_INT32 GetLineCap() const
+ virtual int32_t GetLineCap() const
{
return m_iLineCap;
}
- virtual void SetLineCap(FX_INT32 iLineCap)
+ virtual void SetLineCap(int32_t iLineCap)
{
m_iLineCap = iLineCap;
}
- virtual FX_INT32 GetDashStyle() const
+ virtual int32_t GetDashStyle() const
{
return m_iDashStyle;
}
- virtual void SetDashStyle(FX_INT32 iDashStyle)
+ virtual void SetDashStyle(int32_t iDashStyle)
{
m_iDashStyle = iDashStyle;
}
@@ -81,11 +81,11 @@ public: {
m_fDashPhase = fPhase;
}
- virtual FX_INT32 CountDashArray() const
+ virtual int32_t CountDashArray() const
{
return m_DashArray.GetSize();
}
- virtual FX_INT32 GetDashArray(CFX_FloatArray &dashArray) const
+ virtual int32_t GetDashArray(CFX_FloatArray &dashArray) const
{
dashArray.Copy(m_DashArray);
return dashArray.GetSize();
@@ -94,11 +94,11 @@ public: {
m_DashArray.Copy(dashArray);
}
- virtual FX_INT32 GetLineJoin() const
+ virtual int32_t GetLineJoin() const
{
return m_iLineJoin;
}
- virtual void SetLineJoin(FX_INT32 iLineJoin)
+ virtual void SetLineJoin(int32_t iLineJoin)
{
m_iLineJoin = iLineJoin;
}
@@ -110,7 +110,7 @@ public: {
m_fMiterLimit = fMiterLimit;
}
- virtual FX_INT32 CountCompoundPatterns() const
+ virtual int32_t CountCompoundPatterns() const
{
return m_CompoundPatterns.GetSize();
}
@@ -124,9 +124,9 @@ public: }
FX_ARGB m_Color;
- FX_INT32 m_iLineCap;
- FX_INT32 m_iLineJoin;
- FX_INT32 m_iDashStyle;
+ int32_t m_iLineCap;
+ int32_t m_iLineJoin;
+ int32_t m_iDashStyle;
FX_FLOAT m_fDashPhase;
FX_FLOAT m_fMiterLimit;
FX_BOOL m_bAutoRelease;
@@ -146,7 +146,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FDE_BRUSHTYPE_Solid;
}
@@ -202,7 +202,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FDE_BRUSHTYPE_Hatch;
}
@@ -247,16 +247,16 @@ public: }
}
- virtual FX_INT32 GetHatchStyle() const
+ virtual int32_t GetHatchStyle() const
{
return m_iStyle;
};
- virtual FX_BOOL SetHatchStyle(FX_INT32 iHatchStyle)
+ virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle)
{
m_iStyle = iHatchStyle;
return m_iStyle >= FDE_HATCHSTYLE_Min && m_iStyle <= FDE_HATCHSTYLE_Max;
}
- FX_INT32 m_iStyle;
+ int32_t m_iStyle;
FX_ARGB m_BackColor;
FX_ARGB m_ForeColor;
CFX_Matrix m_Matrix;
@@ -276,7 +276,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FDE_BRUSHTYPE_Texture;
}
@@ -317,15 +317,15 @@ public: m_pImage = pImage;
m_bAutoRelease = bAutoRelease;
}
- virtual FX_INT32 GetWrapMode() const
+ virtual int32_t GetWrapMode() const
{
return m_iWrap;
}
- virtual void SetWrapMode(FX_INT32 iWrapMode)
+ virtual void SetWrapMode(int32_t iWrapMode)
{
m_iWrap = iWrapMode;
}
- FX_INT32 m_iWrap;
+ int32_t m_iWrap;
IFDE_Image *m_pImage;
FX_BOOL m_bAutoRelease;
CFX_Matrix m_Matrix;
@@ -343,7 +343,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FDE_BRUSHTYPE_LinearGradient;
}
@@ -395,7 +395,7 @@ public: m_StartColor = startingColor;
m_EndColor = endingColor;
}
- virtual FX_INT32 CountGradientColors() const
+ virtual int32_t CountGradientColors() const
{
return m_GradColors.GetSize();
}
@@ -408,11 +408,11 @@ public: return m_GradColors.Copy(colors), TRUE;
}
- virtual FX_INT32 GetWrapMode() const
+ virtual int32_t GetWrapMode() const
{
return m_iWrapMode;
}
- virtual void SetWrapMode(FX_INT32 iWrapMode)
+ virtual void SetWrapMode(int32_t iWrapMode)
{
m_iWrapMode = iWrapMode;
}
@@ -421,7 +421,7 @@ public: FX_ARGB m_EndColor;
FX_ARGB m_StartColor;
CFDE_GradientColors m_GradColors;
- FX_INT32 m_iWrapMode;
+ int32_t m_iWrapMode;
CFX_Matrix m_Matrix;
};
#endif
diff --git a/xfa/src/fdp/src/fde/fde_render.cpp b/xfa/src/fdp/src/fde/fde_render.cpp index e8e9149e02..7feca48ab8 100644 --- a/xfa/src/fdp/src/fde/fde_render.cpp +++ b/xfa/src/fdp/src/fde/fde_render.cpp @@ -6,7 +6,7 @@ #include "../../../foxitlib.h"
#include "fde_render.h"
-void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, FX_INT32 iRotate, FX_DWORD dwCoordinatesType)
+void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, int32_t iRotate, FX_DWORD dwCoordinatesType)
{
FXSYS_assert(iRotate >= 0 && iRotate <= 3);
FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0;
@@ -108,7 +108,7 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause *pPause) IFDE_VisualSet *pVisualSet;
FDE_HVISUALOBJ hVisualObj;
CFX_RectF rtObj;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while(TRUE) {
hVisualObj = m_pIterator->GetNext(pVisualSet);
if (hVisualObj == NULL || pVisualSet == NULL) {
@@ -175,7 +175,7 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet *pTextSet, FDE_HVISUALOBJ hText if (pFont == NULL) {
return;
}
- FX_INT32 iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE);
+ int32_t iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE);
if (iCount < 1) {
return;
}
@@ -214,7 +214,7 @@ void CFDE_RenderContext::RenderPath(IFDE_PathSet *pPathSet, FDE_HVISUALOBJ hPath }
FDE_HDEVICESTATE hState;
FX_BOOL bClip = ApplyClip(pPathSet, hPath, hState);
- FX_INT32 iRenderMode = pPathSet->GetRenderMode(hPath);
+ int32_t iRenderMode = pPathSet->GetRenderMode(hPath);
if (iRenderMode & FDE_PATHRENDER_Stroke) {
IFDE_Pen *pPen = pPathSet->GetPen(hPath);
FX_FLOAT fWidth = pPathSet->GetPenWidth(hPath);
diff --git a/xfa/src/fdp/src/fde/fde_render.h b/xfa/src/fdp/src/fde/fde_render.h index 909987a032..6bec3e070f 100644 --- a/xfa/src/fdp/src/fde/fde_render.h +++ b/xfa/src/fdp/src/fde/fde_render.h @@ -36,7 +36,7 @@ protected: IFDE_SolidBrush *m_pSolidBrush;
CFX_Matrix m_Transform;
FXTEXT_CHARPOS *m_pCharPos;
- FX_INT32 m_iCharPosCount;
+ int32_t m_iCharPosCount;
IFDE_VisualSetIterator *m_pIterator;
};
#endif
diff --git a/xfa/src/fdp/src/tto/fde_textout.cpp b/xfa/src/fdp/src/tto/fde_textout.cpp index e03620244f..fa45b3e4d0 100644 --- a/xfa/src/fdp/src/tto/fde_textout.cpp +++ b/xfa/src/fdp/src/tto/fde_textout.cpp @@ -116,7 +116,7 @@ void CFDE_TextOut::SetParagraphBreakChar(FX_WCHAR wch) m_wParagraphBkChar = wch;
m_pTxtBreak->SetParagraphBreakChar(wch);
}
-void CFDE_TextOut::SetAlignment(FX_INT32 iAlignment)
+void CFDE_TextOut::SetAlignment(int32_t iAlignment)
{
m_iAlignment = iAlignment;
switch (m_iAlignment) {
@@ -178,19 +178,19 @@ void CFDE_TextOut::SetLineBreakTolerance(FX_FLOAT fTolerance) m_fTolerance = fTolerance;
m_pTxtBreak->SetLineBreakTolerance(m_fTolerance);
}
-FX_INT32 CFDE_TextOut::GetTotalLines()
+int32_t CFDE_TextOut::GetTotalLines()
{
return m_iTotalLines;
}
-void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size)
+void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size)
{
CFX_RectF rtText;
rtText.Set(0.0f, 0.0f, (FX_FLOAT)size.x, (FX_FLOAT)size.y);
CalcSize(pwsStr, iLength, rtText);
- size.x = (FX_INT32)rtText.Width();
- size.y = (FX_INT32)rtText.Height();
+ size.x = (int32_t)rtText.Width();
+ size.y = (int32_t)rtText.Height();
}
-void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size)
+void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size)
{
CFX_RectF rtText;
rtText.Set(0.0f, 0.0f, size.x, size.y);
@@ -198,14 +198,14 @@ void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size size.x = rtText.Width();
size.y = rtText.Height();
}
-void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect)
+void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect)
{
CFX_RectF rtText;
rtText.Set((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, (FX_FLOAT)rect.Width(), (FX_FLOAT)rect.Height());
CalcSize(pwsStr, iLength, rtText);
- rect.Set((FX_INT32)rtText.left, (FX_INT32)rtText.top, (FX_INT32)rtText.Width(), (FX_INT32)rtText.Height());
+ rect.Set((int32_t)rtText.left, (int32_t)rtText.top, (int32_t)rtText.Width(), (int32_t)rtText.Height());
}
-void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect)
+void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect)
{
if (pwsStr == NULL || iLength < 1) {
rect.width = 0.0f;
@@ -218,7 +218,7 @@ void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect m_Matrix.TransformRect(rect);
}
}
-void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size)
+void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size)
{
CFX_RectF rtText;
rtText.Set(0.0f, 0.0f, size.x, size.y);
@@ -226,7 +226,7 @@ void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF size.x = rtText.Width();
size.y = rtText.Height();
}
-void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect)
+void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect)
{
if (pwsStr == NULL || iLength < 1) {
rect.width = 0.0f;
@@ -235,7 +235,7 @@ void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF CalcTextSize(pwsStr, iLength, rect);
}
}
-void CFDE_TextOut::CalcTextSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect)
+void CFDE_TextOut::CalcTextSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect)
{
FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f);
SetLineWidth(rect);
@@ -321,8 +321,8 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStart FX_FLOAT fLineStep = (m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
FX_BOOL bLineWrap = (m_dwStyles & FDE_TTOSTYLE_LineWrap) ? TRUE : FALSE;
FX_FLOAT fLineWidth = 0.0f;
- FX_INT32 iCount = m_pTxtBreak->CountBreakPieces();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_pTxtBreak->CountBreakPieces();
+ for (int32_t i = 0; i < iCount; i++) {
const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i);
fLineWidth += (FX_FLOAT)pPiece->m_iWidth / 20000.0f;
fStartPos = FX_MIN(fStartPos, (FX_FLOAT)pPiece->m_iStartPos / 20000.0f);
@@ -340,25 +340,25 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStart m_iTotalLines++;
return TRUE;
}
-void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y)
+void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y)
{
CFX_RectF rtText;
rtText.Set((FX_FLOAT)x, (FX_FLOAT)y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f);
DrawText(pwsStr, iLength, rtText);
}
-void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y)
+void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y)
{
CFX_RectF rtText;
rtText.Set(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f);
DrawText(pwsStr, iLength, rtText);
}
-void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect)
+void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect)
{
CFX_RectF rtText;
rtText.Set((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, (FX_FLOAT)rect.width, (FX_FLOAT)rect.height);
DrawText(pwsStr, iLength, rtText);
}
-void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect)
+void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect)
{
CFX_RectF rtText;
rtText.Set(rect.left, rect.top, rect.width, rect.height);
@@ -367,20 +367,20 @@ void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF rm.TransformRect(rtText);
DrawText(pwsStr, iLength, rtText, m_rtClip);
}
-void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y)
+void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y)
{
CFX_RectF rtText;
rtText.Set(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f);
DrawLogicText(pwsStr, iLength, rtText);
}
-void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect)
+void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect)
{
CFX_RectF rtClip;
rtClip.Set(m_rtLogicClip.left, m_rtLogicClip.top, m_rtLogicClip.width, m_rtLogicClip.height);
m_Matrix.TransformRect(rtClip);
DrawText(pwsStr, iLength, rect, rtClip);
}
-void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect, const CFX_RectF &rtClip)
+void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect, const CFX_RectF &rtClip)
{
FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f);
if (pwsStr == NULL || iLength < 1) {
@@ -404,25 +404,25 @@ void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF DoAlignment(rect);
OnDraw(rtClip);
}
-void CFDE_TextOut::ExpandBuffer(FX_INT32 iSize, FX_INT32 iType)
+void CFDE_TextOut::ExpandBuffer(int32_t iSize, int32_t iType)
{
switch (iType) {
case 0:
if (m_pCharWidths == NULL) {
- m_pCharWidths = (FX_INT32*)FDE_Alloc(iSize * sizeof(FX_INT32));
+ m_pCharWidths = (int32_t*)FDE_Alloc(iSize * sizeof(int32_t));
m_iChars = iSize;
} else if (m_iChars < iSize) {
- m_pCharWidths = (FX_INT32*)FDE_Realloc(m_pCharWidths, iSize * sizeof(FX_INT32));
+ m_pCharWidths = (int32_t*)FDE_Realloc(m_pCharWidths, iSize * sizeof(int32_t));
m_iChars = iSize;
}
FXSYS_memset(m_pCharWidths, 0, iSize);
break;
case 1:
if (m_pEllCharWidths == NULL) {
- m_pEllCharWidths = (FX_INT32*)FDE_Alloc(iSize * sizeof(FX_INT32));
+ m_pEllCharWidths = (int32_t*)FDE_Alloc(iSize * sizeof(int32_t));
m_iEllChars = iSize;
} else if (m_iEllChars < iSize) {
- m_pEllCharWidths = (FX_INT32*)FDE_Realloc(m_pEllCharWidths, iSize * sizeof(FX_INT32));
+ m_pEllCharWidths = (int32_t*)FDE_Realloc(m_pEllCharWidths, iSize * sizeof(int32_t));
m_iEllChars = iSize;
}
FXSYS_memset(m_pEllCharWidths, 0, iSize);
@@ -445,13 +445,13 @@ void CFDE_TextOut::LoadEllipsis() }
m_bElliChanged = FALSE;
m_iEllipsisWidth = 0;
- FX_INT32 iLength = m_wsEllipsis.GetLength();
+ int32_t iLength = m_wsEllipsis.GetLength();
if (iLength < 1) {
return;
}
ExpandBuffer(iLength, 1);
FX_LPCWSTR pStr = (FX_LPCWSTR)m_wsEllipsis;
- FX_INT32 *pCharWidths = m_pEllCharWidths;
+ int32_t *pCharWidths = m_pEllCharWidths;
FX_DWORD dwBreakStatus;
FX_WCHAR wch;
while (iLength-- > 0) {
@@ -467,14 +467,14 @@ void CFDE_TextOut::LoadEllipsis() }
m_pTxtBreak->Reset();
}
-void CFDE_TextOut::RetrieveEllPieces(FX_INT32 *&pCharWidths)
+void CFDE_TextOut::RetrieveEllPieces(int32_t *&pCharWidths)
{
- FX_INT32 iCount = m_pTxtBreak->CountBreakPieces();
+ int32_t iCount = m_pTxtBreak->CountBreakPieces();
CFX_Char *pTC;
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i);
- FX_INT32 iPieceChars = pPiece->GetLength();
- for (FX_INT32 j = 0; j < iPieceChars; j++) {
+ int32_t iPieceChars = pPiece->GetLength();
+ for (int32_t j = 0; j < iPieceChars; j++) {
pTC = pPiece->GetCharPtr(j);
if (pTC->m_iCharWidth <= 0) {
*pCharWidths = 0;
@@ -487,10 +487,10 @@ void CFDE_TextOut::RetrieveEllPieces(FX_INT32 *&pCharWidths) }
m_pTxtBreak->ClearBreakPieces();
}
-void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect)
+void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect)
{
FX_LPWSTR pStr = m_wsText.GetBuffer(iLength);
- FX_INT32 iTxtLength = iLength;
+ int32_t iTxtLength = iLength;
ExpandBuffer(iTxtLength, 0);
FX_BOOL bHotKey = (m_dwStyles & FDE_TTOSTYLE_HotKey) ? TRUE : FALSE;
FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE;
@@ -502,9 +502,9 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF fLineStep = -fLineStep;
}
m_hotKeys.RemoveAll();
- FX_INT32 iStartChar = 0;
- FX_INT32 iChars = 0;
- FX_INT32 iPieceWidths = 0;
+ int32_t iStartChar = 0;
+ int32_t iChars = 0;
+ int32_t iPieceWidths = 0;
FX_DWORD dwBreakStatus;
FX_WCHAR wch;
FX_BOOL bRet = FALSE;
@@ -527,7 +527,7 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF m_fLinePos += fLineStep;
}
if ((bVertical && m_fLinePos + fLineStep < fLineStop) || (!bVertical && m_fLinePos + fLineStep > fLineStop)) {
- FX_INT32 iCurLine = m_iCurLine;
+ int32_t iCurLine = m_iCurLine;
if (bEndofLine) {
iCurLine--;
}
@@ -546,7 +546,7 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF m_pTxtBreak->Reset();
m_wsText.ReleaseBuffer(iLength);
}
-FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartChar, FX_INT32 &iPieceWidths, FX_BOOL bReload,
+FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, int32_t &iStartChar, int32_t &iPieceWidths, FX_BOOL bReload,
const CFX_RectF &rect)
{
FX_BOOL bSingleLine = (m_dwStyles & FDE_TTOSTYLE_SingleLine) ? TRUE : FALSE;
@@ -559,17 +559,17 @@ FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartCha CFX_Char *pTC = NULL;
FX_BOOL bNeedReload = FALSE;
FX_FLOAT fLineWidth = bVertical ? rect.Height() : rect.Width();
- FX_INT32 iLineWidth = FXSYS_round(fLineWidth * 20000.0f);
- FX_INT32 iCount = m_pTxtBreak->CountBreakPieces();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iLineWidth = FXSYS_round(fLineWidth * 20000.0f);
+ int32_t iCount = m_pTxtBreak->CountBreakPieces();
+ for (int32_t i = 0; i < iCount; i++) {
const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i);
- FX_INT32 iPieceChars = pPiece->GetLength();
- FX_INT32 iChar = iStartChar;
- FX_INT32 iWidth = 0;
- FX_INT32 j = 0;
+ int32_t iPieceChars = pPiece->GetLength();
+ int32_t iChar = iStartChar;
+ int32_t iWidth = 0;
+ int32_t j = 0;
for (; j < iPieceChars; j++) {
pTC = pPiece->GetCharPtr(j);
- FX_INT32 iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0;
+ int32_t iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0;
if (bSingleLine || !bLineWrap) {
if (iLineWidth - iPieceWidths - iWidth < iCurCharWidth) {
bNeedReload = TRUE;
@@ -624,7 +624,7 @@ void CFDE_TextOut::AppendPiece(const FDE_TTOPIECE &ttoPiece, FX_BOOL bNeedReload pLine->m_bNewReload = bNeedReload;
m_iCurPiece = pLine->AddPiece(m_iCurPiece, ttoPiece);
if (bEnd) {
- FX_INT32 iPieces = pLine->GetSize();
+ int32_t iPieces = pLine->GetSize();
if (m_iCurPiece < iPieces) {
pLine->RemoveLast(iPieces - m_iCurPiece - 1);
}
@@ -637,30 +637,30 @@ void CFDE_TextOut::AppendPiece(const FDE_TTOPIECE &ttoPiece, FX_BOOL bNeedReload void CFDE_TextOut::ReplaceWidthEllipsis()
{
LoadEllipsis();
- FX_INT32 iLength = m_wsEllipsis.GetLength();
+ int32_t iLength = m_wsEllipsis.GetLength();
if (iLength < 1) {
return;
}
- FX_INT32 iLines = m_ttoLines.GetSize();
- for (FX_INT32 i = 0; i < iLines; i++) {
+ int32_t iLines = m_ttoLines.GetSize();
+ for (int32_t i = 0; i < iLines; i++) {
CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i);
if (!pLine->m_bNewReload) {
continue;
}
- FX_INT32 iEllipsisCharIndex = iLength - 1;
- FX_INT32 iCharWidth = 0;
- FX_INT32 iCharCount = 0;
- FX_INT32 iPiece = pLine->GetSize();
+ int32_t iEllipsisCharIndex = iLength - 1;
+ int32_t iCharWidth = 0;
+ int32_t iCharCount = 0;
+ int32_t iPiece = pLine->GetSize();
while (iPiece-- > 0) {
FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(iPiece);
if (pPiece == NULL) {
break;
}
- for (FX_INT32 j = pPiece->iChars - 1; j >= 0; j--) {
+ for (int32_t j = pPiece->iChars - 1; j >= 0; j--) {
if (iEllipsisCharIndex < 0) {
break;
}
- FX_INT32 index = pPiece->iStartChar + j;
+ int32_t index = pPiece->iStartChar + j;
iCharWidth += m_pCharWidths[index];
iCharCount++;
if (iCharCount <= iLength) {
@@ -680,8 +680,8 @@ void CFDE_TextOut::ReplaceWidthEllipsis() }
void CFDE_TextOut::Reload(const CFX_RectF &rect)
{
- FX_INT32 iCount = m_ttoLines.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_ttoLines.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i);
if (pLine == NULL || !pLine->m_bNewReload) {
continue;
@@ -695,17 +695,17 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine *pLine, const CFX_RectF &rect) {
FX_LPCWSTR pwsStr = (FX_LPCWSTR)m_wsText;
FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE;
- FX_INT32 iPieceWidths = 0;
+ int32_t iPieceWidths = 0;
FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(0);
- FX_INT32 iStartChar = pPiece->iStartChar;
+ int32_t iStartChar = pPiece->iStartChar;
m_fLinePos = bVertical ? pPiece->rtPiece.left : pPiece->rtPiece.top;
- FX_INT32 iPieceCount = pLine->GetSize();
- FX_INT32 iPieceIndex = 0;
+ int32_t iPieceCount = pLine->GetSize();
+ int32_t iPieceIndex = 0;
FX_DWORD dwBreakStatus = 0;
FX_WCHAR wch;
while (iPieceIndex < iPieceCount) {
- FX_INT32 iStar = iStartChar;
- FX_INT32 iEnd = pPiece->iChars + iStar;
+ int32_t iStar = iStartChar;
+ int32_t iEnd = pPiece->iChars + iStar;
while (iStar < iEnd) {
wch = *(pwsStr + iStar);
dwBreakStatus = m_pTxtBreak->AppendChar(wch);
@@ -727,7 +727,7 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF &rect) {
FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE;
FX_FLOAT fLineStopS = bVertical ? rect.right() : rect.bottom();
- FX_INT32 iLines = m_ttoLines.GetSize();
+ int32_t iLines = m_ttoLines.GetSize();
if (iLines < 1) {
return;
}
@@ -746,10 +746,10 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF &rect) if (fInc < 1.0f) {
return;
}
- for (FX_INT32 i = 0; i < iLines; i++) {
+ for (int32_t i = 0; i < iLines; i++) {
CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i);
- FX_INT32 iPieces = pLine->GetSize();
- for (FX_INT32 j = 0; j < iPieces; j++) {
+ int32_t iPieces = pLine->GetSize();
+ for (int32_t j = 0; j < iPieces; j++) {
FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(j);
if (bVertical) {
pPiece->rtPiece.left += fInc;
@@ -764,7 +764,7 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) if (m_pRenderDevice == NULL) {
return;
}
- FX_INT32 iLines = m_ttoLines.GetSize();
+ int32_t iLines = m_ttoLines.GetSize();
if (iLines < 1) {
return;
}
@@ -775,15 +775,15 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) if (rtClip.Width() > 0.0f && rtClip.Height() > 0.0f) {
m_pRenderDevice->SetClipRect(rtClip);
}
- for (FX_INT32 i = 0; i < iLines; i++) {
+ for (int32_t i = 0; i < iLines; i++) {
CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i);
- FX_INT32 iPieces = pLine->GetSize();
- for (FX_INT32 j = 0; j < iPieces; j++) {
+ int32_t iPieces = pLine->GetSize();
+ for (int32_t j = 0; j < iPieces; j++) {
FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(j);
if (pPiece == NULL) {
continue;
}
- FX_INT32 iCount = GetDisplayPos(pPiece);
+ int32_t iCount = GetDisplayPos(pPiece);
if (iCount > 0) {
m_pRenderDevice->DrawString(pBrush, m_pFont, m_pCharPos, iCount, m_fFontSize, &m_Matrix);
}
@@ -798,14 +798,14 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) pPen->Release();
}
}
-FX_INT32 CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece)
+int32_t CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece)
{
FX_TXTRUN tr;
ToTextRun(pPiece, tr);
ExpandBuffer(tr.iLength, 2);
return m_pTxtBreak->GetDisplayPos(&tr, m_pCharPos);
}
-FX_INT32 CFDE_TextOut::GetCharRects(FDE_LPTTOPIECE pPiece)
+int32_t CFDE_TextOut::GetCharRects(FDE_LPTTOPIECE pPiece)
{
FX_TXTRUN tr;
ToTextRun(pPiece, tr);
@@ -841,7 +841,7 @@ void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen) pPen->SetColor(m_TxtColor);
}
IFDE_Path *pPath = IFDE_Path::Create();
- FX_INT32 iLineCount = 0;
+ int32_t iLineCount = 0;
CFX_RectF rtText = pPiece->rtPiece;
CFX_PointF pt1, pt2;
if (bUnderLine) {
@@ -875,11 +875,11 @@ void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen) iLineCount++;
}
if (bHotKey) {
- FX_INT32 iHotKeys = m_hotKeys.GetSize();
- FX_INT32 iCount = GetCharRects(pPiece);
+ int32_t iHotKeys = m_hotKeys.GetSize();
+ int32_t iCount = GetCharRects(pPiece);
if (iCount > 0) {
- for (FX_INT32 i = 0; i < iHotKeys; i++) {
- FX_INT32 iCharIndex = m_hotKeys.GetAt(i);
+ for (int32_t i = 0; i < iHotKeys; i++) {
+ int32_t iCharIndex = m_hotKeys.GetAt(i);
if (iCharIndex >= pPiece->iStartChar && iCharIndex < pPiece->iStartChar + pPiece->iChars) {
CFX_RectF rect = m_rectArray.GetAt(iCharIndex - pPiece->iStartChar);
if (bVertical) {
@@ -920,7 +920,7 @@ CFDE_TTOLine::CFDE_TTOLine(const CFDE_TTOLine &ttoLine) CFDE_TTOLine::~CFDE_TTOLine()
{
}
-FX_INT32 CFDE_TTOLine::AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece)
+int32_t CFDE_TTOLine::AddPiece(int32_t index, const FDE_TTOPIECE &ttoPiece)
{
if (index >= m_iPieceCount) {
index = m_pieces.Add(ttoPiece) + 1;
@@ -931,18 +931,18 @@ FX_INT32 CFDE_TTOLine::AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece) }
return index;
}
-FX_INT32 CFDE_TTOLine::GetSize() const
+int32_t CFDE_TTOLine::GetSize() const
{
return m_iPieceCount;
}
-FDE_LPTTOPIECE CFDE_TTOLine::GetPtrAt(FX_INT32 index)
+FDE_LPTTOPIECE CFDE_TTOLine::GetPtrAt(int32_t index)
{
if (index >= m_iPieceCount) {
return NULL;
}
return m_pieces.GetPtrAt(index);
}
-void CFDE_TTOLine::RemoveLast(FX_INT32 iCount)
+void CFDE_TTOLine::RemoveLast(int32_t iCount)
{
m_pieces.RemoveLast(iCount);
}
diff --git a/xfa/src/fdp/src/tto/fde_textout.h b/xfa/src/fdp/src/tto/fde_textout.h index 116ad89d5d..38bc8ebcec 100644 --- a/xfa/src/fdp/src/tto/fde_textout.h +++ b/xfa/src/fdp/src/tto/fde_textout.h @@ -8,8 +8,8 @@ #define _FDE_TEXTOUT_IMP
struct FDE_TTOPIECE {
public:
- FX_INT32 iStartChar;
- FX_INT32 iChars;
+ int32_t iStartChar;
+ int32_t iChars;
FX_DWORD dwCharStyles;
CFX_RectF rtPiece;
};
@@ -21,15 +21,15 @@ public: CFDE_TTOLine();
CFDE_TTOLine(const CFDE_TTOLine &ttoLine);
~CFDE_TTOLine();
- FX_INT32 AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece);
- FX_INT32 GetSize() const;
- FDE_LPTTOPIECE GetPtrAt(FX_INT32 index);
- void RemoveLast(FX_INT32 iCount);
+ int32_t AddPiece(int32_t index, const FDE_TTOPIECE &ttoPiece);
+ int32_t GetSize() const;
+ FDE_LPTTOPIECE GetPtrAt(int32_t index);
+ void RemoveLast(int32_t iCount);
void RemoveAll(FX_BOOL bLeaveMemory);
FX_BOOL m_bNewReload;
CFDE_TTOPieceArray m_pieces;
protected:
- FX_INT32 m_iPieceCount;
+ int32_t m_iPieceCount;
};
typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray;
class CFDE_TextOut : public IFDE_TextOut, public CFX_Target
@@ -48,7 +48,7 @@ public: virtual void SetTabWidth(FX_FLOAT fTabWidth);
virtual void SetEllipsisString(const CFX_WideString &wsEllipsis);
virtual void SetParagraphBreakChar(FX_WCHAR wch);
- virtual void SetAlignment(FX_INT32 iAlignment);
+ virtual void SetAlignment(int32_t iAlignment);
virtual void SetLineSpace(FX_FLOAT fLineSpace);
virtual void SetDIBitmap(CFX_DIBitmap *pDIB);
virtual void SetRenderDevice(CFX_RenderDevice *pDevice);
@@ -56,41 +56,41 @@ public: virtual void SetClipRect(const CFX_RectF &rtClip);
virtual void SetMatrix(const CFX_Matrix &matrix);
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size);
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size);
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect);
- virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect);
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size);
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size);
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect);
+ virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect);
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y);
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y);
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect);
- virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect);
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y);
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y);
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect);
+ virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect);
virtual void SetLogicClipRect(const CFX_RectF &rtClip);
- virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size);
- virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect);
- virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y);
- virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect);
- virtual FX_INT32 GetTotalLines();
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size);
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect);
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y);
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect);
+ virtual int32_t GetTotalLines();
protected:
- void CalcTextSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect);
+ void CalcTextSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect);
FX_BOOL RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStartPos, FX_FLOAT &fWidth, FX_FLOAT &fHeight);
void SetLineWidth(CFX_RectF &rect);
- void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect, const CFX_RectF &rtClip);
- void LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect);
+ void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect, const CFX_RectF &rtClip);
+ void LoadText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect);
void LoadEllipsis();
- void ExpandBuffer(FX_INT32 iSize, FX_INT32 iType);
- void RetrieveEllPieces(FX_INT32 *&pCharWidths);
+ void ExpandBuffer(int32_t iSize, int32_t iType);
+ void RetrieveEllPieces(int32_t *&pCharWidths);
void Reload(const CFX_RectF &rect);
void ReloadLinePiece(CFDE_TTOLine *pLine, const CFX_RectF &rect);
- FX_BOOL RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartChar, FX_INT32 &iPieceWidths, FX_BOOL bReload, const CFX_RectF &rect);
+ FX_BOOL RetriecePieces(FX_DWORD dwBreakStatus, int32_t &iStartChar, int32_t &iPieceWidths, FX_BOOL bReload, const CFX_RectF &rect);
void AppendPiece(const FDE_TTOPIECE &ttoPiece, FX_BOOL bNeedReload, FX_BOOL bEnd);
void ReplaceWidthEllipsis();
void DoAlignment(const CFX_RectF &rect);
void OnDraw(const CFX_RectF &rtClip);
- FX_INT32 GetDisplayPos(FDE_LPTTOPIECE pPiece);
- FX_INT32 GetCharRects(FDE_LPTTOPIECE pPiece);
+ int32_t GetDisplayPos(FDE_LPTTOPIECE pPiece);
+ int32_t GetCharRects(FDE_LPTTOPIECE pPiece);
void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN &tr);
void DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen);
@@ -102,29 +102,29 @@ protected: FX_FLOAT m_fLinePos;
FX_FLOAT m_fTolerance;
- FX_INT32 m_iAlignment;
- FX_INT32 m_iTxtBkAlignment;
- FX_INT32 *m_pCharWidths;
- FX_INT32 m_iChars;
- FX_INT32 *m_pEllCharWidths;
- FX_INT32 m_iEllChars;
+ int32_t m_iAlignment;
+ int32_t m_iTxtBkAlignment;
+ int32_t *m_pCharWidths;
+ int32_t m_iChars;
+ int32_t *m_pEllCharWidths;
+ int32_t m_iEllChars;
FX_WCHAR m_wParagraphBkChar;
FX_ARGB m_TxtColor;
FX_DWORD m_dwStyles;
FX_DWORD m_dwTxtBkStyles;
CFX_WideString m_wsEllipsis;
FX_BOOL m_bElliChanged;
- FX_INT32 m_iEllipsisWidth;
+ int32_t m_iEllipsisWidth;
CFX_WideString m_wsText;
CFX_RectF m_rtClip;
CFX_RectF m_rtLogicClip;
CFX_Matrix m_Matrix;
CFDE_TTOLineArray m_ttoLines;
- FX_INT32 m_iCurLine;
- FX_INT32 m_iCurPiece;
- FX_INT32 m_iTotalLines;
+ int32_t m_iCurLine;
+ int32_t m_iCurPiece;
+ int32_t m_iTotalLines;
FXTEXT_CHARPOS *m_pCharPos;
- FX_INT32 m_iCharPosSize;
+ int32_t m_iCharPosSize;
IFDE_RenderDevice *m_pRenderDevice;
CFX_Int32Array m_hotKeys;
CFX_RectFArray m_rectArray;
diff --git a/xfa/src/fdp/src/xml/fde_xml.cpp b/xfa/src/fdp/src/xml/fde_xml.cpp index f228b69bb1..ab7906b1bc 100644 --- a/xfa/src/fdp/src/xml/fde_xml.cpp +++ b/xfa/src/fdp/src/xml/fde_xml.cpp @@ -13,7 +13,7 @@ extern "C" { static FX_WCHAR g_XMLValidCharRange[FDE_XMLVALIDCHARRANGENUM][2] = {{0x09, 0x09}, {0x0A, 0x0A}, {0x0D, 0x0D}, {0x20, 0xD7FF}, {0xE000, 0xFFFD}};
FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch)
{
- FX_INT32 iStart = 0, iEnd = FDE_XMLVALIDCHARRANGENUM - 1, iMid;
+ int32_t iStart = 0, iEnd = FDE_XMLVALIDCHARRANGENUM - 1, iMid;
while (iStart <= iEnd) {
iMid = (iStart + iEnd) / 2;
if (ch < g_XMLValidCharRange[iMid][0]) {
@@ -45,7 +45,7 @@ static FDE_XMLNAMECHAR g_XMLNameChars[FDE_XMLNAMECHARSNUM] = { };
FX_BOOL FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar)
{
- FX_INT32 iStart = 0, iEnd = FDE_XMLNAMECHARSNUM - 1, iMid;
+ int32_t iStart = 0, iEnd = FDE_XMLNAMECHARSNUM - 1, iMid;
while (iStart <= iEnd) {
iMid = (iStart + iEnd) / 2;
if (ch < g_XMLNameChars[iMid].wStart) {
@@ -85,9 +85,9 @@ void CFDE_XMLNode::DeleteChildren() }
m_pChild = NULL;
}
-FX_INT32 CFDE_XMLNode::CountChildNodes() const
+int32_t CFDE_XMLNode::CountChildNodes() const
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CFDE_XMLNode *pChild = m_pChild;
while (pChild != NULL) {
iCount ++;
@@ -95,7 +95,7 @@ FX_INT32 CFDE_XMLNode::CountChildNodes() const }
return iCount;
}
-CFDE_XMLNode* CFDE_XMLNode::GetChildNode(FX_INT32 index) const
+CFDE_XMLNode* CFDE_XMLNode::GetChildNode(int32_t index) const
{
CFDE_XMLNode *pChild = m_pChild;
while (pChild != NULL) {
@@ -107,9 +107,9 @@ CFDE_XMLNode* CFDE_XMLNode::GetChildNode(FX_INT32 index) const }
return NULL;
}
-FX_INT32 CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const
+int32_t CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const
{
- FX_INT32 index = 0;
+ int32_t index = 0;
CFDE_XMLNode *pChild = m_pChild;
while (pChild != NULL) {
if (pChild == pNode) {
@@ -120,7 +120,7 @@ FX_INT32 CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const }
return -1;
}
-CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, FX_INT32 iLength, FX_BOOL bQualifiedName) const
+CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, int32_t iLength, FX_BOOL bQualifiedName) const
{
FXSYS_assert(pPath != NULL);
if (iLength < 0) {
@@ -177,7 +177,7 @@ CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, FX_INT32 iLength, FX_BOOL }
return pFind->GetPath(pStart, iLength, bQualifiedName);
}
-FX_INT32 CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index)
+int32_t CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, int32_t index)
{
FXSYS_assert(pNode != NULL);
pNode->m_pParent = this;
@@ -193,7 +193,7 @@ FX_INT32 CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index) m_pChild = pNode;
return 0;
}
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CFDE_XMLNode *pFind = m_pChild;
while (++iCount != index && pFind->m_pNext != NULL) {
pFind = pFind->m_pNext;
@@ -320,9 +320,9 @@ CFDE_XMLNode* CFDE_XMLNode::GetNodeItem(IFDE_XMLNode::NodeItem eItem) const }
return NULL;
}
-FX_INT32 CFDE_XMLNode::GetNodeLevel() const
+int32_t CFDE_XMLNode::GetNodeLevel() const
{
- FX_INT32 iLevel = 0;
+ int32_t iLevel = 0;
CFDE_XMLNode *pItem = (CFDE_XMLNode*)this;
while ((pItem = pItem->m_pParent) != NULL) {
iLevel ++;
@@ -409,7 +409,7 @@ void CFDE_XMLNode::SaveXMLNode(IFX_Stream *pXMLStream) ws.Format(L"<?%s", (FX_LPCWSTR)pInstruction->m_wsTarget);
pXMLStream->WriteString(ws, ws.GetLength());
CFX_WideStringArray &attributes = pInstruction->m_Attributes;
- FX_INT32 i, iCount = attributes.GetSize();
+ int32_t i, iCount = attributes.GetSize();
CFX_WideString wsValue;
for (i = 0; i < iCount; i += 2) {
ws = L" ";
@@ -444,9 +444,9 @@ void CFDE_XMLNode::SaveXMLNode(IFX_Stream *pXMLStream) ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
pXMLStream->WriteString(ws, ws.GetLength());
CFX_WideStringArray &attributes = ((CFDE_XMLElement*)pNode)->m_Attributes;
- FX_INT32 iCount = attributes.GetSize();
+ int32_t iCount = attributes.GetSize();
CFX_WideString wsValue;
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ for (int32_t i = 0; i < iCount; i += 2) {
ws = L" ";
ws += attributes[i];
ws += L"=\"";
@@ -542,15 +542,15 @@ CFDE_XMLNode* CFDE_XMLInstruction::Clone(FX_BOOL bRecursive) }
return pClone;
}
-FX_INT32 CFDE_XMLInstruction::CountAttributes() const
+int32_t CFDE_XMLInstruction::CountAttributes() const
{
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLInstruction::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const
+FX_BOOL CFDE_XMLInstruction::GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
+ int32_t iCount = m_Attributes.GetSize();
FXSYS_assert(index > -1 && index < iCount / 2);
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
@@ -562,8 +562,8 @@ FX_BOOL CFDE_XMLInstruction::GetAttribute(FX_INT32 index, CFX_WideString &wsAttr }
FX_BOOL CFDE_XMLInstruction::HasAttribute(FX_LPCWSTR pwsAttriName) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return TRUE;
}
@@ -572,8 +572,8 @@ FX_BOOL CFDE_XMLInstruction::HasAttribute(FX_LPCWSTR pwsAttriName) const }
void CFDE_XMLInstruction::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
wsAttriValue = m_Attributes[i + 1];
return;
@@ -584,8 +584,8 @@ void CFDE_XMLInstruction::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsA void CFDE_XMLInstruction::SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue)
{
FXSYS_assert(wsAttriName.GetLength() > 0);
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(wsAttriName) == 0) {
m_Attributes[i] = wsAttriName;
m_Attributes[i + 1] = wsAttriValue;
@@ -595,17 +595,17 @@ void CFDE_XMLInstruction::SetString(const CFX_WideString &wsAttriName, const CFX m_Attributes.Add(wsAttriName);
m_Attributes.Add(wsAttriValue);
}
-FX_INT32 CFDE_XMLInstruction::GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue) const
+int32_t CFDE_XMLInstruction::GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return FXSYS_wtoi((FX_LPCWSTR)m_Attributes[i + 1]);
}
}
return iDefValue;
}
-void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue)
+void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue)
{
CFX_WideString wsValue;
wsValue.Format(L"%d", iAttriValue);
@@ -613,8 +613,8 @@ void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriVal }
FX_FLOAT CFDE_XMLInstruction::GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return FX_wcstof((FX_LPCWSTR)m_Attributes[i + 1]);
}
@@ -629,8 +629,8 @@ void CFDE_XMLInstruction::SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue }
void CFDE_XMLInstruction::RemoveAttribute(FX_LPCWSTR pwsAttriName)
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
m_Attributes.RemoveAt(i + 1);
m_Attributes.RemoveAt(i);
@@ -638,11 +638,11 @@ void CFDE_XMLInstruction::RemoveAttribute(FX_LPCWSTR pwsAttriName) }
}
}
-FX_INT32 CFDE_XMLInstruction::CountData() const
+int32_t CFDE_XMLInstruction::CountData() const
{
return m_TargetData.GetSize();
}
-FX_BOOL CFDE_XMLInstruction::GetData(FX_INT32 index, CFX_WideString &wsData) const
+FX_BOOL CFDE_XMLInstruction::GetData(int32_t index, CFX_WideString &wsData) const
{
if (index < 0 || index >= m_TargetData.GetSize()) {
return FALSE;
@@ -654,7 +654,7 @@ void CFDE_XMLInstruction::AppendData(const CFX_WideString &wsData) {
m_TargetData.Add(wsData);
}
-void CFDE_XMLInstruction::RemoveData(FX_INT32 index)
+void CFDE_XMLInstruction::RemoveData(int32_t index)
{
m_TargetData.RemoveAt(index);
}
@@ -744,15 +744,15 @@ void CFDE_XMLElement::GetNamespaceURI(CFX_WideString &wsNamespace) const break;
}
}
-FX_INT32 CFDE_XMLElement::CountAttributes() const
+int32_t CFDE_XMLElement::CountAttributes() const
{
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLElement::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const
+FX_BOOL CFDE_XMLElement::GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
+ int32_t iCount = m_Attributes.GetSize();
FXSYS_assert(index > -1 && index < iCount / 2);
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
@@ -764,8 +764,8 @@ FX_BOOL CFDE_XMLElement::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriNam }
FX_BOOL CFDE_XMLElement::HasAttribute(FX_LPCWSTR pwsAttriName) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return TRUE;
}
@@ -774,8 +774,8 @@ FX_BOOL CFDE_XMLElement::HasAttribute(FX_LPCWSTR pwsAttriName) const }
void CFDE_XMLElement::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
wsAttriValue = m_Attributes[i + 1];
return;
@@ -786,8 +786,8 @@ void CFDE_XMLElement::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttri void CFDE_XMLElement::SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue)
{
FXSYS_assert(wsAttriName.GetLength() > 0);
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(wsAttriName) == 0) {
m_Attributes[i] = wsAttriName;
m_Attributes[i + 1] = wsAttriValue;
@@ -797,17 +797,17 @@ void CFDE_XMLElement::SetString(const CFX_WideString &wsAttriName, const CFX_Wid m_Attributes.Add(wsAttriName);
m_Attributes.Add(wsAttriValue);
}
-FX_INT32 CFDE_XMLElement::GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue) const
+int32_t CFDE_XMLElement::GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return FXSYS_wtoi((FX_LPCWSTR)m_Attributes[i + 1]);
}
}
return iDefValue;
}
-void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue)
+void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue)
{
CFX_WideString wsValue;
wsValue.Format(L"%d", iAttriValue);
@@ -815,8 +815,8 @@ void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) }
FX_FLOAT CFDE_XMLElement::GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue) const
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
return FX_wcstof((FX_LPCWSTR)m_Attributes[i + 1]);
}
@@ -831,8 +831,8 @@ void CFDE_XMLElement::SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) }
void CFDE_XMLElement::RemoveAttribute(FX_LPCWSTR pwsAttriName)
{
- FX_INT32 iCount = m_Attributes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ int32_t iCount = m_Attributes.GetSize();
+ for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
m_Attributes.RemoveAt(i + 1);
m_Attributes.RemoveAt(i);
@@ -940,7 +940,7 @@ void CFDE_XMLDoc::ReleaseParser() m_pSyntaxParser = NULL;
}
}
-FX_BOOL CFDE_XMLDoc::LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize , FX_INT32 iTextDataSize , FDE_LPXMLREADERHANDLER pHandler )
+FX_BOOL CFDE_XMLDoc::LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize , int32_t iTextDataSize , FDE_LPXMLREADERHANDLER pHandler )
{
if (pXMLStream == NULL) {
return FALSE;
@@ -988,7 +988,7 @@ FX_BOOL CFDE_XMLDoc::LoadXML(IFDE_XMLParser *pXMLParser) m_pXMLParser = pXMLParser;
return m_pXMLParser != NULL;
}
-FX_INT32 CFDE_XMLDoc::DoLoad(IFX_Pause *pPause)
+int32_t CFDE_XMLDoc::DoLoad(IFX_Pause *pPause)
{
if (m_iStatus >= 100) {
return m_iStatus;
@@ -1024,7 +1024,7 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pINode) ws.Format(L"<?%s", (FX_LPCWSTR)pInstruction->m_wsTarget);
pXMLStream->WriteString(ws, ws.GetLength());
CFX_WideStringArray &attributes = pInstruction->m_Attributes;
- FX_INT32 i, iCount = attributes.GetSize();
+ int32_t i, iCount = attributes.GetSize();
CFX_WideString wsValue;
for (i = 0; i < iCount; i += 2) {
ws = L" ";
@@ -1059,9 +1059,9 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pINode) ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
pXMLStream->WriteString(ws, ws.GetLength());
CFX_WideStringArray &attributes = ((CFDE_XMLElement*)pNode)->m_Attributes;
- FX_INT32 iCount = attributes.GetSize();
+ int32_t iCount = attributes.GetSize();
CFX_WideString wsValue;
- for (FX_INT32 i = 0; i < iCount; i += 2) {
+ for (int32_t i = 0; i < iCount; i += 2) {
ws = L" ";
ws += attributes[i];
ws += L"=\"";
@@ -1138,7 +1138,7 @@ void CFDE_XMLDoc::SaveXML(IFX_Stream *pXMLStream, FX_BOOL bSaveBOM) pNode = pNode->m_pNext;
}
if (pXMLStream == m_pStream) {
- FX_INT32 iPos = pXMLStream->GetPosition();
+ int32_t iPos = pXMLStream->GetPosition();
pXMLStream->SetLength(iPos);
}
}
@@ -1159,10 +1159,10 @@ CFDE_XMLDOMParser::~CFDE_XMLDOMParser() m_ws1.Empty();
m_ws2.Empty();
}
-FX_INT32 CFDE_XMLDOMParser::DoParser(IFX_Pause *pPause)
+int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause *pPause)
{
FX_DWORD dwRet;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (TRUE) {
dwRet = m_pParser->DoSyntaxParse();
switch (dwRet) {
@@ -1278,10 +1278,10 @@ CFDE_XMLSAXParser::~CFDE_XMLSAXParser() m_ws1.Empty();
m_ws2.Empty();
}
-FX_INT32 CFDE_XMLSAXParser::DoParser(IFX_Pause *pPause)
+int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause *pPause)
{
FX_DWORD dwRet = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (TRUE) {
dwRet = m_pParser->DoSyntaxParse();
switch (dwRet) {
@@ -1379,7 +1379,7 @@ inline void CFDE_XMLSAXParser::Pop() m_pTagTop = m_TagStack.GetTopElement();
}
#ifdef _FDE_BLOCK_BUFFER
-CFDE_BlockBuffer::CFDE_BlockBuffer(FX_INT32 iAllocStep)
+CFDE_BlockBuffer::CFDE_BlockBuffer(int32_t iAllocStep)
: m_iAllocStep(iAllocStep),
m_iStartPosition(0),
m_iBufferSize(0),
@@ -1390,14 +1390,14 @@ CFDE_BlockBuffer::~CFDE_BlockBuffer() {
ClearBuffer();
}
-FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(FX_INT32& iIndexInBlock)
+FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(int32_t& iIndexInBlock)
{
iIndexInBlock = 0;
- FX_INT32 iBlockNum = m_BlockArray.GetSize();
+ int32_t iBlockNum = m_BlockArray.GetSize();
if (iBlockNum == 0) {
return NULL;
}
- FX_INT32 iRealIndex = m_iStartPosition + m_iDataLength;
+ int32_t iRealIndex = m_iStartPosition + m_iDataLength;
FX_LPWSTR pDataBlock = NULL;
if(iRealIndex == m_iBufferSize) {
FX_LPWSTR pBlock = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR));
@@ -1408,18 +1408,18 @@ FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(FX_INT32& iIndexInBlock) iIndexInBlock = 0;
pDataBlock = pBlock;
} else {
- FX_INT32 iBlockIndex = iRealIndex / m_iAllocStep;
- FX_INT32 iInnerIndex = iRealIndex % m_iAllocStep;
+ int32_t iBlockIndex = iRealIndex / m_iAllocStep;
+ int32_t iInnerIndex = iRealIndex % m_iAllocStep;
iIndexInBlock = iInnerIndex;
pDataBlock = (FX_LPWSTR)m_BlockArray[iBlockIndex];
}
return pDataBlock;
}
-FX_BOOL CFDE_BlockBuffer::InitBuffer(FX_INT32 iBufferSize)
+FX_BOOL CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize)
{
ClearBuffer();
- FX_INT32 iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1;
- for (FX_INT32 i = 0; i < iNumOfBlock; i++) {
+ int32_t iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1;
+ for (int32_t i = 0; i < iNumOfBlock; i++) {
FX_LPWSTR pBlockBuffer = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR));
if (pBlockBuffer == NULL) {
ClearBuffer();
@@ -1430,17 +1430,17 @@ FX_BOOL CFDE_BlockBuffer::InitBuffer(FX_INT32 iBufferSize) m_iBufferSize = iNumOfBlock * m_iAllocStep;
return TRUE;
}
-void CFDE_BlockBuffer::SetTextChar(FX_INT32 iIndex, FX_WCHAR ch)
+void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch)
{
if (iIndex < 0) {
return;
}
- FX_INT32 iRealIndex = m_iStartPosition + iIndex;
- FX_INT32 iBlockIndex = iRealIndex / m_iAllocStep;
- FX_INT32 iInnerIndex = iRealIndex % m_iAllocStep;
- FX_INT32 iBlockSize = m_BlockArray.GetSize();
+ int32_t iRealIndex = m_iStartPosition + iIndex;
+ int32_t iBlockIndex = iRealIndex / m_iAllocStep;
+ int32_t iInnerIndex = iRealIndex % m_iAllocStep;
+ int32_t iBlockSize = m_BlockArray.GetSize();
if (iBlockIndex >= iBlockSize) {
- FX_INT32 iNewBlocks = iBlockIndex - iBlockSize + 1;
+ int32_t iNewBlocks = iBlockIndex - iBlockSize + 1;
do {
FX_LPWSTR pBlock = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR));
if (!pBlock) {
@@ -1456,7 +1456,7 @@ void CFDE_BlockBuffer::SetTextChar(FX_INT32 iIndex, FX_WCHAR ch) m_iDataLength = iIndex + 1;
}
}
-FX_INT32 CFDE_BlockBuffer::DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection )
+int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, FX_BOOL bDirection )
{
if (iCount <= 0) {
return m_iDataLength;
@@ -1473,10 +1473,10 @@ FX_INT32 CFDE_BlockBuffer::DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection ) }
return m_iDataLength;
}
-void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, FX_INT32 iLength) const
+void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, int32_t iStart, int32_t iLength) const
{
wsTextData.Empty();
- FX_INT32 iMaybeDataLength = m_iBufferSize - 1 - m_iStartPosition;
+ int32_t iMaybeDataLength = m_iBufferSize - 1 - m_iStartPosition;
if (iStart < 0 || iStart > iMaybeDataLength) {
return;
}
@@ -1490,16 +1490,16 @@ void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, if (!pBuf) {
return;
}
- FX_INT32 iStartBlockIndex = 0;
- FX_INT32 iStartInnerIndex = 0;
+ int32_t iStartBlockIndex = 0;
+ int32_t iStartInnerIndex = 0;
TextDataIndex2BufIndex(iStart, iStartBlockIndex, iStartInnerIndex);
- FX_INT32 iEndBlockIndex = 0;
- FX_INT32 iEndInnerIndex = 0;
+ int32_t iEndBlockIndex = 0;
+ int32_t iEndInnerIndex = 0;
TextDataIndex2BufIndex(iStart + iLength, iEndBlockIndex, iEndInnerIndex);
- FX_INT32 iPointer = 0;
- for (FX_INT32 i = iStartBlockIndex; i <= iEndBlockIndex; i++) {
- FX_INT32 iBufferPointer = 0;
- FX_INT32 iCopyLength = m_iAllocStep;
+ int32_t iPointer = 0;
+ for (int32_t i = iStartBlockIndex; i <= iEndBlockIndex; i++) {
+ int32_t iBufferPointer = 0;
+ int32_t iCopyLength = m_iAllocStep;
if (i == iStartBlockIndex) {
iCopyLength -= iStartInnerIndex;
iBufferPointer = iStartInnerIndex;
@@ -1513,18 +1513,18 @@ void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, }
wsTextData.ReleaseBuffer(iLength);
}
-void CFDE_BlockBuffer::TextDataIndex2BufIndex(const FX_INT32 iIndex, FX_INT32& iBlockIndex, FX_INT32& iInnerIndex) const
+void CFDE_BlockBuffer::TextDataIndex2BufIndex(const int32_t iIndex, int32_t& iBlockIndex, int32_t& iInnerIndex) const
{
FXSYS_assert(iIndex >= 0);
- FX_INT32 iRealIndex = m_iStartPosition + iIndex;
+ int32_t iRealIndex = m_iStartPosition + iIndex;
iBlockIndex = iRealIndex / m_iAllocStep;
iInnerIndex = iRealIndex % m_iAllocStep;
}
void CFDE_BlockBuffer::ClearBuffer()
{
m_iBufferSize = 0;
- FX_INT32 iSize = m_BlockArray.GetSize();
- for (FX_INT32 i = 0; i < iSize; i++) {
+ int32_t iSize = m_BlockArray.GetSize();
+ for (int32_t i = 0; i < iSize; i++) {
FDE_Free(m_BlockArray[i]);
m_BlockArray[i] = NULL;
}
@@ -1565,15 +1565,15 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser() m_CurNode.iNodeNum = -1;
m_CurNode.eNodeType = FDE_XMLNODE_Unknown;
}
-void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize )
+void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize )
{
FXSYS_assert(m_pStream == NULL && m_pBuffer == NULL);
FXSYS_assert(pStream != NULL && iXMLPlaneSize > 0);
- FX_INT32 iStreamLength = pStream->GetLength();
+ int32_t iStreamLength = pStream->GetLength();
FXSYS_assert(iStreamLength > 0);
m_pStream = pStream;
m_iXMLPlaneSize = FX_MIN(iXMLPlaneSize, iStreamLength);
- FX_BYTE bom[4];
+ uint8_t bom[4];
m_iCurrentPos = m_pStream->GetBOM(bom);
FXSYS_assert(m_pBuffer == NULL);
m_pBuffer = (FX_LPWSTR)FDE_Alloc(m_iXMLPlaneSize * sizeof(FX_WCHAR));
@@ -1590,8 +1590,8 @@ FX_DWORD CFDE_XMLSyntaxParser::DoSyntaxParse() return m_dwStatus;
}
FXSYS_assert(m_pStream != NULL && m_pBuffer != NULL && m_BlockBuffer.IsInitialized());
- FX_INT32 iStreamLength = m_pStream->GetLength();
- FX_INT32 iPos;
+ int32_t iStreamLength = m_pStream->GetLength();
+ int32_t iPos;
FX_WCHAR ch;
FX_DWORD dwStatus = FDE_XMLSYNTAXSTATUS_None;
while (TRUE) {
@@ -2066,16 +2066,16 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser() m_CurNode.iNodeNum = -1;
m_CurNode.eNodeType = FDE_XMLNODE_Unknown;
}
-void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize )
+void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize )
{
FXSYS_assert(m_pStream == NULL && m_pBuffer == NULL);
FXSYS_assert(pStream != NULL && iXMLPlaneSize > 0 && iTextDataSize > 0);
- FX_INT32 iStreamLength = pStream->GetLength();
+ int32_t iStreamLength = pStream->GetLength();
FXSYS_assert(iStreamLength > 0);
m_pStream = pStream;
m_iXMLPlaneSize = FX_MIN(iXMLPlaneSize, iStreamLength);
m_iTextDataSize = iTextDataSize;
- FX_BYTE bom[4];
+ uint8_t bom[4];
m_iCurrentPos = m_pStream->GetBOM(bom);
FXSYS_assert(m_pBuffer == NULL);
m_pBuffer = (FX_LPWSTR)FDE_Alloc(m_iXMLPlaneSize * sizeof(FX_WCHAR));
@@ -2091,8 +2091,8 @@ FX_DWORD CFDE_XMLSyntaxParser::DoSyntaxParse() return m_dwStatus;
}
FXSYS_assert(m_pStream != NULL && m_pBuffer != NULL && m_pwsTextData != NULL);
- FX_INT32 iStreamLength = m_pStream->GetLength();
- FX_INT32 iPos;
+ int32_t iStreamLength = m_pStream->GetLength();
+ int32_t iPos;
FX_WCHAR ch;
FX_DWORD dwStatus = FDE_XMLSYNTAXSTATUS_None;
while (TRUE) {
@@ -2506,12 +2506,12 @@ CFDE_XMLSyntaxParser::~CFDE_XMLSyntaxParser() FDE_Free(m_pBuffer);
}
}
-FX_INT32 CFDE_XMLSyntaxParser::GetStatus() const
+int32_t CFDE_XMLSyntaxParser::GetStatus() const
{
if (m_pStream == NULL) {
return -1;
}
- FX_INT32 iStreamLength = m_pStream->GetLength();
+ int32_t iStreamLength = m_pStream->GetLength();
if (iStreamLength < 1) {
return 100;
}
@@ -2523,10 +2523,10 @@ FX_INT32 CFDE_XMLSyntaxParser::GetStatus() const }
return m_iParsedBytes * 100 / iStreamLength;
}
-static FX_INT32 FX_GetUTF8EncodeLength(FX_LPCWSTR pSrc, FX_INT32 iSrcLen)
+static int32_t FX_GetUTF8EncodeLength(FX_LPCWSTR pSrc, int32_t iSrcLen)
{
FX_DWORD unicode = 0;
- FX_INT32 iDstNum = 0;
+ int32_t iDstNum = 0;
while (iSrcLen -- > 0) {
unicode = *pSrc ++;
int nbytes = 0;
@@ -2552,8 +2552,8 @@ FX_FILESIZE CFDE_XMLSyntaxParser::GetCurrentBinaryPos() const if (m_pStream == NULL) {
return 0;
}
- FX_INT32 nSrcLen = m_pStart - m_pBuffer;
- FX_INT32 nDstLen = FX_GetUTF8EncodeLength(m_pBuffer, nSrcLen);
+ int32_t nSrcLen = m_pStart - m_pBuffer;
+ int32_t nDstLen = FX_GetUTF8EncodeLength(m_pBuffer, nSrcLen);
return m_iParsedBytes + nDstLen;
}
#ifdef _FDE_BLOCK_BUFFER
@@ -2570,13 +2570,13 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) if (m_iEntityStart > -1 && ch == L';') {
CFX_WideString csEntity;
m_BlockBuffer.GetTextData(csEntity, m_iEntityStart + 1, (m_iDataLength - 1) - m_iEntityStart - 1);
- FX_INT32 iLen = csEntity.GetLength();
+ int32_t iLen = csEntity.GetLength();
if (iLen > 0) {
if (csEntity[0] == L'#') {
ch = 0;
FX_WCHAR w;
if (iLen > 1 && csEntity[1] == L'x') {
- for (FX_INT32 i = 2; i < iLen; i ++) {
+ for (int32_t i = 2; i < iLen; i ++) {
w = csEntity[i];
if (w >= L'0' && w <= L'9') {
ch = (ch << 4) + w - L'0';
@@ -2589,7 +2589,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) }
}
} else {
- for (FX_INT32 i = 1; i < iLen; i ++) {
+ for (int32_t i = 1; i < iLen; i ++) {
w = csEntity[i];
if (w < L'0' || w > L'9') {
break;
@@ -2639,13 +2639,13 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) m_pwsTextData[m_iDataPos] = ch;
if (m_iEntityStart > -1 && ch == L';') {
CFX_WideString csEntity(m_pwsTextData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1);
- FX_INT32 iLen = csEntity.GetLength();
+ int32_t iLen = csEntity.GetLength();
if (iLen > 0) {
if (csEntity[0] == L'#') {
ch = 0;
FX_WCHAR w;
if (iLen > 1 && csEntity[1] == L'x') {
- for (FX_INT32 i = 2; i < iLen; i ++) {
+ for (int32_t i = 2; i < iLen; i ++) {
w = csEntity[i];
if (w >= L'0' && w <= L'9') {
ch = (ch << 4) + w - L'0';
@@ -2658,7 +2658,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) }
}
} else {
- for (FX_INT32 i = 1; i < iLen; i ++) {
+ for (int32_t i = 1; i < iLen; i ++) {
w = csEntity[i];
if (w < L'0' || w > L'9') {
break;
diff --git a/xfa/src/fdp/src/xml/fde_xml.h b/xfa/src/fdp/src/xml/fde_xml.h index edbf01584a..9353561264 100644 --- a/xfa/src/fdp/src/xml/fde_xml.h +++ b/xfa/src/fdp/src/xml/fde_xml.h @@ -31,15 +31,15 @@ public: {
return FDE_XMLNODE_Unknown;
}
- virtual FX_INT32 CountChildNodes() const;
- virtual CFDE_XMLNode* GetChildNode(FX_INT32 index) const;
- virtual FX_INT32 GetChildNodeIndex(CFDE_XMLNode *pNode) const;
- virtual CFDE_XMLNode* GetPath(FX_LPCWSTR pPath, FX_INT32 iLength = -1, FX_BOOL bQualifiedName = TRUE) const;
- virtual FX_INT32 InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index = -1);
+ virtual int32_t CountChildNodes() const;
+ virtual CFDE_XMLNode* GetChildNode(int32_t index) const;
+ virtual int32_t GetChildNodeIndex(CFDE_XMLNode *pNode) const;
+ virtual CFDE_XMLNode* GetPath(FX_LPCWSTR pPath, int32_t iLength = -1, FX_BOOL bQualifiedName = TRUE) const;
+ virtual int32_t InsertChildNode(CFDE_XMLNode *pNode, int32_t index = -1);
virtual void RemoveChildNode(CFDE_XMLNode *pNode);
virtual void DeleteChildren();
virtual CFDE_XMLNode* GetNodeItem(IFDE_XMLNode::NodeItem eItem) const;
- virtual FX_INT32 GetNodeLevel() const;
+ virtual int32_t GetNodeLevel() const;
virtual FX_BOOL InsertNodeItem(IFDE_XMLNode::NodeItem eItem, CFDE_XMLNode *pNode);
virtual CFDE_XMLNode* RemoveNodeItem(IFDE_XMLNode::NodeItem eItem);
virtual CFDE_XMLNode* Clone(FX_BOOL bRecursive);
@@ -69,20 +69,20 @@ public: {
wsTarget = m_wsTarget;
}
- virtual FX_INT32 CountAttributes() const;
- virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const;
+ virtual int32_t CountAttributes() const;
+ virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const;
virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const;
virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const;
virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue);
- virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const;
- virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue);
+ virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue);
virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const;
virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue);
virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName);
- virtual FX_INT32 CountData() const;
- virtual FX_BOOL GetData(FX_INT32 index, CFX_WideString &wsData) const;
+ virtual int32_t CountData() const;
+ virtual FX_BOOL GetData(int32_t index, CFX_WideString &wsData) const;
virtual void AppendData(const CFX_WideString &wsData);
- virtual void RemoveData(FX_INT32 index);
+ virtual void RemoveData(int32_t index);
public:
~CFDE_XMLInstruction() {}
CFX_WideString m_wsTarget;
@@ -106,13 +106,13 @@ public: virtual void GetLocalTagName(CFX_WideString &wsTag) const;
virtual void GetNamespacePrefix(CFX_WideString &wsPrefix) const;
virtual void GetNamespaceURI(CFX_WideString &wsNamespace) const;
- virtual FX_INT32 CountAttributes() const;
- virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const;
+ virtual int32_t CountAttributes() const;
+ virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const;
virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const;
virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const;
virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue);
- virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const;
- virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue);
+ virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue);
virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const;
virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue);
virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName);
@@ -190,9 +190,9 @@ public: {
FDE_Delete this;
}
- virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize = 8192, FX_INT32 iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL);
+ virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize = 8192, int32_t iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL);
virtual FX_BOOL LoadXML(IFDE_XMLParser *pXMLParser);
- virtual FX_INT32 DoLoad(IFX_Pause *pPause = NULL);
+ virtual int32_t DoLoad(IFX_Pause *pPause = NULL);
virtual void CloseXML();
virtual CFDE_XMLNode* GetRoot() const
{
@@ -202,7 +202,7 @@ public: virtual void SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pNode);
protected:
IFX_Stream *m_pStream;
- FX_INT32 m_iStatus;
+ int32_t m_iStatus;
CFDE_XMLNode *m_pRoot;
IFDE_XMLSyntaxParser *m_pSyntaxParser;
IFDE_XMLParser *m_pXMLParser;
@@ -220,7 +220,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 DoParser(IFX_Pause *pPause);
+ virtual int32_t DoParser(IFX_Pause *pPause);
private:
CFDE_XMLNode *m_pRoot;
IFDE_XMLSyntaxParser *m_pParser;
@@ -249,7 +249,7 @@ public: {
FDE_Delete this;
}
- virtual FX_INT32 DoParser(IFX_Pause *pPause);
+ virtual int32_t DoParser(IFX_Pause *pPause);
private:
void Push(const CFDE_XMLTAG &xmlTag);
void Pop();
@@ -264,10 +264,10 @@ private: class CFDE_BlockBuffer : public CFX_Target
{
public:
- CFDE_BlockBuffer(FX_INT32 iAllocStep = 1024 * 1024);
+ CFDE_BlockBuffer(int32_t iAllocStep = 1024 * 1024);
~CFDE_BlockBuffer();
- FX_BOOL InitBuffer(FX_INT32 iBufferSize = 1024 * 1024);
+ FX_BOOL InitBuffer(int32_t iBufferSize = 1024 * 1024);
FX_BOOL IsInitialized()
{
return m_iBufferSize / m_iAllocStep >= 1;
@@ -276,12 +276,12 @@ public: {
FDE_Delete this;
}
- FX_LPWSTR GetAvailableBlock(FX_INT32& iIndexInBlock);
- inline FX_INT32 GetAllocStep() const
+ FX_LPWSTR GetAvailableBlock(int32_t& iIndexInBlock);
+ inline int32_t GetAllocStep() const
{
return m_iAllocStep;
}
- inline FX_INT32& GetDataLengthRef()
+ inline int32_t& GetDataLengthRef()
{
return m_iDataLength;
}
@@ -292,18 +292,18 @@ public: }
m_iDataLength = 0;
}
- void SetTextChar(FX_INT32 iIndex, FX_WCHAR ch);
- FX_INT32 DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection = TRUE);
- void GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart = 0, FX_INT32 iLength = -1) const;
+ void SetTextChar(int32_t iIndex, FX_WCHAR ch);
+ int32_t DeleteTextChars(int32_t iCount, FX_BOOL bDirection = TRUE);
+ void GetTextData(CFX_WideString& wsTextData, int32_t iStart = 0, int32_t iLength = -1) const;
protected:
- inline void TextDataIndex2BufIndex(const FX_INT32 iIndex, FX_INT32& iBlockIndex, FX_INT32& iInnerIndex) const;
+ inline void TextDataIndex2BufIndex(const int32_t iIndex, int32_t& iBlockIndex, int32_t& iInnerIndex) const;
void ClearBuffer();
CFX_PtrArray m_BlockArray;
- FX_INT32 m_iDataLength;
- FX_INT32 m_iBufferSize;
- FX_INT32 m_iAllocStep;
- FX_INT32 m_iStartPosition;
+ int32_t m_iDataLength;
+ int32_t m_iBufferSize;
+ int32_t m_iAllocStep;
+ int32_t m_iStartPosition;
};
#endif
#define FDE_XMLSYNTAXMODE_Text 0
@@ -334,19 +334,19 @@ public: {
FDE_Delete this;
}
- virtual void Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize = 256);
+ virtual void Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize = 256);
virtual FX_DWORD DoSyntaxParse();
- virtual FX_INT32 GetStatus() const;
- virtual FX_INT32 GetCurrentPos() const
+ virtual int32_t GetStatus() const;
+ virtual int32_t GetCurrentPos() const
{
return m_iParsedChars + (m_pStart - m_pBuffer);
}
virtual FX_FILESIZE GetCurrentBinaryPos() const;
- virtual FX_INT32 GetCurrentNodeNumber() const
+ virtual int32_t GetCurrentNodeNumber() const
{
return m_iCurrentNodeNum;
}
- virtual FX_INT32 GetLastNodeNumber() const
+ virtual int32_t GetLastNodeNumber() const
{
return m_iLastNodeNum;
}
@@ -403,14 +403,14 @@ public: #endif
protected:
IFX_Stream *m_pStream;
- FX_INT32 m_iXMLPlaneSize;
- FX_INT32 m_iCurrentPos;
- FX_INT32 m_iCurrentNodeNum;
- FX_INT32 m_iLastNodeNum;
- FX_INT32 m_iParsedChars;
- FX_INT32 m_iParsedBytes;
+ int32_t m_iXMLPlaneSize;
+ int32_t m_iCurrentPos;
+ int32_t m_iCurrentNodeNum;
+ int32_t m_iLastNodeNum;
+ int32_t m_iParsedChars;
+ int32_t m_iParsedBytes;
FX_LPWSTR m_pBuffer;
- FX_INT32 m_iBufferChars;
+ int32_t m_iBufferChars;
FX_BOOL m_bEOS;
FX_LPWSTR m_pStart;
FX_LPWSTR m_pEnd;
@@ -418,20 +418,20 @@ protected: CFDE_XMLNodeStack m_XMLNodeStack;
#ifdef _FDE_BLOCK_BUFFER
CFDE_BlockBuffer m_BlockBuffer;
- FX_INT32 m_iAllocStep;
- FX_INT32& m_iDataLength;
+ int32_t m_iAllocStep;
+ int32_t& m_iDataLength;
FX_LPWSTR m_pCurrentBlock;
- FX_INT32 m_iIndexInBlock;
+ int32_t m_iIndexInBlock;
#else
- FX_INT32 m_iTextDataSize;
+ int32_t m_iTextDataSize;
FX_LPWSTR m_pwsTextData;
- FX_INT32 m_iDataPos;
+ int32_t m_iDataPos;
#endif
- FX_INT32 m_iTextDataLength;
+ int32_t m_iTextDataLength;
FX_DWORD m_dwStatus;
FX_DWORD m_dwMode;
FX_WCHAR m_wQuotationMark;
- FX_INT32 m_iEntityStart;
+ int32_t m_iEntityStart;
CFX_DWordStack m_SkipStack;
FX_WCHAR m_SkipChar;
inline void ParseTextChar(FX_WCHAR ch);
diff --git a/xfa/src/fee/include/fx_wordbreak.h b/xfa/src/fee/include/fx_wordbreak.h index c91aca694a..275930a8b7 100644 --- a/xfa/src/fee/include/fx_wordbreak.h +++ b/xfa/src/fee/include/fx_wordbreak.h @@ -14,9 +14,9 @@ public: virtual void Attach(IFX_CharIter * pIter) = 0;
virtual void Attach(const CFX_WideString & wsText) = 0;
virtual FX_BOOL Next(FX_BOOL bPrev) = 0;
- virtual void SetAt(FX_INT32 nIndex) = 0;
- virtual FX_INT32 GetWordPos() const = 0;
- virtual FX_INT32 GetWordLength() const = 0;
+ virtual void SetAt(int32_t nIndex) = 0;
+ virtual int32_t GetWordPos() const = 0;
+ virtual int32_t GetWordLength() const = 0;
virtual void GetWord(CFX_WideString &wsWord) const = 0;
virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const = 0;
};
diff --git a/xfa/src/fee/include/ifde_txtedtbuf.h b/xfa/src/fee/include/ifde_txtedtbuf.h index 6cfc3ec977..921b17a518 100644 --- a/xfa/src/fee/include/ifde_txtedtbuf.h +++ b/xfa/src/fee/include/ifde_txtedtbuf.h @@ -13,16 +13,16 @@ class IFDE_TxtEdtBuf public:
virtual void Release() = 0;
- virtual FX_BOOL SetChunkSize(FX_INT32 nChunkSize) = 0;
- virtual FX_INT32 GetChunkSize() const = 0;
- virtual FX_INT32 GetTextLength() const = 0;
+ virtual FX_BOOL SetChunkSize(int32_t nChunkSize) = 0;
+ virtual int32_t GetChunkSize() const = 0;
+ virtual int32_t GetTextLength() const = 0;
virtual void SetText(const CFX_WideString &wsText) = 0;
virtual void GetText(CFX_WideString &wsText) const = 0;
- virtual FX_WCHAR GetCharByIndex(FX_INT32 nIndex) const = 0;
- virtual void GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 nCount = - 1) const = 0;
+ virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const = 0;
+ virtual void GetRange(CFX_WideString &wsText, int32_t nBegin, int32_t nCount = - 1) const = 0;
- virtual void Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength = 1) = 0;
- virtual void Delete(FX_INT32 nIndex, FX_INT32 nLength = 1) = 0;
+ virtual void Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength = 1) = 0;
+ virtual void Delete(int32_t nIndex, int32_t nLength = 1) = 0;
virtual void Clear(FX_BOOL bRelease = TRUE) = 0;
diff --git a/xfa/src/fee/include/ifde_txtedtengine.h b/xfa/src/fee/include/ifde_txtedtengine.h index 5c16696845..10f90881bd 100644 --- a/xfa/src/fee/include/ifde_txtedtengine.h +++ b/xfa/src/fee/include/ifde_txtedtengine.h @@ -104,7 +104,7 @@ struct _FDE_TXTEDTPARAMS { }
FX_FLOAT fPlateWidth;
FX_FLOAT fPlateHeight;
- FX_INT32 nLineCount;
+ int32_t nLineCount;
FX_DWORD dwLayoutStyles;
FX_DWORD dwAlignment;
FX_DWORD dwMode;
@@ -116,9 +116,9 @@ struct _FDE_TXTEDTPARAMS { FX_BOOL bTabEquidistant;
FX_WCHAR wDefChar;
FX_WCHAR wLineBreakChar;
- FX_INT32 nCharRotation;
- FX_INT32 nLineEnd;
- FX_INT32 nHorzScale;
+ int32_t nCharRotation;
+ int32_t nLineEnd;
+ int32_t nHorzScale;
FX_FLOAT fCharSpace;
IFDE_TxtEdtEventSink * pEventSink;
};
@@ -130,7 +130,7 @@ enum FDE_TXTEDT_TEXTCHANGE_TYPE { FDE_TXTEDT_TEXTCHANGE_TYPE_Replace ,
};
struct _FDE_TXTEDT_TEXTCHANGE_INFO {
- FX_INT32 nChangeType;
+ int32_t nChangeType;
CFX_WideString wsInsert;
CFX_WideString wsDelete;
CFX_WideString wsPrevText;
@@ -140,18 +140,18 @@ typedef _FDE_TXTEDT_TEXTCHANGE_INFO* FDE_LPTXTEDT_TEXTCHANGE_INFO; class IFDE_TxtEdtEventSink
{
public:
- virtual void On_CaretChanged(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPage, FX_BOOL bVisible = TRUE) = 0;
+ virtual void On_CaretChanged(IFDE_TxtEdtEngine * pEdit, int32_t nPage, FX_BOOL bVisible = TRUE) = 0;
virtual void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo) = 0;
virtual void On_PageCountChanged(IFDE_TxtEdtEngine * pEdit) = 0;
virtual void On_SelChanged(IFDE_TxtEdtEngine * pEdit) = 0;
- virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) = 0;
- virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) = 0;
- virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex) = 0;
+ virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex, int32_t nPurpose) = 0;
+ virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex, int32_t nPurpose) = 0;
+ virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex) = 0;
virtual void On_AddDoRecord(IFDE_TxtEdtEngine * pEdit, FX_BSTR bsDoRecord) = 0;
- virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \
- const CFX_WideString &wsFieldText, FX_INT32 nCharIndex) = 0;
- virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex) = 0;
- virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText) = 0;
+ virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \
+ const CFX_WideString &wsFieldText, int32_t nCharIndex) = 0;
+ virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex) = 0;
+ virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText) = 0;
virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText) = 0;
};
class IFX_CharIter
@@ -160,8 +160,8 @@ public: virtual void Release() = 0;
virtual FX_BOOL Next(FX_BOOL bPrev = FALSE) = 0;
virtual FX_WCHAR GetChar() = 0;
- virtual void SetAt(FX_INT32 nIndex) = 0;
- virtual FX_INT32 GetAt() const = 0;
+ virtual void SetAt(int32_t nIndex) = 0;
+ virtual int32_t GetAt() const = 0;
virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const = 0;
virtual IFX_CharIter * Clone() = 0;
};
@@ -174,60 +174,60 @@ public: virtual void SetEditParams(const FDE_TXTEDTPARAMS ¶ms) = 0;
virtual const FDE_TXTEDTPARAMS* GetEditParams() const = 0;
- virtual FX_INT32 CountPages() const = 0;
- virtual IFDE_TxtEdtPage* GetPage(FX_INT32 nIndex) = 0;
- virtual FX_BOOL SetBufChunkSize(FX_INT32 nChunkSize) = 0;
+ virtual int32_t CountPages() const = 0;
+ virtual IFDE_TxtEdtPage* GetPage(int32_t nIndex) = 0;
+ virtual FX_BOOL SetBufChunkSize(int32_t nChunkSize) = 0;
virtual void SetTextByStream(IFX_Stream * pStream) = 0;
virtual void SetText(const CFX_WideString &wsText) = 0;
- virtual FX_INT32 GetTextLength() const = 0;
- virtual void GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount = -1) = 0;
+ virtual int32_t GetTextLength() const = 0;
+ virtual void GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount = -1) = 0;
virtual void ClearText() = 0;
- virtual FX_INT32 GetCaretRect(CFX_RectF &rtCaret) const = 0;
- virtual FX_INT32 GetCaretPos() const = 0;
- virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE) = 0;
- virtual FX_INT32 MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE) = 0;
+ virtual int32_t GetCaretRect(CFX_RectF &rtCaret) const = 0;
+ virtual int32_t GetCaretPos() const = 0;
+ virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE) = 0;
+ virtual int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE) = 0;
virtual void Lock() = 0;
virtual void Unlock() = 0;
virtual FX_BOOL IsLocked() const = 0;
- virtual FX_INT32 Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength) = 0;
- virtual FX_INT32 Delete(FX_INT32 nStart, FX_BOOL bBackspace = FALSE) = 0;
- virtual FX_INT32 DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1) = 0;
- virtual FX_INT32 Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace) = 0;
- virtual void SetLimit(FX_INT32 nLimit) = 0;
+ virtual int32_t Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength) = 0;
+ virtual int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE) = 0;
+ virtual int32_t DeleteRange(int32_t nStart, int32_t nCount = -1) = 0;
+ virtual int32_t Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace) = 0;
+ virtual void SetLimit(int32_t nLimit) = 0;
virtual void SetAliasChar(FX_WCHAR wAlias) = 0;
- virtual void SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat) = 0;
- virtual FX_INT32 CountEditBlocks() const = 0;
- virtual void GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const = 0;
- virtual FX_INT32 CountEditFields(FX_INT32 nBlockIndex) const = 0;
- virtual void GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const = 0;
+ virtual void SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat) = 0;
+ virtual int32_t CountEditBlocks() const = 0;
+ virtual void GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const = 0;
+ virtual int32_t CountEditFields(int32_t nBlockIndex) const = 0;
+ virtual void GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const = 0;
virtual void StartEdit() = 0;
virtual void EndEdit() = 0;
- virtual void AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1) = 0;
- virtual FX_INT32 CountSelRanges() = 0;
- virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) = 0;
+ virtual void AddSelRange(int32_t nStart, int32_t nCount = -1) = 0;
+ virtual int32_t CountSelRanges() = 0;
+ virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart) = 0;
virtual void ClearSelection() = 0;
virtual FX_BOOL Redo(FX_BSTR bsRedo) = 0;
virtual FX_BOOL Undo(FX_BSTR bsUndo) = 0;
- virtual FX_INT32 StartLayout() = 0;
- virtual FX_INT32 DoLayout(IFX_Pause *pPause) = 0;
+ virtual int32_t StartLayout() = 0;
+ virtual int32_t DoLayout(IFX_Pause *pPause) = 0;
virtual void EndLayout() = 0;
virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL) = 0;
- virtual FX_INT32 CountParags() const = 0;
- virtual IFDE_TxtEdtParag* GetParag(FX_INT32 nParagIndex) const = 0;
+ virtual int32_t CountParags() const = 0;
+ virtual IFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const = 0;
virtual IFX_CharIter* CreateCharIter() = 0;
};
class IFDE_TxtEdtParag
{
public:
- virtual FX_INT32 GetTextLength() const = 0;
- virtual FX_INT32 GetStartIndex() const = 0;
- virtual FX_INT32 CountLines() const = 0;
- virtual void GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const = 0;
+ virtual int32_t GetTextLength() const = 0;
+ virtual int32_t GetStartIndex() const = 0;
+ virtual int32_t CountLines() const = 0;
+ virtual void GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const = 0;
};
#endif
diff --git a/xfa/src/fee/include/ifde_txtedtpage.h b/xfa/src/fee/include/ifde_txtedtpage.h index 7555434f5f..4e6c859793 100644 --- a/xfa/src/fee/include/ifde_txtedtpage.h +++ b/xfa/src/fee/include/ifde_txtedtpage.h @@ -11,21 +11,21 @@ class IFDE_TxtEdtPage; class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess
{
public:
- static IFDE_TxtEdtPage * Create(IFDE_TxtEdtEngine * pEngine, FX_INT32 nIndex);
+ static IFDE_TxtEdtPage * Create(IFDE_TxtEdtEngine * pEngine, int32_t nIndex);
virtual void Release() = 0;
virtual IFDE_TxtEdtEngine * GetEngine() const = 0;
- virtual FX_INT32 GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const = 0;
- virtual FX_INT32 GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore) = 0;
- virtual void CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const = 0;
- virtual FX_INT32 SelectWord (const CFX_PointF &fPoint, FX_INT32 &nCount) = 0;
- virtual FX_INT32 GetCharStart() const = 0;
- virtual FX_INT32 GetCharCount() const = 0;
+ virtual int32_t GetCharRect(int32_t nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const = 0;
+ virtual int32_t GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore) = 0;
+ virtual void CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const = 0;
+ virtual int32_t SelectWord (const CFX_PointF &fPoint, int32_t &nCount) = 0;
+ virtual int32_t GetCharStart() const = 0;
+ virtual int32_t GetCharCount() const = 0;
- virtual FX_INT32 GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS* &pCharPos, FX_LPRECTF pBBox = NULL) const = 0;
+ virtual int32_t GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS* &pCharPos, FX_LPRECTF pBBox = NULL) const = 0;
virtual FX_BOOL IsLoaded(FX_LPCRECTF pClipBox = NULL) = 0;
- virtual FX_INT32 LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL) = 0;
virtual void UnloadPage(FX_LPCRECTF pClipBox = NULL) = 0;
virtual const CFX_RectF& GetContentsBox() = 0;
};
diff --git a/xfa/src/fee/src/fee/fde_txtedtblock.cpp b/xfa/src/fee/src/fee/fde_txtedtblock.cpp index 89515bdb00..2d71cd3a99 100644 --- a/xfa/src/fee/src/fee/fde_txtedtblock.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtblock.cpp @@ -12,17 +12,17 @@ #define FDE_TXTEDT_ZEROWIDTHSPACE 0x200B
#define FDE_TXTEDT_ISINTEGER(a) ((a) >= L'0' && (a) <= L'9')
#define FDE_TXTEDT_ISSIGN(a) (((a) == L'-') || ((a) == L'+'))
-CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, FX_INT32 nPosition)
+CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, int32_t nPosition)
: m_pEngine(pEngine)
, m_nDisplayLength(0)
, m_nIndex(0)
, m_nPosition(nPosition)
{
FX_LPCWSTR lpBuf = FX_LPCWSTR(wsBlock);
- FX_INT32 nCount = wsBlock.GetLength();
- FX_INT32 i = 0;
+ int32_t nCount = wsBlock.GetLength();
+ int32_t i = 0;
CFX_WideString wsFix;
- FX_INT32 j = 0;
+ int32_t j = 0;
while (i < nCount) {
if (lpBuf[i] != L'%') {
wsFix += lpBuf[i];
@@ -40,7 +40,7 @@ CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideSt m_nDisplayLength += pField->GetDisplayLength();
wsFix.Empty();
}
- FX_INT32 nPos = i - 1;
+ int32_t nPos = i - 1;
while (lpBuf[i ++] != L')')
;
i ++;
@@ -66,8 +66,8 @@ CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideSt }
CFDE_TxtEdtBlock::~CFDE_TxtEdtBlock()
{
- FX_INT32 nCount = m_FieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_FieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_FieldArr[i];
pField->Release();
}
@@ -75,19 +75,19 @@ CFDE_TxtEdtBlock::~CFDE_TxtEdtBlock() }
void CFDE_TxtEdtBlock::GetDisplayText(CFX_WideString &wsDisplay)
{
- FX_INT32 nCount = m_FieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_FieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_FieldArr[i];
CFX_WideString wsTemp;
pField->GetDisplayText(wsTemp);
wsDisplay += wsTemp;
}
}
-FX_INT32 CFDE_TxtEdtBlock::GetLength() const
+int32_t CFDE_TxtEdtBlock::GetLength() const
{
- FX_INT32 nDisplayLength = 0;
- FX_INT32 nCount = m_FieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nDisplayLength = 0;
+ int32_t nCount = m_FieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_FieldArr[i];
nDisplayLength += pField->GetDisplayLength();
}
@@ -95,41 +95,41 @@ FX_INT32 CFDE_TxtEdtBlock::GetLength() const }
void CFDE_TxtEdtBlock::GetBlockText(CFX_WideString &wsBlock)
{
- FX_INT32 nCount = m_FieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_FieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_FieldArr[i];
CFX_WideString wsTemp;
pField->GetFieldText(wsTemp);
wsBlock += wsTemp;
}
}
-FX_INT32 CFDE_TxtEdtBlock::CountField() const
+int32_t CFDE_TxtEdtBlock::CountField() const
{
return m_EditFieldArr.GetSize();
}
-void CFDE_TxtEdtBlock::GetFieldText(FX_INT32 nIndex, CFX_WideString &wsField)
+void CFDE_TxtEdtBlock::GetFieldText(int32_t nIndex, CFX_WideString &wsField)
{
CFDE_TxtEdtField * pField = m_EditFieldArr[nIndex];
pField->GetFieldText(wsField);
}
-FX_INT32 CFDE_TxtEdtBlock::GetFieldTextLength() const
+int32_t CFDE_TxtEdtBlock::GetFieldTextLength() const
{
- FX_INT32 nTotalLength = 0;
- FX_INT32 nCount = m_EditFieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nTotalLength = 0;
+ int32_t nCount = m_EditFieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_EditFieldArr[i];
nTotalLength = pField->GetFieldTextLength();
}
return nTotalLength;
}
-FX_INT32 CFDE_TxtEdtBlock::GetPos() const
+int32_t CFDE_TxtEdtBlock::GetPos() const
{
return m_nPosition;
}
void CFDE_TxtEdtBlock::GetRealText(CFX_WideString &wsText) const
{
- FX_INT32 nCount = m_FieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_FieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFDE_TxtEdtField * pField = m_FieldArr[i];
CFX_WideString wsTemp;
pField->GetFieldText(wsTemp);
@@ -138,15 +138,15 @@ void CFDE_TxtEdtBlock::GetRealText(CFX_WideString &wsText) const }
void CFDE_TxtEdtBlock::Backup()
{
- FX_INT32 nCount = m_EditFieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_EditFieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
m_EditFieldArr[i]->Backup();
}
}
void CFDE_TxtEdtBlock::Restore()
{
- FX_INT32 nCount = m_EditFieldArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_EditFieldArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
m_EditFieldArr[i]->Restore();
}
}
@@ -156,8 +156,8 @@ CFDE_TxtEdtFieldFormatParser::CFDE_TxtEdtFieldFormatParser() CFDE_TxtEdtFieldFormatParser::~CFDE_TxtEdtFieldFormatParser()
{
FDE_LPTXTEDTFORMATITEM lpItem = NULL;
- FX_INT32 nCount = m_ItemArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_ItemArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
lpItem = m_ItemArr[i];
delete lpItem;
}
@@ -167,9 +167,9 @@ FX_BOOL CFDE_TxtEdtFieldFormatParser::Parse(const CFX_WideString &wsFormat) {
m_wsFormat = wsFormat;
FX_LPCWSTR pBuf = FX_LPCWSTR(m_wsFormat);
- FX_INT32 nCount = m_wsFormat.GetLength();
+ int32_t nCount = m_wsFormat.GetLength();
nCount -= 2;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < nCount; i ++) {
FX_WCHAR wChar = pBuf[i];
if (wChar == L'(') {
@@ -199,11 +199,11 @@ FX_BOOL CFDE_TxtEdtFieldFormatParser::Parse(const CFX_WideString &wsFormat) }
return TRUE;
}
-FX_INT32 CFDE_TxtEdtFieldFormatParser::CountItems() const
+int32_t CFDE_TxtEdtFieldFormatParser::CountItems() const
{
return m_ItemArr.GetSize();
}
-void CFDE_TxtEdtFieldFormatParser::GetItem(FX_INT32 nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const
+void CFDE_TxtEdtFieldFormatParser::GetItem(int32_t nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const
{
FDE_LPTXTEDTFORMATITEM lpItem = m_ItemArr[nIndex];
FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(m_wsFormat);
@@ -214,7 +214,7 @@ void CFDE_TxtEdtFieldFormatParser::GetItem(FX_INT32 nIndex, CFX_WideString &wsKe FXSYS_memcpy(lpDstBuf, lpSrcBuf + lpItem->nValStart, lpItem->nValCount * sizeof(FX_WCHAR));
wsValue.ReleaseBuffer(lpItem->nValCount);
}
-CFDE_TxtEdtField * CFDE_TxtEdtField::Create(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField * CFDE_TxtEdtField::Create(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
{
if (wsField[0] != L'%' || (wsField[0] == L'%' && wsField[1] == L'%')) {
return FX_NEW CFDE_TxtEdtField_Fixed(wsField, nIndex, pBlock);
@@ -238,7 +238,7 @@ void CFDE_TxtEdtField::Release() {
delete this;
}
-CFDE_TxtEdtField::CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField::CFDE_TxtEdtField(int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: m_nLength(-1)
, m_wcFill(L' ')
, m_bReserveSpace(FALSE)
@@ -248,21 +248,21 @@ CFDE_TxtEdtField::CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) {
FXSYS_assert(pBlock);
}
-FX_INT32 CFDE_TxtEdtField::Insert(FX_INT32 nIndex, const CFX_WideString &wsIns,
- FX_INT32 &nCaret, FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtField::Insert(int32_t nIndex, const CFX_WideString &wsIns,
+ int32_t &nCaret, FX_BOOL &bBefore)
{
- FX_INT32 nFieldLength = m_wsField.GetLength();
- FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
+ int32_t nFieldLength = m_wsField.GetLength();
+ int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
if (m_bReserveSpace && !m_bLeftAlignment) {
nInnerIndex -= (m_nLength - nFieldLength);
}
FXSYS_assert(nInnerIndex >= 0 && nInnerIndex <= nFieldLength);
CFX_WideString wsTemp = m_wsField;
- FX_INT32 nInsLength = wsIns.GetLength();
- for (FX_INT32 i = 0; i < nInsLength; i ++, nInnerIndex ++) {
+ int32_t nInsLength = wsIns.GetLength();
+ for (int32_t i = 0; i < nInsLength; i ++, nInnerIndex ++) {
wsTemp.Insert(nInnerIndex, wsIns[i]);
}
- FX_INT32 nRet = Validate(wsTemp);
+ int32_t nRet = Validate(wsTemp);
switch (nRet) {
case FDE_FORMAT_FIELD_VALIDATE_F_FULL:
return FDE_FORMAT_FIELD_INSERT_RET_F_FULL;
@@ -277,11 +277,11 @@ FX_INT32 CFDE_TxtEdtField::Insert(FX_INT32 nIndex, const CFX_WideString &wsIns, bBefore = TRUE;
return (nFieldLength + nInsLength < m_nLength) ? FDE_FORMAT_FIELD_INSERT_RET_S_NORMAL : FDE_FORMAT_FIELD_INSERT_RET_S_FULL;
}
-FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount,
- CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtField::Delete(int32_t nIndex, int32_t nCount,
+ CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore)
{
- FX_INT32 nFieldLength = m_wsField.GetLength();
- FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
+ int32_t nFieldLength = m_wsField.GetLength();
+ int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
if (m_bReserveSpace && !m_bLeftAlignment) {
nInnerIndex -= (m_nLength - nFieldLength);
}
@@ -290,7 +290,7 @@ FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount, }
CFX_WideString wsTemp = m_wsField;
wsTemp.Delete(nInnerIndex, nCount);
- FX_INT32 nRet = Validate(wsTemp);
+ int32_t nRet = Validate(wsTemp);
switch (nRet) {
case FDE_FORMAT_FIELD_VALIDATE_F_FULL:
return FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY;
@@ -308,12 +308,12 @@ FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount, bBefore = TRUE;
return FDE_FORMAT_FIELD_DELETE_RET_S;
}
-FX_INT32 CFDE_TxtEdtField::Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_WideString &wsIns,
- CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtField::Replace(int32_t nIndex, int32_t nCount, const CFX_WideString &wsIns,
+ CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore)
{
- FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
- FX_INT32 nInsLength = wsIns.GetLength();
- FX_INT32 nFieldLength = m_wsField.GetLength();
+ int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
+ int32_t nInsLength = wsIns.GetLength();
+ int32_t nFieldLength = m_wsField.GetLength();
CFX_WideString wsTemp = m_wsField;
if (m_bReserveSpace && !m_bLeftAlignment) {
nInnerIndex -= (m_nLength - nFieldLength);
@@ -323,11 +323,11 @@ FX_INT32 CFDE_TxtEdtField::Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_W return FALSE;
}
wsTemp.Delete(nInnerIndex, nCount);
- FX_INT32 nInnerIndexBK = nInnerIndex;
- for (FX_INT32 i = 0; i < nInsLength; i ++, nInnerIndex ++) {
+ int32_t nInnerIndexBK = nInnerIndex;
+ for (int32_t i = 0; i < nInsLength; i ++, nInnerIndex ++) {
wsTemp.Insert(nInnerIndex, wsIns[i]);
}
- FX_INT32 nRet = Validate(wsTemp);
+ int32_t nRet = Validate(wsTemp);
switch(nRet) {
case FDE_FORMAT_FIELD_VALIDATE_F_FULL:
return FDE_FORMAT_FIELD_INSERT_RET_F_FULL;
@@ -348,7 +348,7 @@ void CFDE_TxtEdtField::GetDisplayText(CFX_WideString &wsDisplay) {
CFX_WideString wsField;
GetNormalizedFieldText(wsField);
- FX_INT32 nLength = wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;
+ int32_t nLength = wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;
FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength);
lpBuffer[0] = FDE_TXTEDT_FORMATBLOCK_BGN;
lpBuffer[nLength - 1] = FDE_TXTEDT_FORMATBLOCK_END;
@@ -357,7 +357,7 @@ void CFDE_TxtEdtField::GetDisplayText(CFX_WideString &wsDisplay) FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(wsField), (nLength - 4) * sizeof(FX_WCHAR));
wsDisplay.ReleaseBuffer(nLength);
}
-FX_INT32 CFDE_TxtEdtField::GetDisplayLength()
+int32_t CFDE_TxtEdtField::GetDisplayLength()
{
return (m_bReserveSpace ? m_nLength : m_wsField.GetLength()) + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;
}
@@ -365,17 +365,17 @@ void CFDE_TxtEdtField::GetFieldText(CFX_WideString &wsField) {
wsField = m_wsField;
}
-FX_INT32 CFDE_TxtEdtField::GetFieldTextLength() const
+int32_t CFDE_TxtEdtField::GetFieldTextLength() const
{
return m_wsField.GetLength();
}
-FX_INT32 CFDE_TxtEdtField::GetRealIndex(FX_INT32 nIndex) const
+int32_t CFDE_TxtEdtField::GetRealIndex(int32_t nIndex) const
{
- FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
+ int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE;
if (nInnerIndex < 0) {
return 0;
}
- FX_INT32 nFieldLength = m_wsField.GetLength();
+ int32_t nFieldLength = m_wsField.GetLength();
if (m_bReserveSpace && !m_bLeftAlignment) {
nInnerIndex -= (m_nLength - nFieldLength);
}
@@ -387,12 +387,12 @@ FX_INT32 CFDE_TxtEdtField::GetRealIndex(FX_INT32 nIndex) const }
return nInnerIndex + 1;
}
-FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const
+int32_t CFDE_TxtEdtField::NormalizeCaretPos(int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const
{
nIndex -= FDE_FORMAT_EDIT_FIELD_HADERSIZE;
- FX_INT32 nLength = m_wsField.GetLength();
+ int32_t nLength = m_wsField.GetLength();
if (m_bReserveSpace) {
- FX_INT32 nFieldLength = m_wsField.GetLength();
+ int32_t nFieldLength = m_wsField.GetLength();
if (m_bLeftAlignment) {
if (nIndex > nFieldLength) {
if (eDirection == FDE_FORMAT_CARET_FORWARD) {
@@ -401,7 +401,7 @@ FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_D nIndex = nFieldLength;
}
} else {
- FX_INT32 nReserveLength = m_nLength - nFieldLength;
+ int32_t nReserveLength = m_nLength - nFieldLength;
if (nIndex < nReserveLength) {
if (eDirection == FDE_FORMAT_CARET_BACKWARD) {
return -2;
@@ -412,7 +412,7 @@ FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_D }
return nIndex + FDE_FORMAT_EDIT_FIELD_HADERSIZE;
}
-FX_BOOL CFDE_TxtEdtField::GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const
+FX_BOOL CFDE_TxtEdtField::GetEditableRange(int32_t &nBgn, int32_t &nEnd) const
{
if (m_bReserveSpace && !m_bLeftAlignment) {
nEnd = FDE_FORMAT_EDIT_FIELD_HADERSIZE + m_nLength;
@@ -431,7 +431,7 @@ void CFDE_TxtEdtField::Restore() {
m_wsField = m_wsBackup;
}
-FX_INT32 CFDE_TxtEdtField::Validate(const CFX_WideString & wsText) const
+int32_t CFDE_TxtEdtField::Validate(const CFX_WideString & wsText) const
{
if (m_nLength < 0) {
return FDE_FORMAT_FIELD_DELETE_RET_S;
@@ -445,8 +445,8 @@ void CFDE_TxtEdtField::GetNormalizedFieldText(CFX_WideString &wsField) const return;
}
if (m_bReserveSpace) {
- FX_INT32 nField = wsField.GetLength();
- FX_INT32 nFill = m_nLength - nField;
+ int32_t nField = wsField.GetLength();
+ int32_t nFill = m_nLength - nField;
if (m_bLeftAlignment) {
while (nFill --) {
wsField.Insert(nField++, m_wcFill);
@@ -458,16 +458,16 @@ void CFDE_TxtEdtField::GetNormalizedFieldText(CFX_WideString &wsField) const }
}
}
-CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: m_bSign(FALSE)
, CFDE_TxtEdtField(nIndex, pBlock)
{
CFDE_TxtEdtFieldFormatParser FormatParser;
FormatParser.Parse(wsField);
- FX_INT32 nCount = FormatParser.CountItems();
+ int32_t nCount = FormatParser.CountItems();
CFX_WideString wskey;
CFX_WideString wsVal;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ for (int32_t i = 0; i < nCount; i ++) {
FormatParser.GetItem(i, wskey, wsVal);
if (wskey.Equal(L"Length")) {
m_nLength = wsVal.GetInteger();
@@ -485,16 +485,16 @@ CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField m_bReserveSpace = FALSE;
}
}
-FX_INT32 CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const
+int32_t CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const
{
- FX_INT32 i = 0;
+ int32_t i = 0;
if (m_bSign) {
FX_WCHAR wcTemp = wsText[0];
if (FDE_TXTEDT_ISSIGN(wcTemp)) {
i ++;
}
}
- FX_INT32 nLength = wsText.GetLength();
+ int32_t nLength = wsText.GetLength();
if (m_nLength > 0) {
if (nLength - i > (m_nLength - (m_bSign ? 1 : 0))) {
return FDE_FORMAT_FIELD_VALIDATE_F_FULL;
@@ -508,7 +508,7 @@ FX_INT32 CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const }
return FDE_FORMAT_FIELD_VALIDATE_S;
}
-CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: CFDE_TxtEdtField(nIndex, pBlock)
, m_bSigned(FALSE)
, m_nIntPartlength(-1)
@@ -516,10 +516,10 @@ CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX {
CFDE_TxtEdtFieldFormatParser FormatParser;
FormatParser.Parse(wsField);
- FX_INT32 nCount = FormatParser.CountItems();
+ int32_t nCount = FormatParser.CountItems();
CFX_WideString wskey;
CFX_WideString wsVal;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ for (int32_t i = 0; i < nCount; i ++) {
FormatParser.GetItem(i, wskey, wsVal);
if (wskey.Equal(L"DecLength")) {
m_nDecPartLength = wsVal.GetInteger();
@@ -542,22 +542,22 @@ CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX wsVal.Empty();
}
}
-FX_INT32 CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const
+int32_t CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const
{
- FX_INT32 nLength = wsText.GetLength();
+ int32_t nLength = wsText.GetLength();
if (m_nLength != -1 && (nLength > m_nLength)) {
return FDE_FORMAT_FIELD_VALIDATE_F_FULL;
}
FX_LPCWSTR lpBuf = FX_LPCWSTR(wsText);
- FX_INT32 i = 0;
+ int32_t i = 0;
if (m_bSigned) {
FX_WCHAR wcTemp = lpBuf[0];
if (FDE_TXTEDT_ISSIGN(wcTemp)) {
i ++;
}
}
- FX_INT32 nIntPart = 0;
- FX_INT32 nPoint = 0;
+ int32_t nIntPart = 0;
+ int32_t nPoint = 0;
for (; i < nLength; i ++) {
FX_WCHAR wcTemp = lpBuf[i];
if (!FDE_TXTEDT_ISINTEGER(wcTemp)) {
@@ -584,16 +584,16 @@ FX_INT32 CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const }
return FDE_FORMAT_FIELD_VALIDATE_S;
}
-CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: CFDE_TxtEdtField(nIndex, pBlock)
, m_wcAlias(L'*')
{
CFDE_TxtEdtFieldFormatParser FormatParser;
FormatParser.Parse(wsField);
- FX_INT32 nCount = FormatParser.CountItems();
+ int32_t nCount = FormatParser.CountItems();
CFX_WideString wskey;
CFX_WideString wsVal;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ for (int32_t i = 0; i < nCount; i ++) {
FormatParser.GetItem(i, wskey, wsVal);
if (wskey.Equal(L"Length")) {
m_nLength = wsVal.GetInteger();
@@ -611,14 +611,14 @@ CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsFie }
void CFDE_TxtEdtField_Password::GetNormalizedFieldText(CFX_WideString &wsField) const
{
- FX_INT32 nFiledLength = m_wsField.GetLength();
- FX_INT32 nLength = m_bReserveSpace ? m_nLength : nFiledLength;
+ int32_t nFiledLength = m_wsField.GetLength();
+ int32_t nLength = m_bReserveSpace ? m_nLength : nFiledLength;
FX_LPWSTR lpBuf = wsField.GetBuffer(nLength);
- FX_INT32 nSpaceLength = nLength - nFiledLength;
- FX_INT32 nFirstPart = m_bLeftAlignment ? nFiledLength : nSpaceLength;
+ int32_t nSpaceLength = nLength - nFiledLength;
+ int32_t nFirstPart = m_bLeftAlignment ? nFiledLength : nSpaceLength;
FX_WCHAR wFirstChar = m_bLeftAlignment ? m_wcAlias : L' ';
FX_WCHAR wSecondChar = m_bLeftAlignment ? L' ' : m_wcAlias;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < nFirstPart; i ++) {
lpBuf[i] = wFirstChar;
}
@@ -627,15 +627,15 @@ void CFDE_TxtEdtField_Password::GetNormalizedFieldText(CFX_WideString &wsField) }
wsField.ReleaseBuffer(nLength);
}
-CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: CFDE_TxtEdtField(nIndex, pBlock)
{
CFDE_TxtEdtFieldFormatParser FormatParser;
FormatParser.Parse(wsField);
- FX_INT32 nCount = FormatParser.CountItems();
+ int32_t nCount = FormatParser.CountItems();
CFX_WideString wskey;
CFX_WideString wsVal;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ for (int32_t i = 0; i < nCount; i ++) {
FormatParser.GetItem(i, wskey, wsVal);
if (wskey.Equal(L"Length")) {
m_nLength = wsVal.GetInteger();
@@ -646,7 +646,7 @@ CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, wsVal.Empty();
}
}
-CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock)
+CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock)
: CFDE_TxtEdtField(nIndex, pBlock)
{
m_wsField = wsField;
@@ -654,7 +654,7 @@ CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX }
void CFDE_TxtEdtField_Fixed::GetDisplayText(CFX_WideString &wsDisplay)
{
- FX_INT32 nLength = m_wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;
+ int32_t nLength = m_wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;
FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength);
lpBuffer[0] = FDE_TXTEDT_FORMATBLOCK_BGN;
lpBuffer[nLength - 1] = FDE_TXTEDT_FORMATBLOCK_END;
@@ -663,7 +663,7 @@ void CFDE_TxtEdtField_Fixed::GetDisplayText(CFX_WideString &wsDisplay) FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(m_wsField), (nLength - 4) * sizeof(FX_WCHAR));
wsDisplay.ReleaseBuffer(nLength);
}
-FX_INT32 CFDE_TxtEdtField_Fixed::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const
+int32_t CFDE_TxtEdtField_Fixed::NormalizeCaretPos(int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const
{
FXSYS_assert(nIndex >= 0 && nIndex <= m_nLength);
if (eDirection == FDE_FORMAT_CARET_MIDDLE) {
diff --git a/xfa/src/fee/src/fee/fde_txtedtblock.h b/xfa/src/fee/src/fee/fde_txtedtblock.h index 9ae19ed61f..2805fbd35a 100644 --- a/xfa/src/fee/src/fee/fde_txtedtblock.h +++ b/xfa/src/fee/src/fee/fde_txtedtblock.h @@ -42,33 +42,33 @@ enum FDE_FORMAT_CARET_DIRECTION { class CFDE_TxtEdtBlock
{
public:
- CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, FX_INT32 nPosition);
+ CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, int32_t nPosition);
~CFDE_TxtEdtBlock();
void GetDisplayText(CFX_WideString &wsDisplay);
- FX_INT32 GetLength() const;
+ int32_t GetLength() const;
void GetBlockText(CFX_WideString &wsBlock);
- FX_INT32 CountField() const;
- void GetFieldText(FX_INT32 nIndex, CFX_WideString &wsField);
- FX_INT32 GetFieldTextLength() const;
+ int32_t CountField() const;
+ void GetFieldText(int32_t nIndex, CFX_WideString &wsField);
+ int32_t GetFieldTextLength() const;
- FX_INT32 GetPos() const;
+ int32_t GetPos() const;
void GetRealText(CFX_WideString &wsText) const;
void Backup();
void Restore();
- void SetIndex(FX_INT32 nIndex)
+ void SetIndex(int32_t nIndex)
{
m_nIndex = nIndex;
}
- FX_INT32 GetIndex() const
+ int32_t GetIndex() const
{
return m_nIndex;
}
private:
CFDE_TxtEdtEngine * m_pEngine;
- FX_INT32 m_nDisplayLength;
- FX_INT32 m_nIndex;
+ int32_t m_nDisplayLength;
+ int32_t m_nIndex;
- FX_INT32 m_nPosition;
+ int32_t m_nPosition;
CFX_ArrayTemplate<CFDE_TxtEdtField*> m_FieldArr;
CFX_ArrayTemplate<CFDE_TxtEdtField*> m_EditFieldArr;
};
@@ -78,14 +78,14 @@ public: CFDE_TxtEdtFieldFormatParser();
~CFDE_TxtEdtFieldFormatParser();
FX_BOOL Parse(const CFX_WideString &wsFormat);
- FX_INT32 CountItems() const;
- void GetItem(FX_INT32 nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const;
+ int32_t CountItems() const;
+ void GetItem(int32_t nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const;
private:
typedef struct {
- FX_INT32 nKeyStart;
- FX_INT32 nKeyCount;
- FX_INT32 nValStart;
- FX_INT32 nValCount;
+ int32_t nKeyStart;
+ int32_t nKeyCount;
+ int32_t nValStart;
+ int32_t nValCount;
} FDE_TXTEDTFORMATITEM, * FDE_LPTXTEDTFORMATITEM;
CFX_WideString m_wsFormat;
@@ -94,85 +94,85 @@ private: class CFDE_TxtEdtField
{
public:
- static CFDE_TxtEdtField * Create(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ static CFDE_TxtEdtField * Create(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
virtual void Release();
- virtual FX_INT32 Insert( FX_INT32 nIndex, const CFX_WideString &wsIns,
- FX_INT32 &nCaret, FX_BOOL &bBefore);
- virtual FX_INT32 Delete( FX_INT32 nIndex, FX_INT32 nCount,
- CFX_WideString &wsDel, FX_INT32 &nCaret,
+ virtual int32_t Insert( int32_t nIndex, const CFX_WideString &wsIns,
+ int32_t &nCaret, FX_BOOL &bBefore);
+ virtual int32_t Delete( int32_t nIndex, int32_t nCount,
+ CFX_WideString &wsDel, int32_t &nCaret,
FX_BOOL &bBefore);
- virtual FX_INT32 Replace(FX_INT32 nIndex, FX_INT32 nCount,
+ virtual int32_t Replace(int32_t nIndex, int32_t nCount,
const CFX_WideString &wsIns, CFX_WideString &wsDel,
- FX_INT32 &nCaret, FX_BOOL &bBefore);
+ int32_t &nCaret, FX_BOOL &bBefore);
virtual void GetDisplayText(CFX_WideString &wsDisplay);
- virtual FX_INT32 GetDisplayLength();
+ virtual int32_t GetDisplayLength();
virtual void GetFieldText(CFX_WideString &wsField);
- virtual FX_INT32 GetFieldTextLength() const;
- virtual FX_INT32 GetRealIndex(FX_INT32 nIndex) const;
+ virtual int32_t GetFieldTextLength() const;
+ virtual int32_t GetRealIndex(int32_t nIndex) const;
- virtual FX_INT32 NormalizeCaretPos( FX_INT32 nIndex,
+ virtual int32_t NormalizeCaretPos( int32_t nIndex,
FDE_FORMAT_CARET_DIRECTION eDirection = FDE_FORMAT_CARET_MIDDLE) const;
- virtual FX_BOOL GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const;
+ virtual FX_BOOL GetEditableRange(int32_t &nBgn, int32_t &nEnd) const;
virtual void Backup();
virtual void Restore();
virtual FX_BOOL IsFix() const
{
return FALSE;
}
- void SetIndex(FX_INT32 nIndex)
+ void SetIndex(int32_t nIndex)
{
m_nIndex = nIndex;
}
- FX_INT32 GetIndex() const
+ int32_t GetIndex() const
{
return m_nIndex;
}
- FX_INT32 GetBlockIndex() const
+ int32_t GetBlockIndex() const
{
return m_pBlock->GetIndex();
}
protected:
- CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ CFDE_TxtEdtField(int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
virtual ~CFDE_TxtEdtField() {}
- virtual FX_INT32 Validate(const CFX_WideString & wsText) const;
+ virtual int32_t Validate(const CFX_WideString & wsText) const;
virtual void GetNormalizedFieldText(CFX_WideString &wsField) const;
- FX_INT32 m_nLength;
+ int32_t m_nLength;
CFX_WideString m_wsField;
CFX_WideString m_wsBackup;
FX_WCHAR m_wcFill;
FX_BOOL m_bReserveSpace;
FX_BOOL m_bLeftAlignment;
- FX_INT32 m_nIndex;
+ int32_t m_nIndex;
CFDE_TxtEdtBlock * m_pBlock;
};
class CFDE_TxtEdtField_Integer : public CFDE_TxtEdtField
{
public:
- CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
protected:
virtual ~CFDE_TxtEdtField_Integer() {}
- virtual FX_INT32 Validate(const CFX_WideString &wsText) const;
+ virtual int32_t Validate(const CFX_WideString &wsText) const;
private:
FX_BOOL m_bSign;
};
class CFDE_TxtEdtField_Float : public CFDE_TxtEdtField
{
public:
- CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ CFDE_TxtEdtField_Float(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
protected:
virtual ~CFDE_TxtEdtField_Float() {}
- virtual FX_INT32 Validate(const CFX_WideString & wsText) const;
+ virtual int32_t Validate(const CFX_WideString & wsText) const;
private:
FX_BOOL m_bSigned;
- FX_INT32 m_nIntPartlength;
- FX_INT32 m_nDecPartLength;
+ int32_t m_nIntPartlength;
+ int32_t m_nDecPartLength;
};
class CFDE_TxtEdtField_Password : public CFDE_TxtEdtField
{
public:
- CFDE_TxtEdtField_Password(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ CFDE_TxtEdtField_Password(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
protected:
virtual ~CFDE_TxtEdtField_Password() {}
@@ -183,33 +183,33 @@ private: class CFDE_TxtEdtField_String : public CFDE_TxtEdtField
{
public:
- CFDE_TxtEdtField_String(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
+ CFDE_TxtEdtField_String(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
protected:
virtual ~CFDE_TxtEdtField_String() {}
};
class CFDE_TxtEdtField_Fixed : public CFDE_TxtEdtField
{
public:
- CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock);
- virtual FX_INT32 Insert( FX_INT32 nIndex, const CFX_WideString &wsIns,
- FX_INT32 &nCaret, FX_BOOL &bBefore)
+ CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock);
+ virtual int32_t Insert( int32_t nIndex, const CFX_WideString &wsIns,
+ int32_t &nCaret, FX_BOOL &bBefore)
{
return FALSE;
}
- virtual FX_INT32 Delete( FX_INT32 nIndex, FX_INT32 nCount, CFX_WideString &wsDel,
- FX_INT32 &nCaret, FX_BOOL &bBefore)
+ virtual int32_t Delete( int32_t nIndex, int32_t nCount, CFX_WideString &wsDel,
+ int32_t &nCaret, FX_BOOL &bBefore)
{
return FALSE;
}
- virtual FX_INT32 Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_WideString &wsIns,
- CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore)
+ virtual int32_t Replace(int32_t nIndex, int32_t nCount, const CFX_WideString &wsIns,
+ CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore)
{
return FALSE;
}
virtual void GetDisplayText(CFX_WideString &wsDisplay);
- virtual FX_INT32 NormalizeCaretPos( FX_INT32 nIndex,
+ virtual int32_t NormalizeCaretPos( int32_t nIndex,
FDE_FORMAT_CARET_DIRECTION eDirection ) const;
- virtual FX_BOOL GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const
+ virtual FX_BOOL GetEditableRange(int32_t &nBgn, int32_t &nEnd) const
{
return FALSE;
}
diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp index f2cb0c57f2..1b2c01d3da 100644 --- a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp @@ -70,7 +70,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev ) if (lpChunk->nUsed != (m_nCurIndex + 1)) {
m_nCurIndex ++;
} else {
- FX_INT32 nEnd = m_pBuf->m_Chunks.GetSize() - 1;
+ int32_t nEnd = m_pBuf->m_Chunks.GetSize() - 1;
while (m_nCurChunk < nEnd) {
m_nCurChunk ++;
CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER lpChunkTemp = \
@@ -85,7 +85,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev ) return TRUE;
}
}
-void CFDE_TxtEdtBufIter::SetAt(FX_INT32 nIndex)
+void CFDE_TxtEdtBufIter::SetAt(int32_t nIndex)
{
FXSYS_assert(nIndex >= 0 && nIndex < m_pBuf->m_nTotal);
CFDE_TxtEdtBuf::FDE_CHUNKPLACE cp;
@@ -94,7 +94,7 @@ void CFDE_TxtEdtBufIter::SetAt(FX_INT32 nIndex) m_nCurChunk = cp.nChunkIndex;
m_nCurIndex = cp.nCharIndex;
}
-FX_INT32 CFDE_TxtEdtBufIter::GetAt() const
+int32_t CFDE_TxtEdtBufIter::GetAt() const
{
return m_nIndex;
}
@@ -143,7 +143,7 @@ IFX_CharIter * CFDE_TxtEdtBufIter::Clone() pIter->m_Alias = m_Alias;
return pIter;
}
-CFDE_TxtEdtBuf::CFDE_TxtEdtBuf(FX_INT32 nDefChunkSize )
+CFDE_TxtEdtBuf::CFDE_TxtEdtBuf(int32_t nDefChunkSize )
: m_nChunkSize(nDefChunkSize)
, m_nTotal(0)
, m_bChanged(FALSE)
@@ -162,17 +162,17 @@ CFDE_TxtEdtBuf::~CFDE_TxtEdtBuf() m_pAllocator->Release();
m_Chunks.RemoveAll();
}
-FX_BOOL CFDE_TxtEdtBuf::SetChunkSize(FX_INT32 nChunkSize)
+FX_BOOL CFDE_TxtEdtBuf::SetChunkSize(int32_t nChunkSize)
{
FXSYS_assert(nChunkSize);
ResetChunkBuffer(FDE_DEFCHUNKCOUNT, nChunkSize);
return TRUE;
}
-FX_INT32 CFDE_TxtEdtBuf::GetChunkSize() const
+int32_t CFDE_TxtEdtBuf::GetChunkSize() const
{
return m_nChunkSize;
}
-FX_INT32 CFDE_TxtEdtBuf::GetTextLength() const
+int32_t CFDE_TxtEdtBuf::GetTextLength() const
{
return m_nTotal;
}
@@ -180,19 +180,19 @@ void CFDE_TxtEdtBuf::SetText(const CFX_WideString &wsText) {
FXSYS_assert(!wsText.IsEmpty());
Clear(FALSE);
- FX_INT32 nTextLength = wsText.GetLength();
- FX_INT32 nNeedCount = ((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize();
- FX_INT32 i = 0;
+ int32_t nTextLength = wsText.GetLength();
+ int32_t nNeedCount = ((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize();
+ int32_t i = 0;
for (i = 0; i < nNeedCount; i ++) {
FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \
(m_nChunkSize - 1) * sizeof(FX_WCHAR));
lpChunk->nUsed = 0;
m_Chunks.Add(lpChunk);
}
- FX_INT32 nTotalCount = m_Chunks.GetSize();
+ int32_t nTotalCount = m_Chunks.GetSize();
FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(wsText);
- FX_INT32 nLeave = nTextLength;
- FX_INT32 nCopyedLength = m_nChunkSize;
+ int32_t nLeave = nTextLength;
+ int32_t nCopyedLength = m_nChunkSize;
for (i = 0; i < nTotalCount && nLeave > 0; i ++) {
if (nLeave < nCopyedLength) {
nCopyedLength = nLeave;
@@ -210,13 +210,13 @@ void CFDE_TxtEdtBuf::GetText(CFX_WideString &wsText) const {
GetRange(wsText, 0, m_nTotal);
}
-FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(FX_INT32 nIndex) const
+FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(int32_t nIndex) const
{
FXSYS_assert(nIndex >= 0 && nIndex < GetTextLength());
FDE_LPCHUNKHEADER pChunkHeader = NULL;
- FX_INT32 nTotal = 0;
- FX_INT32 nCount = m_Chunks.GetSize();
- FX_INT32 i = 0;
+ int32_t nTotal = 0;
+ int32_t nCount = m_Chunks.GetSize();
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
pChunkHeader = (FDE_LPCHUNKHEADER)m_Chunks[i];
nTotal += pChunkHeader->nUsed;
@@ -227,16 +227,16 @@ FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(FX_INT32 nIndex) const FXSYS_assert(pChunkHeader);
return pChunkHeader->wChars[pChunkHeader->nUsed - (nTotal - nIndex)];
}
-void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 nLength) const
+void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, int32_t nBegin, int32_t nLength) const
{
FDE_CHUNKPLACE cp;
Index2CP(nBegin, cp);
- FX_INT32 nLeave = nLength;
- FX_INT32 nCount = m_Chunks.GetSize();
+ int32_t nLeave = nLength;
+ int32_t nCount = m_Chunks.GetSize();
FX_LPWSTR lpDstBuf = wsText.GetBuffer(nLength);
- FX_INT32 nChunkIndex = cp.nChunkIndex;
+ int32_t nChunkIndex = cp.nChunkIndex;
FDE_LPCHUNKHEADER lpChunkHeader = (FDE_LPCHUNKHEADER)m_Chunks[nChunkIndex];
- FX_INT32 nCopyLength = lpChunkHeader->nUsed - cp.nCharIndex;
+ int32_t nCopyLength = lpChunkHeader->nUsed - cp.nCharIndex;
FX_LPWSTR lpSrcBuf = lpChunkHeader->wChars + cp.nCharIndex;
while (nLeave > 0) {
if (nLeave <= nCopyLength) {
@@ -255,17 +255,17 @@ void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 }
wsText.ReleaseBuffer();
}
-void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength )
+void CFDE_TxtEdtBuf::Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength )
{
FXSYS_assert(nPos >= 0 && nPos <= m_nTotal);
FDE_CHUNKPLACE cp;
Index2CP(nPos, cp);
- FX_INT32 nLengthTemp = nLength;
+ int32_t nLengthTemp = nLength;
if (cp.nCharIndex != 0) {
FDE_LPCHUNKHEADER lpNewChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \
(m_nChunkSize - 1) * sizeof(FX_WCHAR));
FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex];
- FX_INT32 nCopy = lpChunk->nUsed - cp.nCharIndex;
+ int32_t nCopy = lpChunk->nUsed - cp.nCharIndex;
FXSYS_memcpy(lpNewChunk->wChars, lpChunk->wChars + cp.nCharIndex, nCopy * sizeof(FX_WCHAR));
lpChunk->nUsed -= nCopy;
cp.nChunkIndex ++;
@@ -277,8 +277,8 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex - 1];
if (lpChunk->nUsed != m_nChunkSize) {
cp.nChunkIndex --;
- FX_INT32 nFree = m_nChunkSize - lpChunk->nUsed;
- FX_INT32 nCopy = FX_MIN(nLengthTemp, nFree);
+ int32_t nFree = m_nChunkSize - lpChunk->nUsed;
+ int32_t nCopy = FX_MIN(nLengthTemp, nFree);
FXSYS_memcpy(lpChunk->wChars + lpChunk->nUsed, lpText, nCopy * sizeof(FX_WCHAR));
lpText += nCopy;
nLengthTemp -= nCopy;
@@ -290,7 +290,7 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \
(m_nChunkSize - 1) * sizeof(FX_WCHAR));
FXSYS_assert(lpChunk);
- FX_INT32 nCopy = FX_MIN(nLengthTemp, m_nChunkSize);
+ int32_t nCopy = FX_MIN(nLengthTemp, m_nChunkSize);
FXSYS_memcpy(lpChunk->wChars, lpText, nCopy * sizeof(FX_WCHAR));
lpText += nCopy;
nLengthTemp -= nCopy;
@@ -301,17 +301,17 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) m_nTotal += nLength;
m_bChanged = TRUE;
}
-void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength )
+void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength )
{
FXSYS_assert(nLength > 0 && nIndex >= 0 && nIndex + nLength <= m_nTotal);
FDE_CHUNKPLACE cpEnd;
Index2CP(nIndex + nLength - 1, cpEnd);
m_nTotal -= nLength;
FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cpEnd.nChunkIndex];
- FX_INT32 nFirstPart = cpEnd.nCharIndex + 1;
- FX_INT32 nMovePart = lpChunk->nUsed - nFirstPart;
+ int32_t nFirstPart = cpEnd.nCharIndex + 1;
+ int32_t nMovePart = lpChunk->nUsed - nFirstPart;
if (nMovePart != 0) {
- FX_INT32 nDelete = FX_MIN(nFirstPart, nLength);
+ int32_t nDelete = FX_MIN(nFirstPart, nLength);
FXSYS_memmove(lpChunk->wChars + nFirstPart - nDelete, \
lpChunk->wChars + nFirstPart, nMovePart * sizeof(FX_WCHAR));
lpChunk->nUsed -= nDelete;
@@ -320,7 +320,7 @@ void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength ) }
while (nLength > 0) {
lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cpEnd.nChunkIndex];
- FX_INT32 nDeleted = FX_MIN(lpChunk->nUsed, nLength);
+ int32_t nDeleted = FX_MIN(lpChunk->nUsed, nLength);
lpChunk->nUsed -= nDeleted;
if (lpChunk->nUsed == 0) {
m_pAllocator->Free(lpChunk);
@@ -334,8 +334,8 @@ void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength ) }
void CFDE_TxtEdtBuf::Clear(FX_BOOL bRelease )
{
- FX_INT32 i = 0;
- FX_INT32 nCount = m_Chunks.GetSize();
+ int32_t i = 0;
+ int32_t nCount = m_Chunks.GetSize();
if (bRelease) {
while (i < nCount) {
m_pAllocator->Free(m_Chunks[i++]);
@@ -357,11 +357,11 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause * pPause ) if (m_nTotal == 0) {
return TRUE;
}
- FX_INT32 nCount = m_Chunks.GetSize();
+ int32_t nCount = m_Chunks.GetSize();
if (nCount == 0) {
return TRUE;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for ( ; i < nCount; i ++) {
FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[i];
if (lpChunk->nUsed == 0) {
@@ -396,7 +396,7 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause * pPause ) m_bChanged = FALSE;
return TRUE;
}
-void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSize)
+void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize)
{
FXSYS_assert(nChunkSize);
FXSYS_assert(nDefChunkCount);
@@ -406,7 +406,7 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSi }
m_Chunks.RemoveAll();
m_nChunkSize = nChunkSize;
- FX_INT32 nChunkLength = sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR);
+ int32_t nChunkLength = sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR);
m_pAllocator = FX_CreateAllocator(FX_ALLOCTYPE_Fixed, nDefChunkCount, nChunkLength);
FXSYS_assert(m_pAllocator);
FDE_LPCHUNKHEADER lpChunkHeader = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(nChunkLength);
@@ -415,16 +415,16 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSi m_Chunks.Add(lpChunkHeader);
m_nTotal = 0;
}
-FX_INT32 CFDE_TxtEdtBuf::CP2Index(const FDE_CHUNKPLACE & cp) const
+int32_t CFDE_TxtEdtBuf::CP2Index(const FDE_CHUNKPLACE & cp) const
{
- FX_INT32 nTotal = cp.nCharIndex;
- FX_INT32 i = 0;
+ int32_t nTotal = cp.nCharIndex;
+ int32_t i = 0;
for (i = 0; i < cp.nChunkIndex; i ++) {
nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed;
}
return nTotal;
}
-void CFDE_TxtEdtBuf::Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const
+void CFDE_TxtEdtBuf::Index2CP(int32_t nIndex, FDE_CHUNKPLACE & cp) const
{
FXSYS_assert(nIndex <= GetTextLength());
if (nIndex == m_nTotal) {
@@ -432,9 +432,9 @@ void CFDE_TxtEdtBuf::Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const cp.nCharIndex = ((FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex])->nUsed;
return;
}
- FX_INT32 i = 0;
- FX_INT32 nTotal = 0;
- FX_INT32 nCount = m_Chunks.GetSize();
+ int32_t i = 0;
+ int32_t nTotal = 0;
+ int32_t nCount = m_Chunks.GetSize();
for ( ; i < nCount; i ++) {
nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed;
if (nTotal > nIndex) {
diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.h b/xfa/src/fee/src/fee/fde_txtedtbuf.h index 7a9100c833..9e54a0d2f3 100644 --- a/xfa/src/fee/src/fee/fde_txtedtbuf.h +++ b/xfa/src/fee/src/fee/fde_txtedtbuf.h @@ -21,21 +21,21 @@ public: virtual void Release();
virtual FX_BOOL Next(FX_BOOL bPrev = FALSE);
virtual FX_WCHAR GetChar();
- virtual void SetAt(FX_INT32 nIndex);
- virtual FX_INT32 GetAt() const;
+ virtual void SetAt(int32_t nIndex);
+ virtual int32_t GetAt() const;
virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const;
virtual IFX_CharIter * Clone();
protected:
~CFDE_TxtEdtBufIter();
private:
CFDE_TxtEdtBuf* m_pBuf;
- FX_INT32 m_nCurChunk;
- FX_INT32 m_nCurIndex;
- FX_INT32 m_nIndex;
+ int32_t m_nCurChunk;
+ int32_t m_nCurIndex;
+ int32_t m_nIndex;
FX_BOOL m_bInField;
#ifdef FDE_USEFORMATBLOCK
FX_BOOL m_bForDisplay;
- FX_INT32 m_nAliasCount;
+ int32_t m_nAliasCount;
#endif
FX_WCHAR m_Alias;
};
@@ -43,32 +43,32 @@ class CFDE_TxtEdtBuf : public IFDE_TxtEdtBuf {
friend class CFDE_TxtEdtBufIter;
struct _FDE_CHUNKHEADER {
- FX_INT32 nUsed;
+ int32_t nUsed;
FX_WCHAR wChars[1];
};
typedef _FDE_CHUNKHEADER FDE_CHUNKHEADER;
typedef _FDE_CHUNKHEADER* FDE_LPCHUNKHEADER;
struct _FDE_CHUNKPLACE {
- FX_INT32 nChunkIndex;
- FX_INT32 nCharIndex;
+ int32_t nChunkIndex;
+ int32_t nCharIndex;
};
typedef _FDE_CHUNKPLACE FDE_CHUNKPLACE;
typedef _FDE_CHUNKPLACE* FDE_LPCHUNKPLACE;
public:
- CFDE_TxtEdtBuf(FX_INT32 nDefChunkSize = FDE_DEFCHUNKLENGTH);
+ CFDE_TxtEdtBuf(int32_t nDefChunkSize = FDE_DEFCHUNKLENGTH);
virtual void Release();
- virtual FX_BOOL SetChunkSize(FX_INT32 nChunkSize);
- virtual FX_INT32 GetChunkSize() const;
- virtual FX_INT32 GetTextLength() const;
+ virtual FX_BOOL SetChunkSize(int32_t nChunkSize);
+ virtual int32_t GetChunkSize() const;
+ virtual int32_t GetTextLength() const;
virtual void SetText(const CFX_WideString &wsText);
virtual void GetText(CFX_WideString &wsText) const;
- virtual FX_WCHAR GetCharByIndex(FX_INT32 nIndex) const;
- virtual void GetRange(CFX_WideString &wsText, FX_INT32 nBegine, FX_INT32 nCount = -1) const;
+ virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const;
+ virtual void GetRange(CFX_WideString &wsText, int32_t nBegine, int32_t nCount = -1) const;
- virtual void Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength = 1);
- virtual void Delete(FX_INT32 nIndex, FX_INT32 nLength = 1);
+ virtual void Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength = 1);
+ virtual void Delete(int32_t nIndex, int32_t nLength = 1);
virtual void Clear(FX_BOOL bRelease = TRUE);
virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL);
@@ -76,13 +76,13 @@ public: protected:
virtual ~CFDE_TxtEdtBuf();
private:
- void ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSize);
- FX_INT32 CP2Index(const FDE_CHUNKPLACE & cp) const;
- void Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const;
+ void ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize);
+ int32_t CP2Index(const FDE_CHUNKPLACE & cp) const;
+ void Index2CP(int32_t nIndex, FDE_CHUNKPLACE & cp) const;
- FX_INT32 m_nChunkSize;
+ int32_t m_nChunkSize;
- FX_INT32 m_nTotal;
+ int32_t m_nTotal;
FX_BOOL m_bChanged;
CFX_PtrArray m_Chunks;
IFX_MEMAllocator * m_pAllocator;
diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.cpp b/xfa/src/fee/src/fee/fde_txtedtengine.cpp index 2dbd1384cb..78486835ac 100644 --- a/xfa/src/fee/src/fee/fde_txtedtengine.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtengine.cpp @@ -67,9 +67,9 @@ CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() m_pTextBreak = NULL;
}
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount > 0) {
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < nBlockCount; i ++) {
CFDE_TxtEdtBlock * pBlock = m_BlockArray[i];
delete pBlock;
@@ -100,44 +100,44 @@ const FDE_TXTEDTPARAMS * CFDE_TxtEdtEngine::GetEditParams() const {
return &m_Param;
}
-FX_INT32 CFDE_TxtEdtEngine::CountPages() const
+int32_t CFDE_TxtEdtEngine::CountPages() const
{
if (m_nLineCount == 0) {
return 0;
}
return ((m_nLineCount - 1) / m_nPageLineCount) + 1;
}
-IFDE_TxtEdtPage * CFDE_TxtEdtEngine::GetPage(FX_INT32 nIndex)
+IFDE_TxtEdtPage * CFDE_TxtEdtEngine::GetPage(int32_t nIndex)
{
if (m_PagePtrArray.GetSize() <= nIndex) {
return NULL;
}
return (IFDE_TxtEdtPage*)m_PagePtrArray[nIndex];
}
-FX_BOOL CFDE_TxtEdtEngine::SetBufChunkSize(FX_INT32 nChunkSize)
+FX_BOOL CFDE_TxtEdtEngine::SetBufChunkSize(int32_t nChunkSize)
{
return m_pTxtBuf->SetChunkSize(nChunkSize);
}
void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream *pStream)
{
ResetEngine();
- FX_INT32 nIndex = 0;
+ int32_t nIndex = 0;
if (pStream != NULL && pStream->GetLength()) {
- FX_INT32 nStreamLength = pStream->GetLength();
+ int32_t nStreamLength = pStream->GetLength();
FX_BOOL bValid = TRUE;
if (m_nLimit > 0 && nStreamLength > m_nLimit) {
bValid = FALSE;
}
FX_BOOL bPreIsCR = FALSE;
if (bValid) {
- FX_BYTE bom[4];
- FX_INT32 nPos = pStream->GetBOM(bom);
+ uint8_t bom[4];
+ int32_t nPos = pStream->GetBOM(bom);
pStream->Seek(FX_STREAMSEEK_Begin, nPos);
- FX_INT32 bEos = FALSE;
- FX_INT32 nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize());
+ int32_t bEos = FALSE;
+ int32_t nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize());
FX_LPWSTR lpwstr = (FX_LPWSTR)FDE_Alloc(nPlateSize * sizeof(FX_WCHAR));
FXSYS_assert(lpwstr);
- FX_INT32 nRead = 0;
+ int32_t nRead = 0;
while (!bEos) {
nRead = pStream->ReadString(lpwstr, nPlateSize, bEos);
bPreIsCR = ReplaceParagEnd(lpwstr, nRead, bPreIsCR);
@@ -153,7 +153,7 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream *pStream) void CFDE_TxtEdtEngine::SetText(const CFX_WideString &wsText)
{
ResetEngine();
- FX_INT32 nLength = wsText.GetLength();
+ int32_t nLength = wsText.GetLength();
if (nLength > 0) {
CFX_WideString wsTemp;
FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nLength);
@@ -169,18 +169,18 @@ void CFDE_TxtEdtEngine::SetText(const CFX_WideString &wsText) m_pTxtBuf->Insert(nLength, &m_wLineEnd, 1);
RebuildParagraphs();
}
-FX_INT32 CFDE_TxtEdtEngine::GetTextLength() const
+int32_t CFDE_TxtEdtEngine::GetTextLength() const
{
return GetTextBufLength();
}
-void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount )
+void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount )
{
- FX_INT32 nTextBufLength = GetTextBufLength();
+ int32_t nTextBufLength = GetTextBufLength();
if (nCount == -1) {
nCount = nTextBufLength - nStart;
}
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount == 0 || m_wsFixText.IsEmpty()) {
m_pTxtBuf->GetRange(wsText, nStart, nCount);
return;
@@ -188,12 +188,12 @@ void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT3 CFX_WideString wsTemp;
FX_LPCWSTR lpFixBuffer = FX_LPCWSTR(m_wsFixText);
FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nTextBufLength);
- FX_INT32 nRealLength = 0;
- FX_INT32 nPrePos = 0;
- for (FX_INT32 i = 0; i < nBlockCount; i ++) {
+ int32_t nRealLength = 0;
+ int32_t nPrePos = 0;
+ for (int32_t i = 0; i < nBlockCount; i ++) {
CFDE_TxtEdtBlock *pBlock = m_BlockArray[i];
- FX_INT32 nPos = pBlock->GetPos();
- FX_INT32 nCopyLength = nPos - nPrePos;
+ int32_t nPos = pBlock->GetPos();
+ int32_t nCopyLength = nPos - nPrePos;
FXSYS_memcpy(lpBuffer + nRealLength, lpFixBuffer + nPrePos, nCopyLength * sizeof(FX_WCHAR));
nRealLength += nCopyLength;
nPrePos = nPos;
@@ -203,15 +203,15 @@ void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT3 FXSYS_memcpy(lpBuffer + nRealLength, FX_LPCWSTR(wsBlock), nCopyLength * sizeof(FX_WCHAR));
nRealLength += nCopyLength;
}
- FX_INT32 nLeftLength = m_wsFixText.GetLength() - nPrePos;
+ int32_t nLeftLength = m_wsFixText.GetLength() - nPrePos;
if (nLeftLength > 0) {
FXSYS_memcpy(lpBuffer + nRealLength, lpFixBuffer + nPrePos, nLeftLength * sizeof(FX_WCHAR));
nRealLength += nLeftLength;
}
wsTemp.ReleaseBuffer(nRealLength);
- FX_INT32 nRealBgn = GetRealIndex(nStart);
- FX_INT32 nRealEnd = GetRealIndex(nStart + nCount - 1);
- FX_INT32 nRealCount = nRealEnd - nRealBgn;
+ int32_t nRealBgn = GetRealIndex(nStart);
+ int32_t nRealEnd = GetRealIndex(nStart + nCount - 1);
+ int32_t nRealCount = nRealEnd - nRealBgn;
FX_LPWSTR lpDestBuf = wsText.GetBuffer(nRealCount);
FXSYS_memcpy(lpDestBuf, FX_LPCWSTR(wsTemp) + nRealBgn, nRealCount * sizeof(FX_WCHAR));
wsText.ReleaseBuffer();
@@ -225,19 +225,19 @@ void CFDE_TxtEdtEngine::ClearText() {
DeleteRange(0, -1);
}
-FX_INT32 CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret) const
+int32_t CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret) const
{
rtCaret = m_rtCaret;
return m_nCaret;
}
-FX_INT32 CFDE_TxtEdtEngine::GetCaretPos() const
+int32_t CFDE_TxtEdtEngine::GetCaretPos() const
{
if (IsLocked()) {
return 0;
}
return m_nCaret + (m_bBefore ? 0 : 1);
}
-FX_INT32 CFDE_TxtEdtEngine::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore)
+int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore)
{
if (IsLocked()) {
return 0;
@@ -265,7 +265,7 @@ FX_INT32 CFDE_TxtEdtEngine::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore) m_nAnchorPos = -1;
return m_nCaret;
}
-FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
+int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
FX_BOOL bShift ,
FX_BOOL bCtrl )
{
@@ -288,8 +288,8 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, m_nAnchorPos = -1;
}
FX_BOOL bVertical = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
- FX_INT32 nCaret = m_nCaret;
- FX_INT32 nCaretPage = m_nCaretPage;
+ int32_t nCaret = m_nCaret;
+ int32_t nCaretPage = m_nCaretPage;
switch (eMoveCaret) {
case MC_Left: {
if (bVertical) {
@@ -299,7 +299,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, }
} else {
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = MoveBackward(bBefore);
+ int32_t nIndex = MoveBackward(bBefore);
#ifdef FDE_USEFORMATBLOCK
if (m_BlockArray.GetSize()) {
nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_BACKWARD, bBefore);
@@ -322,7 +322,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, }
} else {
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = MoveForward(bBefore);
+ int32_t nIndex = MoveForward(bBefore);
#ifdef FDE_USEFORMATBLOCK
if (m_BlockArray.GetSize()) {
if (nIndex == -1) {
@@ -340,7 +340,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, case MC_Up: {
if (bVertical) {
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = MoveBackward(bBefore);
+ int32_t nIndex = MoveBackward(bBefore);
#ifdef FDE_USEFORMATBLOCK
if (m_BlockArray.GetSize()) {
nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_BACKWARD, bBefore);
@@ -360,7 +360,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, case MC_Down: {
if (bVertical) {
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = MoveForward(bBefore);
+ int32_t nIndex = MoveForward(bBefore);
#ifdef FDE_USEFORMATBLOCK
if (m_BlockArray.GetSize()) {
nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_FORWARD, bBefore);
@@ -427,29 +427,29 @@ FX_BOOL CFDE_TxtEdtEngine::IsLocked() const {
return m_bLock;
}
-FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength)
+int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength)
{
if (IsLocked()) {
return FDE_TXTEDT_MODIFY_RET_F_Locked;
}
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount) {
if (m_Param.dwMode & FDE_TEXTEDITMODE_FIELD_TAB && nLength == 1 && lpText[0] == L'\t') {
return Move2NextEditableField(nStart) ? FDE_TXTEDT_MODIFY_RET_T_Tab : \
FDE_TXTEDT_MODIFY_RET_F_Tab;
}
- FX_INT32 nSelRangeCount = CountSelRanges();
+ int32_t nSelRangeCount = CountSelRanges();
if (nSelRangeCount > 0) {
if (nSelRangeCount > 1) {
return FDE_TXTEDT_MODIFY_RET_F_Boundary;
}
- FX_INT32 nSelStart;
- FX_INT32 nSelCount;
+ int32_t nSelStart;
+ int32_t nSelCount;
nSelCount = GetSelRange(0, nSelStart);
- FX_INT32 nSelEnd = nSelStart + nSelCount;
- FX_INT32 nBgn = 0;
- FX_INT32 nEnd = 0;
+ int32_t nSelEnd = nSelStart + nSelCount;
+ int32_t nBgn = 0;
+ int32_t nEnd = 0;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bInField = GetFieldBoundary(nSelStart, nBgn, nEnd, pField);
if (nSelEnd > nEnd) {
@@ -459,9 +459,9 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 pField->Backup();
FX_BOOL bBefore = FALSE;
CFX_WideString wsDel;
- FX_INT32 nCaret;
- FX_INT32 nIndexInField = nSelStart - nBgn;
- FX_INT32 nRet = pField->Replace(nSelStart - nBgn, nSelCount, CFX_WideStringC(lpText, nLength), wsDel, nCaret, bBefore);
+ int32_t nCaret;
+ int32_t nIndexInField = nSelStart - nBgn;
+ int32_t nRet = pField->Replace(nSelStart - nBgn, nSelCount, CFX_WideStringC(lpText, nLength), wsDel, nCaret, bBefore);
switch(nRet) {
case FDE_FORMAT_FIELD_INSERT_RET_F_FULL:
pField->Restore();
@@ -489,7 +489,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 }
}
Replace(nBgn, nEnd - nBgn + 1, wsDisplay);
- FX_INT32 nNewCaret = nBgn + nCaret;
+ int32_t nNewCaret = nBgn + nCaret;
if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)) {
IFDE_TxtEdtDoRecord * pRecord = FX_NEW CFDE_TxtEdtDoRecord_FieldReplace(this, \
m_nCaret, nNewCaret, pField, nIndexInField, nBgn, wsDisplay.GetLength(), \
@@ -503,16 +503,16 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
}
- FX_INT32 nBgn = 0;
- FX_INT32 nEnd = 0;
+ int32_t nBgn = 0;
+ int32_t nEnd = 0;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bInField = GetFieldBoundary(m_nCaret, nBgn, nEnd, pField);
- FX_INT32 nCaretInField = m_nCaret - nBgn;
+ int32_t nCaretInField = m_nCaret - nBgn;
FX_BOOL bBefore = FALSE;
if (bInField) {
pField->Backup();
CFX_WideStringC wsIns(lpText, nLength);
- FX_INT32 nRet = pField->Insert(nCaretInField, wsIns, nCaretInField, bBefore);
+ int32_t nRet = pField->Insert(nCaretInField, wsIns, nCaretInField, bBefore);
FX_BOOL bFull = FALSE;
switch (nRet) {
case FDE_FORMAT_FIELD_INSERT_RET_S_NORMAL:
@@ -554,7 +554,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord);
pRecord->Release();
}
- FX_INT32 nCaretPos = nBgn + nCaretInField;
+ int32_t nCaretPos = nBgn + nCaretInField;
if (m_Param.dwMode & FDE_TEXTEDITMODE_FIELD_AUTO && bFull && nCaretPos == nEnd) {
if (Move2NextEditableField(nEnd, TRUE, FALSE)) {
return TRUE;
@@ -574,14 +574,14 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 wsTemp.ReleaseBuffer(nLength);
FX_BOOL bPart = FALSE;
if (m_nLimit > 0) {
- FX_INT32 nTotalLength = GetTextBufLength();
- FX_INT32 nDelLength = 0;
- FX_INT32 nCount = m_SelRangePtrArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nTotalLength = GetTextBufLength();
+ int32_t nDelLength = 0;
+ int32_t nCount = m_SelRangePtrArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
FDE_LPTXTEDTSELRANGE lpSelRange = m_SelRangePtrArr.GetAt(i);
nTotalLength -= lpSelRange->nCount;
}
- FX_INT32 nExpectLength = nTotalLength + nLength;
+ int32_t nExpectLength = nTotalLength + nLength;
if (nTotalLength == m_nLimit) {
return FDE_TXTEDT_MODIFY_RET_F_Full;
}
@@ -591,14 +591,14 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 }
}
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) || (m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz)) {
- FX_INT32 nTemp = nLength;
+ int32_t nTemp = nLength;
if (m_Param.dwMode & FDE_TEXTEDITMODE_Password) {
CFX_WideString wsText;
while (nLength > 0) {
GetPreInsertText(wsText, m_nCaret, lpBuffer, nLength);
- FX_INT32 nTotal = wsText.GetLength();
+ int32_t nTotal = wsText.GetLength();
FX_LPWSTR lpBuf = wsText.GetBuffer(nTotal);
- for (FX_INT32 i = 0; i < nTotal; i ++) {
+ for (int32_t i = 0; i < nTotal; i ++) {
lpBuf[i] = m_wcAliasChar;
}
wsText.ReleaseBuffer(nTotal);
@@ -657,7 +657,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
return bPart ? FDE_TXTEDT_MODIFY_RET_S_Part : FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace )
+int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, FX_BOOL bBackspace )
{
if (IsLocked()) {
return FDE_TXTEDT_MODIFY_RET_F_Locked;
@@ -667,23 +667,23 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount > 0) {
if (bBackspace) {
nStart --;
}
- FX_INT32 nCount = 1;
- FX_INT32 nBgn = 0;
- FX_INT32 nEnd = 0;
+ int32_t nCount = 1;
+ int32_t nBgn = 0;
+ int32_t nEnd = 0;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bInField = GetFieldBoundary(nStart, nBgn, nEnd, pField);
- FX_INT32 nCaretInField = nStart - nBgn;
+ int32_t nCaretInField = nStart - nBgn;
FX_BOOL bBefore = FALSE;
if (bInField && !pField->IsFix()) {
pField->Backup();
CFX_WideString wsDel;
- FX_INT32 nCaret = 0;
- FX_INT32 nRet = pField->Delete(nCaretInField, nCount, wsDel, nCaret, bBefore);
+ int32_t nCaret = 0;
+ int32_t nRet = pField->Delete(nCaretInField, nCount, wsDel, nCaret, bBefore);
nCaret += nBgn;
switch (nRet) {
case FDE_FORMAT_FIELD_DELETE_RET_S:
@@ -719,7 +719,7 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) return FDE_TXTEDT_MODIFY_RET_F_Boundary;
}
#endif
- FX_INT32 nCount = 1;
+ int32_t nCount = 1;
if (bBackspace) {
if (nStart == 0) {
return FDE_TXTEDT_MODIFY_RET_F_Boundary;
@@ -762,7 +762,7 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-FX_INT32 CFDE_TxtEdtEngine::DeleteRange(FX_INT32 nStart, FX_INT32 nCount )
+int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, int32_t nCount )
{
if (IsLocked()) {
return FDE_TXTEDT_MODIFY_RET_F_Locked;
@@ -785,7 +785,7 @@ FX_INT32 CFDE_TxtEdtEngine::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) SetCaretPos(nStart, TRUE);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace)
+int32_t CFDE_TxtEdtEngine::Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace)
{
if (IsLocked()) {
return FDE_TXTEDT_MODIFY_RET_F_Locked;
@@ -808,7 +808,7 @@ FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX if (nLength > 0) {
Inner_DeleteRange(nStart, nLength);
}
- FX_INT32 nTextLength = wsReplace.GetLength();
+ int32_t nTextLength = wsReplace.GetLength();
if (nTextLength > 0) {
Inner_Insert(nStart, FX_LPCWSTR(wsReplace), nTextLength);
}
@@ -826,7 +826,7 @@ FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-void CFDE_TxtEdtEngine::SetLimit(FX_INT32 nLimit)
+void CFDE_TxtEdtEngine::SetLimit(int32_t nLimit)
{
m_nLimit = nLimit;
}
@@ -834,7 +834,7 @@ void CFDE_TxtEdtEngine::SetAliasChar(FX_WCHAR wcAlias) {
m_wcAliasChar = wcAlias;
}
-void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat)
+void CFDE_TxtEdtEngine::SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat)
{
#ifdef FDE_USEFORMATBLOCK
if (m_nFixLength == -1) {
@@ -843,9 +843,9 @@ void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &ws GetText(m_wsFixText, 0, -1);
}
FX_BOOL bInBlock = FALSE;
- FX_INT32 nCharIndex = 0;
- FX_INT32 nBlockIndex = 0;
- FX_INT32 nBlockPos = -1;
+ int32_t nCharIndex = 0;
+ int32_t nBlockIndex = 0;
+ int32_t nBlockPos = -1;
FX_WCHAR wc;
CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE);
pIter->SetAt(0);
@@ -881,7 +881,7 @@ void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &ws }
#endif
}
-FX_INT32 CFDE_TxtEdtEngine::CountEditBlocks() const
+int32_t CFDE_TxtEdtEngine::CountEditBlocks() const
{
#ifdef FDE_USEFORMATBLOCK
return m_BlockArray.GetSize();
@@ -889,14 +889,14 @@ FX_INT32 CFDE_TxtEdtEngine::CountEditBlocks() const return 0;
#endif
}
-void CFDE_TxtEdtEngine::GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const
+void CFDE_TxtEdtEngine::GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const
{
#ifdef FDE_USEFORMATBLOCK
CFDE_TxtEdtBlock * pBlock = m_BlockArray[nIndex];
pBlock->GetBlockText(wsBlockText);
#endif
}
-FX_INT32 CFDE_TxtEdtEngine::CountEditFields(FX_INT32 nBlockIndex) const
+int32_t CFDE_TxtEdtEngine::CountEditFields(int32_t nBlockIndex) const
{
#ifdef FDE_USEFORMATBLOCK
CFDE_TxtEdtBlock * pBlock = m_BlockArray[nBlockIndex];
@@ -905,7 +905,7 @@ FX_INT32 CFDE_TxtEdtEngine::CountEditFields(FX_INT32 nBlockIndex) const return 0;
#endif
}
-void CFDE_TxtEdtEngine::GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const
+void CFDE_TxtEdtEngine::GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const
{
#ifdef FDE_USEFORMATBLOCK
CFDE_TxtEdtBlock * pBlock = m_BlockArray[nBlockIndex];
@@ -922,11 +922,11 @@ void CFDE_TxtEdtEngine::EndEdit() #ifdef FDE_USEFORMATBLOCK
#endif
}
-void CFDE_TxtEdtEngine::RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount )
+void CFDE_TxtEdtEngine::RemoveSelRange(int32_t nStart, int32_t nCount )
{
FDE_LPTXTEDTSELRANGE lpTemp = NULL;
- FX_INT32 nRangeCount = m_SelRangePtrArr.GetSize();
- FX_INT32 i = 0;
+ int32_t nRangeCount = m_SelRangePtrArr.GetSize();
+ int32_t i = 0;
for (i = 0; i < nRangeCount; i ++) {
lpTemp = m_SelRangePtrArr[i];
if (lpTemp->nStart == nStart && lpTemp->nCount == nCount) {
@@ -937,12 +937,12 @@ void CFDE_TxtEdtEngine::RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount ) }
return;
}
-void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount )
+void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount )
{
if (nCount == -1) {
nCount = GetTextLength() - nStart;
}
- FX_INT32 nSize = m_SelRangePtrArr.GetSize();
+ int32_t nSize = m_SelRangePtrArr.GetSize();
if (nSize <= 0) {
FDE_LPTXTEDTSELRANGE lpSelRange = FX_NEW FDE_TXTEDTSELRANGE;
lpSelRange->nStart = nStart;
@@ -961,14 +961,14 @@ void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) m_Param.pEventSink->On_SelChanged(this);
return;
}
- FX_INT32 nEnd = nStart + nCount - 1;
+ int32_t nEnd = nStart + nCount - 1;
FX_BOOL bBegin = FALSE;
- FX_INT32 nRangeBgn = 0;
- FX_INT32 nRangeCnt = 0;
- for (FX_INT32 i = 0; i < nSize; i ++) {
+ int32_t nRangeBgn = 0;
+ int32_t nRangeCnt = 0;
+ for (int32_t i = 0; i < nSize; i ++) {
lpTemp = m_SelRangePtrArr[i];
- FX_INT32 nTempBgn = lpTemp->nStart;
- FX_INT32 nTempEnd = nTempBgn + lpTemp->nCount - 1;
+ int32_t nTempBgn = lpTemp->nStart;
+ int32_t nTempEnd = nTempBgn + lpTemp->nCount - 1;
if (bBegin) {
if (nEnd < nTempBgn) {
break;
@@ -1007,20 +1007,20 @@ void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) m_Param.pEventSink->On_SelChanged(this);
return;
}
-FX_INT32 CFDE_TxtEdtEngine::CountSelRanges()
+int32_t CFDE_TxtEdtEngine::CountSelRanges()
{
return m_SelRangePtrArr.GetSize();
}
-FX_INT32 CFDE_TxtEdtEngine::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFDE_TxtEdtEngine::GetSelRange(int32_t nIndex, int32_t &nStart)
{
nStart = m_SelRangePtrArr[nIndex]->nStart;
return m_SelRangePtrArr[nIndex]->nCount;
}
void CFDE_TxtEdtEngine::ClearSelection()
{
- FX_INT32 nCount = m_SelRangePtrArr.GetSize();
+ int32_t nCount = m_SelRangePtrArr.GetSize();
FDE_LPTXTEDTSELRANGE lpRange = NULL;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
lpRange = m_SelRangePtrArr[i];
if (lpRange != NULL) {
@@ -1067,7 +1067,7 @@ FX_BOOL CFDE_TxtEdtEngine::Undo(FX_BSTR bsUndo) pDoRecord->Release();
return bOK;
}
-FX_INT32 CFDE_TxtEdtEngine::StartLayout()
+int32_t CFDE_TxtEdtEngine::StartLayout()
{
Lock();
RemoveAllPages();
@@ -1075,11 +1075,11 @@ FX_INT32 CFDE_TxtEdtEngine::StartLayout() m_nLineCount = 0;
return 0;
}
-FX_INT32 CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause)
+int32_t CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause)
{
- FX_INT32 nCount = m_ParagPtrArray.GetSize();
+ int32_t nCount = m_ParagPtrArray.GetSize();
CFDE_TxtEdtParag * pParag = NULL;
- FX_INT32 nLineCount = 0;
+ int32_t nLineCount = 0;
for (; m_nLayoutPos < nCount; m_nLayoutPos ++) {
pParag = m_ParagPtrArray[m_nLayoutPos];
pParag->CalcLines();
@@ -1095,11 +1095,11 @@ FX_INT32 CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause) void CFDE_TxtEdtEngine::EndLayout()
{
UpdatePages();
- FX_INT32 nLength = GetTextLength();
+ int32_t nLength = GetTextLength();
if (m_nCaret > nLength) {
m_nCaret = nLength;
}
- FX_INT32 nIndex = m_nCaret;
+ int32_t nIndex = m_nCaret;
if (!m_bBefore) {
nIndex --;
}
@@ -1114,7 +1114,7 @@ IFDE_TxtEdtBuf * CFDE_TxtEdtEngine::GetTextBuf() const {
return (IFDE_TxtEdtBuf*)m_pTxtBuf;
}
-FX_INT32 CFDE_TxtEdtEngine::GetTextBufLength() const
+int32_t CFDE_TxtEdtEngine::GetTextBufLength() const
{
return m_pTxtBuf->GetTextLength() - 1;
}
@@ -1122,19 +1122,19 @@ IFX_TxtBreak * CFDE_TxtEdtEngine::GetTextBreak() const {
return m_pTextBreak;
}
-FX_INT32 CFDE_TxtEdtEngine::GetLineCount() const
+int32_t CFDE_TxtEdtEngine::GetLineCount() const
{
return m_nLineCount;
}
-FX_INT32 CFDE_TxtEdtEngine::GetPageLineCount() const
+int32_t CFDE_TxtEdtEngine::GetPageLineCount() const
{
return m_nPageLineCount;
}
-FX_INT32 CFDE_TxtEdtEngine::CountParags() const
+int32_t CFDE_TxtEdtEngine::CountParags() const
{
return m_ParagPtrArray.GetSize();
}
-IFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(FX_INT32 nParagIndex) const
+IFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(int32_t nParagIndex) const
{
return m_ParagPtrArray[nParagIndex];
}
@@ -1145,13 +1145,13 @@ IFX_CharIter* CFDE_TxtEdtEngine::CreateCharIter() }
return FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf);
}
-FX_INT32 CFDE_TxtEdtEngine::Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLineofParag, \
- FX_INT32 nLineIndex, FX_INT32 &nStartLine) const
+int32_t CFDE_TxtEdtEngine::Line2Parag(int32_t nStartParag, int32_t nStartLineofParag, \
+ int32_t nLineIndex, int32_t &nStartLine) const
{
- FX_INT32 nLineTotal = nStartLineofParag;
- FX_INT32 nCount = m_ParagPtrArray.GetSize();
+ int32_t nLineTotal = nStartLineofParag;
+ int32_t nCount = m_ParagPtrArray.GetSize();
CFDE_TxtEdtParag * pParag = NULL;
- FX_INT32 i = nStartParag;
+ int32_t i = nStartParag;
for (; i < nCount; i ++) {
pParag = m_ParagPtrArray[i];
nLineTotal += pParag->m_nLineCount;
@@ -1162,24 +1162,24 @@ FX_INT32 CFDE_TxtEdtEngine::Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLine nStartLine = nLineTotal - pParag->m_nLineCount;
return i;
}
-void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nLength)
+void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString &wsText, int32_t nIndex, int32_t nLength)
{
GetText(wsText, 0, GetTextBufLength());
wsText.Delete(nIndex, nLength);
}
-void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex, FX_LPCWSTR lpText, FX_INT32 nLength)
+void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, int32_t nIndex, FX_LPCWSTR lpText, int32_t nLength)
{
GetText(wsText, 0, GetTextBufLength());
- FX_INT32 nSelIndex = 0;
- FX_INT32 nSelLength = 0;
- FX_INT32 nSelCount = CountSelRanges();
+ int32_t nSelIndex = 0;
+ int32_t nSelLength = 0;
+ int32_t nSelCount = CountSelRanges();
while (nSelCount --) {
nSelLength = GetSelRange(nSelCount, nSelIndex);
wsText.Delete(nSelIndex, nSelLength);
nIndex = nSelIndex;
}
CFX_WideString wsTemp;
- FX_INT32 nOldLength = wsText.GetLength();
+ int32_t nOldLength = wsText.GetLength();
FX_LPCWSTR pOldBuffer = FX_LPCWSTR(wsText);
FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nOldLength + nLength);
FXSYS_memcpy(lpBuffer, pOldBuffer, (nIndex) * sizeof(FX_WCHAR));
@@ -1188,43 +1188,43 @@ void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex wsTemp.ReleaseBuffer(nOldLength + nLength);
wsText = wsTemp;
}
-void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nOriginLength, FX_LPCWSTR lpText, FX_INT32 nLength)
+void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString &wsText, int32_t nIndex, int32_t nOriginLength, FX_LPCWSTR lpText, int32_t nLength)
{
GetText(wsText, 0, GetTextBufLength());
- FX_INT32 nSelIndex = 0;
- FX_INT32 nSelLength = 0;
- FX_INT32 nSelCount = CountSelRanges();
+ int32_t nSelIndex = 0;
+ int32_t nSelLength = 0;
+ int32_t nSelCount = CountSelRanges();
while (nSelCount --) {
nSelLength = GetSelRange(nSelCount, nSelIndex);
wsText.Delete(nSelIndex, nSelLength);
}
wsText.Delete(nIndex, nOriginLength);
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nLength; i ++) {
wsText.Insert(nIndex ++, lpText[i]);
}
}
-void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength)
+void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength)
{
FXSYS_assert(nLength > 0);
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nStart, ParagPos);
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
- FX_INT32 nParagCount = m_ParagPtrArray.GetSize();
- FX_INT32 i = 0;
+ int32_t nParagCount = m_ParagPtrArray.GetSize();
+ int32_t i = 0;
for (i = ParagPos.nParagIndex + 1; i < nParagCount; i ++) {
m_ParagPtrArray[i]->m_nCharStart += nLength;
}
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
- FX_INT32 nReserveLineCount = pParag->m_nLineCount;
- FX_INT32 nReserveCharStart = pParag->m_nCharStart;
- FX_INT32 nLeavePart = ParagPos.nCharIndex;
- FX_INT32 nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex;
- FX_INT32 nTextStart = 0;
+ int32_t nReserveLineCount = pParag->m_nLineCount;
+ int32_t nReserveCharStart = pParag->m_nCharStart;
+ int32_t nLeavePart = ParagPos.nCharIndex;
+ int32_t nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex;
+ int32_t nTextStart = 0;
FX_WCHAR wCurChar = L' ';
FX_LPCWSTR lpPos = lpText;
FX_BOOL bFirst = TRUE;
- FX_INT32 nParagIndex = ParagPos.nParagIndex;
+ int32_t nParagIndex = ParagPos.nParagIndex;
for (i = 0; i < nLength; i ++, lpPos ++) {
wCurChar = *lpPos;
if (wCurChar == m_wLineEnd) {
@@ -1256,7 +1256,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT3 m_ParagPtrArray.InsertAt(++nParagIndex, pParag);
}
m_pTxtBuf->Insert(nStart, lpText, nLength);
- FX_INT32 nTotalLineCount = 0;
+ int32_t nTotalLineCount = 0;
for (i = ParagPos.nParagIndex; i <= nParagIndex; i ++) {
pParag = m_ParagPtrArray[i];
pParag->CalcLines();
@@ -1267,26 +1267,26 @@ void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT3 UpdatePages();
}
#ifdef FDE_USEFORMATBLOCK
-void CFDE_TxtEdtEngine::RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength)
+void CFDE_TxtEdtEngine::RawInsert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength)
{
FXSYS_assert(nLength > 0);
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nStart, ParagPos);
- FX_INT32 nParagCount = m_ParagPtrArray.GetSize();
- FX_INT32 i = 0;
+ int32_t nParagCount = m_ParagPtrArray.GetSize();
+ int32_t i = 0;
for (i = ParagPos.nParagIndex + 1; i < nParagCount; i ++) {
m_ParagPtrArray[i]->m_nCharStart += nLength;
}
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
- FX_INT32 nReserveLineCount = pParag->m_nLineCount;
- FX_INT32 nReserveCharStart = pParag->m_nCharStart;
- FX_INT32 nLeavePart = ParagPos.nCharIndex;
- FX_INT32 nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex;
- FX_INT32 nTextStart = 0;
+ int32_t nReserveLineCount = pParag->m_nLineCount;
+ int32_t nReserveCharStart = pParag->m_nCharStart;
+ int32_t nLeavePart = ParagPos.nCharIndex;
+ int32_t nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex;
+ int32_t nTextStart = 0;
FX_WCHAR wCurChar = L' ';
FX_LPCWSTR lpPos = lpText;
FX_BOOL bFirst = TRUE;
- FX_INT32 nParagIndex = ParagPos.nParagIndex;
+ int32_t nParagIndex = ParagPos.nParagIndex;
for (i = 0; i < nLength; i ++, lpPos ++) {
wCurChar = *lpPos;
if (wCurChar == m_wLineEnd) {
@@ -1320,12 +1320,12 @@ void CFDE_TxtEdtEngine::RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 n m_pTxtBuf->Insert(nStart, lpText, nLength);
}
#endif
-void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount )
+void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount )
{
if (nCount == -1) {
nCount = m_pTxtBuf->GetTextLength() - nStart;
}
- FX_INT32 nEnd = nStart + nCount - 1;
+ int32_t nEnd = nStart + nCount - 1;
FXSYS_assert(nStart >= 0 && nEnd < m_pTxtBuf->GetTextLength());
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
FDE_TXTEDTPARAGPOS ParagPosBgn, ParagPosEnd;
@@ -1340,9 +1340,9 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) bLastParag = TRUE;
}
}
- FX_INT32 nTotalLineCount = 0;
- FX_INT32 nTotalCharCount = 0;
- FX_INT32 i = 0;
+ int32_t nTotalLineCount = 0;
+ int32_t nTotalCharCount = 0;
+ int32_t i = 0;
for (i = ParagPosBgn.nParagIndex; i <= ParagPosEnd.nParagIndex; i ++) {
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[i];
pParag->CalcLines();
@@ -1351,7 +1351,7 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) }
m_pTxtBuf->Delete(nStart, nCount);
CFDE_TxtEdtParag * pEndParag = m_ParagPtrArray[ParagPosEnd.nParagIndex];
- FX_INT32 nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) ? ParagPosBgn.nParagIndex : \
+ int32_t nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) ? ParagPosBgn.nParagIndex : \
(ParagPosBgn.nParagIndex + 1);
for (i = nNextParagIndex; i <= ParagPosEnd.nParagIndex; i ++) {
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[nNextParagIndex];
@@ -1364,19 +1364,19 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) pParag->CalcLines();
nTotalLineCount -= pParag->m_nLineCount;
}
- FX_INT32 nParagCount = m_ParagPtrArray.GetSize();
+ int32_t nParagCount = m_ParagPtrArray.GetSize();
for (i = nNextParagIndex; i < nParagCount; i ++) {
m_ParagPtrArray[i]->m_nCharStart -= nCount;
}
m_nLineCount -= nTotalLineCount;
UpdatePages();
- FX_INT32 nPageCount = CountPages();
+ int32_t nPageCount = CountPages();
if (m_nCaretPage >= nPageCount) {
m_nCaretPage = nPageCount - 1;
}
m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0);
}
-void CFDE_TxtEdtEngine::DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, FX_BOOL bSel )
+void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart, int32_t nCount, FX_BOOL bSel )
{
FXSYS_assert(nStart >= 0);
if (nCount == -1) {
@@ -1384,7 +1384,7 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, F }
FXSYS_assert((nStart + nCount) <= m_pTxtBuf->GetTextLength());
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount > 0) {
}
#endif
@@ -1416,9 +1416,9 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() RemoveAllParags();
FX_WCHAR wChar = L' ';
FX_WCHAR wCharPre = L' ';
- FX_INT32 nParagStart = 0;
- FX_INT32 nCount = m_pTxtBuf->GetTextLength();
- FX_INT32 nIndex = 0;
+ int32_t nParagStart = 0;
+ int32_t nCount = m_pTxtBuf->GetTextLength();
+ int32_t nIndex = 0;
CFDE_TxtEdtParag * pParag = NULL;
IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf);
pIter->SetAt(0);
@@ -1438,8 +1438,8 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() }
void CFDE_TxtEdtEngine::RemoveAllParags()
{
- FX_INT32 nCount = m_ParagPtrArray.GetSize();
- FX_INT32 i = 0;
+ int32_t nCount = m_ParagPtrArray.GetSize();
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[i];
if (pParag) {
@@ -1450,8 +1450,8 @@ void CFDE_TxtEdtEngine::RemoveAllParags() }
void CFDE_TxtEdtEngine::RemoveAllPages()
{
- FX_INT32 nCount = m_PagePtrArray.GetSize();
- FX_INT32 i = 0;
+ int32_t nCount = m_PagePtrArray.GetSize();
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
IFDE_TxtEdtPage * pPage = m_PagePtrArray[i];
if (pPage) {
@@ -1462,13 +1462,13 @@ void CFDE_TxtEdtEngine::RemoveAllPages() }
void CFDE_TxtEdtEngine::UpdateParags()
{
- FX_INT32 nCount = m_ParagPtrArray.GetSize();
+ int32_t nCount = m_ParagPtrArray.GetSize();
if (nCount == 0) {
return;
}
CFDE_TxtEdtParag * pParag = NULL;
- FX_INT32 nLineCount = 0;
- FX_INT32 i = 0;
+ int32_t nLineCount = 0;
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
pParag = m_ParagPtrArray[i];
if (pParag->m_nLineCount == -1) {
@@ -1483,14 +1483,14 @@ void CFDE_TxtEdtEngine::UpdatePages() if (m_nLineCount == 0) {
return;
}
- FX_INT32 nPageCount = (m_nLineCount - 1) / (m_nPageLineCount) + 1;
- FX_INT32 nSize = m_PagePtrArray.GetSize();
+ int32_t nPageCount = (m_nLineCount - 1) / (m_nPageLineCount) + 1;
+ int32_t nSize = m_PagePtrArray.GetSize();
if (nSize == nPageCount) {
return;
}
if (nSize > nPageCount) {
IFDE_TxtEdtPage * pPage = NULL;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = nSize - 1; i >= nPageCount; i --) {
pPage = m_PagePtrArray[i];
if (pPage) {
@@ -1503,7 +1503,7 @@ void CFDE_TxtEdtEngine::UpdatePages() }
if (nSize < nPageCount) {
IFDE_TxtEdtPage * pPage = NULL;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = nSize; i < nPageCount; i ++) {
pPage = IFDE_TxtEdtPage::Create(this, i);
m_PagePtrArray.Add(pPage);
@@ -1605,9 +1605,9 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() m_pTextBreak->SetHorizontalScale(m_Param.nHorzScale);
m_pTextBreak->SetCharSpace(m_Param.fCharSpace);
}
-FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, FX_BOOL bPreIsCR )
+FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, int32_t &nLength, FX_BOOL bPreIsCR )
{
- for (FX_INT32 i = 0; i < nLength; i ++) {
+ for (int32_t i = 0; i < nLength; i ++) {
FX_WCHAR wc = lpText[i];
switch(wc) {
case L'\r': {
@@ -1617,7 +1617,7 @@ FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, break;
case L'\n': {
if (bPreIsCR == TRUE) {
- FX_INT32 nNext = i + 1;
+ int32_t nNext = i + 1;
if (nNext < nLength) {
FXSYS_memmove(lpText + i, lpText + nNext, (nLength - nNext) * sizeof(FX_WCHAR));
}
@@ -1653,9 +1653,9 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) {
FX_WCHAR wc = (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CR) ? L'\n' : L'\r';
if (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CRLF) {
- CFX_ArrayTemplate<FX_INT32> PosArr;
- FX_INT32 nLength = wsText.GetLength();
- FX_INT32 i = 0;
+ CFX_ArrayTemplate<int32_t> PosArr;
+ int32_t nLength = wsText.GetLength();
+ int32_t i = 0;
FX_LPWSTR lpPos = (FX_LPWSTR)(FX_LPCWSTR)wsText;
for (i = 0; i < nLength; i ++, lpPos ++) {
if (*lpPos == m_wLineEnd) {
@@ -1665,13 +1665,13 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) }
FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(wsText);
CFX_WideString wsTemp;
- FX_INT32 nCount = PosArr.GetSize();
+ int32_t nCount = PosArr.GetSize();
FX_LPWSTR lpDstBuf = wsTemp.GetBuffer(nLength + nCount);
- FX_INT32 nDstPos = 0;
- FX_INT32 nSrcPos = 0;
+ int32_t nDstPos = 0;
+ int32_t nSrcPos = 0;
for (i = 0; i < nCount; i ++) {
- FX_INT32 nPos = PosArr[i];
- FX_INT32 nCopyLen = nPos - nSrcPos + 1;
+ int32_t nPos = PosArr[i];
+ int32_t nCopyLen = nPos - nSrcPos + 1;
FXSYS_memcpy(lpDstBuf + nDstPos, lpSrcBuf + nSrcPos, nCopyLen * sizeof(FX_WCHAR));
nDstPos += nCopyLen;
nSrcPos += nCopyLen;
@@ -1684,24 +1684,24 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) wsTemp.ReleaseBuffer(nLength + nCount);
wsText = wsTemp;
} else {
- FX_INT32 nLength = wsText.GetLength();
+ int32_t nLength = wsText.GetLength();
FX_LPWSTR lpBuf = (FX_LPWSTR)(FX_LPCWSTR)wsText;
- for (FX_INT32 i = 0; i < nLength; i ++, lpBuf++) {
+ for (int32_t i = 0; i < nLength; i ++, lpBuf++) {
if (*lpBuf == m_wLineEnd) {
*lpBuf = wc;
}
}
}
}
-FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex)
+int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex)
{
FXSYS_assert(nIndex >= 0);
FXSYS_assert(nIndex <= m_pTxtBuf->GetTextLength());
if (m_nCaretPage >= 0) {
IFDE_TxtEdtPage* pPage = m_PagePtrArray[m_nCaretPage];
m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0);
- FX_INT32 nPageCharStart = pPage->GetCharStart();
- FX_INT32 nPageCharCount = pPage->GetCharCount();
+ int32_t nPageCharStart = pPage->GetCharStart();
+ int32_t nPageCharCount = pPage->GetCharCount();
if (nIndex >= nPageCharStart && nIndex < nPageCharStart + nPageCharCount) {
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
return m_nCaretPage;
@@ -1709,9 +1709,9 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
}
CFDE_TxtEdtParag * pParag = NULL;
- FX_INT32 nLineCount = 0;
- FX_INT32 nParagCount = m_ParagPtrArray.GetSize();
- FX_INT32 i = 0;
+ int32_t nLineCount = 0;
+ int32_t nParagCount = m_ParagPtrArray.GetSize();
+ int32_t i = 0;
for (i = 0; i < nParagCount; i ++) {
pParag = m_ParagPtrArray[i];
if (pParag->m_nCharStart <= nIndex && nIndex < (pParag->m_nCharStart + pParag->m_nCharCount)) {
@@ -1720,8 +1720,8 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) nLineCount += pParag->m_nLineCount;
}
pParag->LoadParag();
- FX_INT32 nLineStart = -1;
- FX_INT32 nLineCharCount = -1;
+ int32_t nLineStart = -1;
+ int32_t nLineCharCount = -1;
for (i = 0; i < pParag->m_nLineCount; i ++) {
pParag->GetLineRange(i, nLineStart, nLineCharCount);
if (nLineStart <= nIndex && nIndex < (nLineStart + nLineCharCount)) {
@@ -1735,13 +1735,13 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) pParag->UnloadParag();
return m_nCaretPage;
}
-void CFDE_TxtEdtEngine::TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const
+void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const
{
FXSYS_assert(nIndex >= 0 && nIndex < m_pTxtBuf->GetTextLength());
- FX_INT32 nCount = m_ParagPtrArray.GetSize();
- FX_INT32 nBgn = 0;
- FX_INT32 nMid = 0;
- FX_INT32 nEnd = nCount - 1;
+ int32_t nCount = m_ParagPtrArray.GetSize();
+ int32_t nBgn = 0;
+ int32_t nMid = 0;
+ int32_t nEnd = nCount - 1;
while (nEnd > nBgn) {
nMid = (nBgn + nEnd) / 2;
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[nMid];
@@ -1761,12 +1761,12 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &Pa ParagPos.nParagIndex = nMid;
ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->m_nCharStart;
}
-FX_INT32 CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore)
{
if (m_nCaret == m_pTxtBuf->GetTextLength() - 1) {
return -1;
}
- FX_INT32 nCaret = m_nCaret;
+ int32_t nCaret = m_nCaret;
if ((nCaret + 1 < m_pTxtBuf->GetTextLength()) && (m_pTxtBuf->GetCharByIndex(nCaret) == L'\r') && \
(m_pTxtBuf->GetCharByIndex(nCaret + 1) == L'\n')) {
nCaret ++;
@@ -1775,12 +1775,12 @@ FX_INT32 CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore) bBefore = TRUE;
return nCaret;
}
-FX_INT32 CFDE_TxtEdtEngine::MoveBackward(FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtEngine::MoveBackward(FX_BOOL &bBefore)
{
if (m_nCaret == 0) {
return FALSE;
}
- FX_INT32 nCaret = m_nCaret;
+ int32_t nCaret = m_nCaret;
if (nCaret > 2 && m_pTxtBuf->GetCharByIndex(nCaret - 1) == L'\n' && \
m_pTxtBuf->GetCharByIndex(nCaret - 2) == L'\r') {
nCaret --;
@@ -1879,15 +1879,15 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF &ptCaret) }
FX_BOOL CFDE_TxtEdtEngine::MoveLineStart()
{
- FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
+ int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
pParag->LoadParag();
- FX_INT32 nLineCount = pParag->m_nLineCount;
- FX_INT32 i = 0;
- FX_INT32 nStart = 0;
- FX_INT32 nCount = 0;
+ int32_t nLineCount = pParag->m_nLineCount;
+ int32_t i = 0;
+ int32_t nStart = 0;
+ int32_t nCount = 0;
for (; i < nLineCount; i ++) {
pParag->GetLineRange(i, nStart, nCount);
if (nIndex >= nStart && nIndex < nStart + nCount) {
@@ -1900,15 +1900,15 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() }
FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd()
{
- FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
+ int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
pParag->LoadParag();
- FX_INT32 nLineCount = pParag->m_nLineCount;
- FX_INT32 i = 0;
- FX_INT32 nStart = 0;
- FX_INT32 nCount = 0;
+ int32_t nLineCount = pParag->m_nLineCount;
+ int32_t i = 0;
+ int32_t nStart = 0;
+ int32_t nCount = 0;
for (; i < nLineCount; i ++) {
pParag->GetLineRange(i, nStart, nCount);
if (nIndex >= nStart && nIndex < nStart + nCount) {
@@ -1937,7 +1937,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() }
FX_BOOL CFDE_TxtEdtEngine::MoveParagStart()
{
- FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
+ int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
@@ -1946,7 +1946,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveParagStart() }
FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd()
{
- FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
+ int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex];
@@ -1973,14 +1973,14 @@ FX_BOOL CFDE_TxtEdtEngine::MoveEnd() return TRUE;
}
#ifdef FDE_USEFORMATBLOCK
-FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtEngine::NormalizeCaretPos(int32_t nIndex, int32_t nFlags, FX_BOOL &bBefore)
{
bBefore = TRUE;
- FX_INT32 nBgn = 0, nEnd = 0;
- FX_INT32 nRecord = -1;
+ int32_t nBgn = 0, nEnd = 0;
+ int32_t nRecord = -1;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bRet = GetFieldBoundary(nIndex, nBgn, nEnd, pField);
- FX_INT32 nDelta = 0;
+ int32_t nDelta = 0;
if (bRet && !pField->IsFix()) {
if (nIndex - nBgn < FDE_FORMAT_EDIT_FIELD_HADERSIZE) {
if (nFlags == FDE_FORMAT_CARET_BACKWARD) {
@@ -1991,18 +1991,18 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, }
nIndex = nBgn + FDE_FORMAT_EDIT_FIELD_HADERSIZE;
}
- FX_INT32 nRet = pField->NormalizeCaretPos(nIndex - nBgn, (FDE_FORMAT_CARET_DIRECTION)nFlags);
+ int32_t nRet = pField->NormalizeCaretPos(nIndex - nBgn, (FDE_FORMAT_CARET_DIRECTION)nFlags);
if (nRet >= 0) {
return nRet + nBgn;
}
if (nRet == -2) {
- FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0;
+ int32_t nEditablePosBgn = 0, nEditablePosEnd = 0;
pField->GetEditableRange(nEditablePosBgn, nEditablePosEnd);
nRecord = nBgn + nEditablePosBgn;
nFlags = FDE_FORMAT_CARET_BACKWARD;
} else {
FXSYS_assert(nRet == -1);
- FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0;
+ int32_t nEditablePosBgn = 0, nEditablePosEnd = 0;
pField->GetEditableRange(nEditablePosBgn, nEditablePosEnd);
nRecord = nBgn + nEditablePosEnd;
nFlags = FDE_FORMAT_CARET_FORWARD;
@@ -2025,7 +2025,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, }
break;
case FDE_FORMAT_CARET_MIDDLE: {
- FX_INT32 nBgn1 = 0, nEnd1 = 0, nBgn2 = 0, nEnd2 = 0;
+ int32_t nBgn1 = 0, nEnd1 = 0, nBgn2 = 0, nEnd2 = 0;
CFDE_TxtEdtField * pEditableField1 = NULL;
CFDE_TxtEdtField * pEditableField2 = NULL;
FX_BOOL bRet1 = FindEditableField(nIndex, nBgn1, nEnd1, pEditableField1, FALSE);
@@ -2037,7 +2037,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, FXSYS_assert(bRet1);
return pEditableField1->NormalizeCaretPos(nEnd1 - nBgn1, FDE_FORMAT_CARET_BACKWARD) + nBgn1;
} else {
- FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0;
+ int32_t nEditablePosBgn = 0, nEditablePosEnd = 0;
if (nIndex - nEnd1 < nBgn2 + nDelta - nIndex) {
pEditableField1->GetEditableRange(nEditablePosBgn, nEditablePosEnd);
return nEditablePosEnd + nBgn1;
@@ -2066,7 +2066,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, return nIndex;
}
}
-FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(FX_INT32 nIndex, FX_INT32 &nBgn, FX_INT32 &nEnd, CFDE_TxtEdtField * &pField)
+FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(int32_t nIndex, int32_t &nBgn, int32_t &nEnd, CFDE_TxtEdtField * &pField)
{
CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE);
pIter->SetAt(nIndex);
@@ -2109,7 +2109,7 @@ FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(FX_INT32 nIndex, FX_INT32 &nBgn, FX_ pIter->Release();
return FALSE;
}
-FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX_INT32 &nEnd, CFDE_TxtEdtField * &pField, FX_BOOL bForward )
+FX_BOOL CFDE_TxtEdtEngine::FindEditableField(int32_t nIndex, int32_t &nBgn, int32_t &nEnd, CFDE_TxtEdtField * &pField, FX_BOOL bForward )
{
FX_WCHAR wcFirst = FDE_TXTEDT_FORMATBLOCK_BGN;
FX_WCHAR wcSecond = FDE_TXTEDT_FORMATBLOCK_END;
@@ -2119,7 +2119,7 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX }
CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE);
pIter->SetAt(nIndex);
- FX_INT32 bFind = FALSE;
+ int32_t bFind = FALSE;
do {
FX_WCHAR wc = pIter->GetChar();
if (wc == wcFirst) {
@@ -2143,7 +2143,7 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX } while (pIter->Next(!bForward));
FXSYS_assert(bFind);
if (!bForward) {
- FX_INT32 nTemp = nBgn;
+ int32_t nTemp = nBgn;
nBgn = nEnd;
nEnd = nTemp;
}
@@ -2158,24 +2158,24 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX }
return FindEditableField((bForward ? nEnd : nBgn), nBgn, nEnd, pField, bForward);
}
-FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(FX_INT32 nIndex, FX_BOOL bForward , FX_BOOL bSelect )
+FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(int32_t nIndex, FX_BOOL bForward , FX_BOOL bSelect )
{
if (m_SelRangePtrArr.GetSize() > 0) {
ClearSelection();
m_Param.pEventSink->On_SelChanged(this);
}
- FX_INT32 nBgn = 0, nEnd = 0;
+ int32_t nBgn = 0, nEnd = 0;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bRet = FindEditableField(nIndex, nBgn, nEnd, pField, bForward);
if (!bRet) {
return FALSE;
}
- FX_INT32 nEditableBgn = 0, nEditableEnd = 0;
+ int32_t nEditableBgn = 0, nEditableEnd = 0;
pField->GetEditableRange(nEditableBgn, nEditableEnd);
nEditableBgn += nBgn;
nEditableEnd += nBgn;
if (bSelect) {
- FX_INT32 nRangeCount = nEditableEnd - nEditableBgn;
+ int32_t nRangeCount = nEditableEnd - nEditableBgn;
if (nRangeCount > 0) {
AddSelRange(nEditableBgn, nEditableEnd - nEditableBgn);
}
@@ -2183,14 +2183,14 @@ FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(FX_INT32 nIndex, FX_BOOL bForw SetCaretPos(nEditableEnd, TRUE);
return TRUE;
}
-FX_INT32 CFDE_TxtEdtEngine::GetRealIndex(FX_INT32 nIndex) const
+int32_t CFDE_TxtEdtEngine::GetRealIndex(int32_t nIndex) const
{
CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE);
pIter->SetAt(0);
FX_BOOL bInField = FALSE;
- FX_INT32 nFieldBgn = 0;
- FX_INT32 nRealIndex = 0;
- for (FX_INT32 i = 0; i <= nIndex; i ++) {
+ int32_t nFieldBgn = 0;
+ int32_t nRealIndex = 0;
+ for (int32_t i = 0; i <= nIndex; i ++) {
FX_WCHAR wc = pIter->GetChar();
if (bInField) {
if (wc == FDE_TXTEDT_FORMATBLOCK_END) {
@@ -2221,7 +2221,7 @@ FX_INT32 CFDE_TxtEdtEngine::GetRealIndex(FX_INT32 nIndex) const CFDE_TxtEdtField * pField = (CFDE_TxtEdtField *)((dwCur << 16) | dwPre);
pIter->Release();
if (pField->IsFix()) {
- FX_INT32 nDelta = nIndex - nFieldBgn - FDE_FORMAT_EDIT_FIELD_HADERSIZE + 1;
+ int32_t nDelta = nIndex - nFieldBgn - FDE_FORMAT_EDIT_FIELD_HADERSIZE + 1;
return nRealIndex + (nDelta > 0 ? nDelta : 0);
} else {
return nRealIndex + pField->GetRealIndex(nIndex - nFieldBgn);
@@ -2260,7 +2260,7 @@ FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString &wsText) }
return TRUE;
}
-void CFDE_TxtEdtEngine::UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore)
+void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore)
{
MovePage2Char(nIndex);
GetCaretRect(m_rtCaret, m_nCaretPage, nIndex, bBefore);
@@ -2274,17 +2274,17 @@ void CFDE_TxtEdtEngine::UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore) m_rtCaret.top : m_rtCaret.left;
m_Param.pEventSink->On_CaretChanged(this, m_nCaretPage, 0);
}
-void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret, FX_INT32 nPageIndex, FX_INT32 nCaret, FX_BOOL bBefore )
+void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret, int32_t nPageIndex, int32_t nCaret, FX_BOOL bBefore )
{
IFDE_TxtEdtPage * pPage = m_PagePtrArray[m_nCaretPage];
m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0);
FX_BOOL bCombText = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText;
- FX_INT32 nIndexInpage = nCaret - pPage->GetCharStart();
+ int32_t nIndexInpage = nCaret - pPage->GetCharStart();
if (bBefore && bCombText && nIndexInpage > 0) {
nIndexInpage--;
bBefore = FALSE;
}
- FX_INT32 nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText);
+ int32_t nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText);
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
if ((!FX_IsOdd(nBIDILevel) && !bBefore) || (FX_IsOdd(nBIDILevel) && bBefore)) {
rtCaret.Offset(0, rtCaret.height - 1.0f);
@@ -2323,31 +2323,31 @@ FX_BOOL CFDE_TxtEdtEngine::IsSelect() }
void CFDE_TxtEdtEngine::DeleteSelect()
{
- FX_INT32 nCountRange = CountSelRanges();
+ int32_t nCountRange = CountSelRanges();
if (nCountRange > 0) {
#ifdef FDE_USEFORMATBLOCK
- FX_INT32 nBlockCount = m_BlockArray.GetSize();
+ int32_t nBlockCount = m_BlockArray.GetSize();
if (nBlockCount > 0) {
if (nCountRange > 1) {
return;
}
- FX_INT32 nSelStart;
- FX_INT32 nSelCount;
+ int32_t nSelStart;
+ int32_t nSelCount;
nSelCount = GetSelRange(0, nSelStart);
- FX_INT32 nSelEnd = nSelStart + nSelCount;
- FX_INT32 nBgn = 0;
- FX_INT32 nEnd = 0;
+ int32_t nSelEnd = nSelStart + nSelCount;
+ int32_t nBgn = 0;
+ int32_t nEnd = 0;
CFDE_TxtEdtField * pField = NULL;
FX_BOOL bInField = GetFieldBoundary(nSelStart, nBgn, nEnd, pField);
- FX_INT32 nCaretInField = nSelStart - nBgn;
+ int32_t nCaretInField = nSelStart - nBgn;
FX_BOOL bBefore = FALSE;
if (!bInField || pField->IsFix() || nSelEnd > nEnd) {
return;
}
pField->Backup();
CFX_WideString wsDel;
- FX_INT32 nCaret = 0;
- FX_INT32 nRet = pField->Delete(nCaretInField, nSelCount, wsDel, nCaret, bBefore);
+ int32_t nCaret = 0;
+ int32_t nRet = pField->Delete(nCaretInField, nSelCount, wsDel, nCaret, bBefore);
nCaret += nBgn;
switch (nRet) {
case FDE_FORMAT_FIELD_DELETE_RET_S:
@@ -2380,8 +2380,8 @@ void CFDE_TxtEdtEngine::DeleteSelect() return;
}
#endif
- FX_INT32 nSelStart;
- FX_INT32 nSelCount;
+ int32_t nSelStart;
+ int32_t nSelCount;
while (nCountRange > 0) {
nSelCount = GetSelRange(--nCountRange, nSelStart);
FDE_LPTXTEDTSELRANGE lpTemp = m_SelRangePtrArr[nCountRange];
@@ -2399,7 +2399,7 @@ void CFDE_TxtEdtEngine::DeleteSelect() IFDE_TxtEdtDoRecord * IFDE_TxtEdtDoRecord::Create(FX_BSTR bsDoRecord)
{
FX_LPCSTR lpBuf = bsDoRecord.GetCStr();
- FX_INT32 nType = *((FX_INT32*)lpBuf);
+ int32_t nType = *((int32_t*)lpBuf);
switch(nType) {
case FDE_TXTEDT_DORECORD_INS:
return FX_NEW CFDE_TxtEdtDoRecord_Insert(bsDoRecord);
@@ -2423,9 +2423,9 @@ CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert(FX_BSTR bsDoRecord) Deserialize(bsDoRecord);
}
CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
FX_LPCWSTR lpText,
- FX_INT32 nLength)
+ int32_t nLength)
: m_pEngine(pEngine)
, m_nCaret(nCaret)
{
@@ -2467,11 +2467,11 @@ FX_BOOL CFDE_TxtEdtDoRecord_Insert::Redo() void CFDE_TxtEdtDoRecord_Insert::Serialize(CFX_ByteString &bsDoRecord) const
{
CFX_ArchiveSaver ArchiveSaver;
- ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_INS);
- ArchiveSaver << (FX_INT32)(FX_UINTPTR)m_pEngine;
+ ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_INS);
+ ArchiveSaver << (int32_t)(uintptr_t)m_pEngine;
ArchiveSaver << m_nCaret;
ArchiveSaver << m_wsInsert;
- FX_INT32 nLength = ArchiveSaver.GetLength();
+ int32_t nLength = ArchiveSaver.GetLength();
FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer();
FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength);
FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
@@ -2480,12 +2480,12 @@ void CFDE_TxtEdtDoRecord_Insert::Serialize(CFX_ByteString &bsDoRecord) const void CFDE_TxtEdtDoRecord_Insert::Deserialize(FX_BSTR bsDoRecord)
{
CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength());
- FX_INT32 nType = 0;
+ int32_t nType = 0;
ArchiveLoader >> nType;
FXSYS_assert(nType == FDE_TXTEDT_DORECORD_INS);
- FX_INT32 nEngine = 0;
+ int32_t nEngine = 0;
ArchiveLoader >> nEngine;
- m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine;
+ m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
ArchiveLoader >> m_nCaret;
ArchiveLoader >> m_wsInsert;
}
@@ -2494,8 +2494,8 @@ CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(FX_BSTR bsDoRec Deserialize(bsDoRecord);
}
CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nIndex,
- FX_INT32 nCaret,
+ int32_t nIndex,
+ int32_t nCaret,
const CFX_WideString &wsRange,
FX_BOOL bSel)
: m_pEngine(pEngine)
@@ -2545,13 +2545,13 @@ FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Redo() void CFDE_TxtEdtDoRecord_DeleteRange::Serialize(CFX_ByteString &bsDoRecord) const
{
CFX_ArchiveSaver ArchiveSaver;
- ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_DEL);
- ArchiveSaver << (FX_INT32)(FX_UINTPTR)m_pEngine;
+ ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_DEL);
+ ArchiveSaver << (int32_t)(uintptr_t)m_pEngine;
ArchiveSaver << m_bSel;
ArchiveSaver << m_nIndex;
ArchiveSaver << m_nCaret;
ArchiveSaver << m_wsRange;
- FX_INT32 nLength = ArchiveSaver.GetLength();
+ int32_t nLength = ArchiveSaver.GetLength();
FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer();
FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength);
FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
@@ -2560,12 +2560,12 @@ void CFDE_TxtEdtDoRecord_DeleteRange::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize(FX_BSTR bsDoRecord)
{
CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength());
- FX_INT32 nType = 0;
+ int32_t nType = 0;
ArchiveLoader >> nType;
FXSYS_assert(nType == FDE_TXTEDT_DORECORD_DEL);
- FX_INT32 nEngine = 0;
+ int32_t nEngine = 0;
ArchiveLoader >> nEngine;
- m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine;
+ m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
ArchiveLoader >> m_bSel;
ArchiveLoader >> m_nIndex;
ArchiveLoader >> m_nCaret;
@@ -2577,12 +2577,12 @@ CFDE_TxtEdtDoRecord_FieldInsert::CFDE_TxtEdtDoRecord_FieldInsert(FX_BSTR bsDoRec Deserialize(bsDoRecord);
}
CFDE_TxtEdtDoRecord_FieldInsert::CFDE_TxtEdtDoRecord_FieldInsert(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nOldFieldLength,
- FX_INT32 nNewFieldLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nOldFieldLength,
+ int32_t nNewFieldLength,
const CFX_WideString &wsIns,
FX_BOOL bSel )
: m_pEngine(pEngine)
@@ -2608,9 +2608,9 @@ void CFDE_TxtEdtDoRecord_FieldInsert::Release() FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Undo()
{
CFX_WideString wsDel;
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = FALSE;
- FX_INT32 nRet = m_pField->Delete(m_nIndexInField, m_wsIns.GetLength(), wsDel, nCaret, bBefore);
+ int32_t nRet = m_pField->Delete(m_nIndexInField, m_wsIns.GetLength(), wsDel, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2620,9 +2620,9 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Undo() }
FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Redo()
{
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = FALSE;
- FX_INT32 nRet = m_pField->Insert(m_nIndexInField, m_wsIns, nCaret, bBefore);
+ int32_t nRet = m_pField->Insert(m_nIndexInField, m_wsIns, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_INSERT_RET_F_FULL && nRet != FDE_FORMAT_FIELD_INSERT_RET_F_INVALIDATE);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2633,17 +2633,17 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Redo() void CFDE_TxtEdtDoRecord_FieldInsert::Serialize(CFX_ByteString &bsDoRecord) const
{
CFX_ArchiveSaver ArchiveSaver;
- ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATINS);
- ArchiveSaver << FX_INT32(m_pEngine);
+ ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATINS);
+ ArchiveSaver << int32_t(m_pEngine);
ArchiveSaver << m_nCaret;
- ArchiveSaver << FX_INT32(m_pField);
+ ArchiveSaver << int32_t(m_pField);
ArchiveSaver << m_nIndexInField;
ArchiveSaver << m_nFieldBgn;
ArchiveSaver << m_nOldFieldLength;
ArchiveSaver << m_nNewFieldLength;
ArchiveSaver << m_wsIns;
ArchiveSaver << m_bSel;
- FX_INT32 nLength = ArchiveSaver.GetLength();
+ int32_t nLength = ArchiveSaver.GetLength();
FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer();
FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength);
FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
@@ -2652,14 +2652,14 @@ void CFDE_TxtEdtDoRecord_FieldInsert::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_FieldInsert::Deserialize(FX_BSTR bsDoRecord)
{
CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength());
- FX_INT32 nType = 0;
+ int32_t nType = 0;
ArchiveLoader >> nType;
FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATINS);
- FX_INT32 nEngine = 0;
+ int32_t nEngine = 0;
ArchiveLoader >> nEngine;
- m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine;
+ m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
ArchiveLoader >> m_nCaret;
- FX_INT32 nField = 0;
+ int32_t nField = 0;
ArchiveLoader >> nField;
m_pField = (CFDE_TxtEdtField*)nField;
ArchiveLoader >> m_nIndexInField;
@@ -2674,12 +2674,12 @@ CFDE_TxtEdtDoRecord_FieldDelete::CFDE_TxtEdtDoRecord_FieldDelete(FX_BSTR bsDoRec Deserialize(bsDoRecord);
}
CFDE_TxtEdtDoRecord_FieldDelete::CFDE_TxtEdtDoRecord_FieldDelete(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nOldLength,
- FX_INT32 nNewLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nOldLength,
+ int32_t nNewLength,
const CFX_WideString &wsDel,
FX_BOOL bSel )
: m_pEngine(pEngine)
@@ -2704,9 +2704,9 @@ void CFDE_TxtEdtDoRecord_FieldDelete::Release() }
FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Undo()
{
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = FALSE;
- FX_INT32 nRet = m_pField->Insert(m_nIndexInField, m_wsDel, nCaret, bBefore);
+ int32_t nRet = m_pField->Insert(m_nIndexInField, m_wsDel, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_INSERT_RET_F_FULL && nRet != FDE_FORMAT_FIELD_INSERT_RET_F_INVALIDATE);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2716,10 +2716,10 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Undo() }
FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Redo()
{
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = 0;
CFX_WideString wsDel;
- FX_INT32 nRet = m_pField->Delete(m_nIndexInField, m_wsDel.GetLength(), wsDel, nCaret, bBefore);
+ int32_t nRet = m_pField->Delete(m_nIndexInField, m_wsDel.GetLength(), wsDel, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2730,17 +2730,17 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Redo() void CFDE_TxtEdtDoRecord_FieldDelete::Serialize(CFX_ByteString &bsDoRecord) const
{
CFX_ArchiveSaver ArchiveSaver;
- ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATDEL);
- ArchiveSaver << FX_INT32(m_pEngine);
+ ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATDEL);
+ ArchiveSaver << int32_t(m_pEngine);
ArchiveSaver << m_nCaret;
- ArchiveSaver << FX_INT32(m_pField);
+ ArchiveSaver << int32_t(m_pField);
ArchiveSaver << m_nIndexInField;
ArchiveSaver << m_nFieldBgn;
ArchiveSaver << m_nOldFieldLength;
ArchiveSaver << m_nNewFieldLength;
ArchiveSaver << m_wsDel;
ArchiveSaver << m_bSel;
- FX_INT32 nLength = ArchiveSaver.GetLength();
+ int32_t nLength = ArchiveSaver.GetLength();
FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer();
FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength);
FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
@@ -2749,14 +2749,14 @@ void CFDE_TxtEdtDoRecord_FieldDelete::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_FieldDelete::Deserialize(FX_BSTR bsDoRecord)
{
CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength());
- FX_INT32 nType = 0;
+ int32_t nType = 0;
ArchiveLoader >> nType;
FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATDEL);
- FX_INT32 nEngine = 0;
+ int32_t nEngine = 0;
ArchiveLoader >> nEngine;
- m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine;
+ m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
ArchiveLoader >> m_nCaret;
- FX_INT32 nField = 0;
+ int32_t nField = 0;
ArchiveLoader >> nField;
m_pField = (CFDE_TxtEdtField*)nField;
ArchiveLoader >> m_nIndexInField;
@@ -2771,12 +2771,12 @@ CFDE_TxtEdtDoRecord_FieldReplace::CFDE_TxtEdtDoRecord_FieldReplace(FX_BSTR bsDoR Deserialize(bsDoRecord);
}
CFDE_TxtEdtDoRecord_FieldReplace::CFDE_TxtEdtDoRecord_FieldReplace( CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
- FX_INT32 nNewCaret,
+ int32_t nCaret,
+ int32_t nNewCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nFieldNewLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nFieldNewLength,
const CFX_WideString &wsDel,
const CFX_WideString &wsIns,
FX_BOOL bSel)
@@ -2804,9 +2804,9 @@ void CFDE_TxtEdtDoRecord_FieldReplace::Release() FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Undo()
{
CFX_WideString wsDel;
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = FALSE;
- FX_INT32 nRet = m_pField->Replace(m_nIndexInField, m_wsIns.GetLength(), m_wsDel, wsDel, nCaret, bBefore);
+ int32_t nRet = m_pField->Replace(m_nIndexInField, m_wsIns.GetLength(), m_wsDel, wsDel, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2817,9 +2817,9 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Undo() FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Redo()
{
CFX_WideString wsDel;
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FX_BOOL bBefore = FALSE;
- FX_INT32 nRet = m_pField->Replace(m_nIndexInField, m_wsDel.GetLength(), m_wsIns, wsDel, nCaret, bBefore);
+ int32_t nRet = m_pField->Replace(m_nIndexInField, m_wsDel.GetLength(), m_wsIns, wsDel, nCaret, bBefore);
FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY);
CFX_WideString wsDisplay;
m_pField->GetDisplayText(wsDisplay);
@@ -2830,18 +2830,18 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Redo() void CFDE_TxtEdtDoRecord_FieldReplace::Serialize(CFX_ByteString &bsDoRecord) const
{
CFX_ArchiveSaver ArchiveSaver;
- ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATREP);
- ArchiveSaver << FX_INT32(m_pEngine);
+ ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATREP);
+ ArchiveSaver << int32_t(m_pEngine);
ArchiveSaver << m_nCaret;
ArchiveSaver << m_nNewCaret;
- ArchiveSaver << FX_INT32(m_pField);
+ ArchiveSaver << int32_t(m_pField);
ArchiveSaver << m_nIndexInField;
ArchiveSaver << m_nFieldBgn;
ArchiveSaver << m_nFieldNewLength;
ArchiveSaver << m_wsDel;
ArchiveSaver << m_wsIns;
ArchiveSaver << m_bSel;
- FX_INT32 nLength = ArchiveSaver.GetLength();
+ int32_t nLength = ArchiveSaver.GetLength();
FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer();
FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength);
FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
@@ -2850,15 +2850,15 @@ void CFDE_TxtEdtDoRecord_FieldReplace::Serialize(CFX_ByteString &bsDoRecord) con void CFDE_TxtEdtDoRecord_FieldReplace::Deserialize(FX_BSTR bsDoRecord)
{
CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength());
- FX_INT32 nType = 0;
+ int32_t nType = 0;
ArchiveLoader >> nType;
FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATREP);
- FX_INT32 nEngine = 0;
+ int32_t nEngine = 0;
ArchiveLoader >> nEngine;
- m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine;
+ m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
ArchiveLoader >> m_nCaret;
ArchiveLoader >> m_nNewCaret;
- FX_INT32 nField = 0;
+ int32_t nField = 0;
ArchiveLoader >> nField;
m_pField = (CFDE_TxtEdtField*)nField;
ArchiveLoader >> m_nIndexInField;
diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.h b/xfa/src/fee/src/fee/fde_txtedtengine.h index dec152c630..43a98fa7db 100644 --- a/xfa/src/fee/src/fee/fde_txtedtengine.h +++ b/xfa/src/fee/src/fee/fde_txtedtengine.h @@ -47,14 +47,14 @@ class CFDE_TxtEdtEngine : public IFDE_TxtEdtEngine friend class CFDE_TxtEdtBlock;
#endif
struct _FDE_TXTEDTSELRANGE {
- FX_INT32 nStart;
- FX_INT32 nCount;
+ int32_t nStart;
+ int32_t nCount;
};
typedef _FDE_TXTEDTSELRANGE FDE_TXTEDTSELRANGE;
typedef _FDE_TXTEDTSELRANGE * FDE_LPTXTEDTSELRANGE;
struct _FDE_TXTEDTPARAGPOS {
- FX_INT32 nParagIndex;
- FX_INT32 nCharIndex;
+ int32_t nParagIndex;
+ int32_t nCharIndex;
};
typedef _FDE_TXTEDTPARAGPOS FDE_TXTEDTPARAGPOS;
typedef _FDE_TXTEDTPARAGPOS * FDE_LPTXTEDTPARAGPOS;
@@ -65,65 +65,65 @@ public: virtual void SetEditParams(const FDE_TXTEDTPARAMS ¶ms);
virtual const FDE_TXTEDTPARAMS* GetEditParams() const;
- virtual FX_INT32 CountPages() const;
- virtual IFDE_TxtEdtPage* GetPage(FX_INT32 nIndex);
+ virtual int32_t CountPages() const;
+ virtual IFDE_TxtEdtPage* GetPage(int32_t nIndex);
- virtual FX_BOOL SetBufChunkSize(FX_INT32 nChunkSize);
+ virtual FX_BOOL SetBufChunkSize(int32_t nChunkSize);
virtual void SetTextByStream(IFX_Stream *pStream);
virtual void SetText(const CFX_WideString &wsText);
- virtual FX_INT32 GetTextLength() const;
- virtual void GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount = -1);
+ virtual int32_t GetTextLength() const;
+ virtual void GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount = -1);
virtual void ClearText();
- virtual FX_INT32 GetCaretRect(CFX_RectF &rtCaret) const;
- virtual FX_INT32 GetCaretPos() const;
- virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore);
- virtual FX_INT32 MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE);
+ virtual int32_t GetCaretRect(CFX_RectF &rtCaret) const;
+ virtual int32_t GetCaretPos() const;
+ virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore);
+ virtual int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE);
virtual void Lock();
virtual void Unlock();
virtual FX_BOOL IsLocked() const;
- virtual FX_INT32 Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength);
- virtual FX_INT32 Delete(FX_INT32 nStart, FX_BOOL bBackspace = FALSE);
- virtual FX_INT32 DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- virtual FX_INT32 Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace);
+ virtual int32_t Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength);
+ virtual int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE);
+ virtual int32_t DeleteRange(int32_t nStart, int32_t nCount = -1);
+ virtual int32_t Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace);
- virtual void SetLimit(FX_INT32 nLimit);
+ virtual void SetLimit(int32_t nLimit);
virtual void SetAliasChar(FX_WCHAR wcAlias);
- virtual void SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat);
- virtual FX_INT32 CountEditBlocks() const;
- virtual void GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const;
- virtual FX_INT32 CountEditFields(FX_INT32 nBlockIndex) const;
- virtual void GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const;
+ virtual void SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat);
+ virtual int32_t CountEditBlocks() const;
+ virtual void GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const;
+ virtual int32_t CountEditFields(int32_t nBlockIndex) const;
+ virtual void GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const;
virtual void StartEdit();
virtual void EndEdit();
- void RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
+ void RemoveSelRange(int32_t nStart, int32_t nCount = -1);
- virtual void AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- virtual FX_INT32 CountSelRanges();
- virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
+ virtual void AddSelRange(int32_t nStart, int32_t nCount = -1);
+ virtual int32_t CountSelRanges();
+ virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
virtual void ClearSelection();
virtual FX_BOOL Redo(FX_BSTR bsRedo);
virtual FX_BOOL Undo(FX_BSTR bsUndo);
- virtual FX_INT32 StartLayout();
- virtual FX_INT32 DoLayout(IFX_Pause *pPause);
+ virtual int32_t StartLayout();
+ virtual int32_t DoLayout(IFX_Pause *pPause);
virtual void EndLayout();
virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL);
- virtual FX_INT32 CountParags() const;
- virtual IFDE_TxtEdtParag* GetParag(FX_INT32 nParagIndex) const;
+ virtual int32_t CountParags() const;
+ virtual IFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const;
virtual IFX_CharIter* CreateCharIter();
IFDE_TxtEdtBuf* GetTextBuf() const;
- FX_INT32 GetTextBufLength() const;
+ int32_t GetTextBufLength() const;
IFX_TxtBreak* GetTextBreak() const;
- FX_INT32 GetLineCount() const;
- FX_INT32 GetPageLineCount() const;
+ int32_t GetLineCount() const;
+ int32_t GetPageLineCount() const;
- FX_INT32 Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLineofParag,
- FX_INT32 nLineIndex, FX_INT32 &nStartLine) const;
+ int32_t Line2Parag(int32_t nStartParag, int32_t nStartLineofParag,
+ int32_t nLineIndex, int32_t &nStartLine) const;
FX_WCHAR GetAliasChar() const
{
return m_wcAliasChar;
@@ -132,16 +132,16 @@ public: protected:
virtual ~CFDE_TxtEdtEngine();
private:
- void Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength);
+ void Inner_Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength);
#ifdef FDE_USEFORMATBLOCK
- void RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength);
+ void RawInsert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength);
#endif
- void GetPreDeleteText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nLength);
- void GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex, FX_LPCWSTR lpText, FX_INT32 nLength);
- void GetPreReplaceText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nOriginLength, FX_LPCWSTR lpText, FX_INT32 nLength);
+ void GetPreDeleteText(CFX_WideString &wsText, int32_t nIndex, int32_t nLength);
+ void GetPreInsertText(CFX_WideString &wsText, int32_t nIndex, FX_LPCWSTR lpText, int32_t nLength);
+ void GetPreReplaceText(CFX_WideString &wsText, int32_t nIndex, int32_t nOriginLength, FX_LPCWSTR lpText, int32_t nLength);
- void Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- void DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, FX_BOOL bSel = FALSE);
+ void Inner_DeleteRange(int32_t nStart, int32_t nCount = -1);
+ void DeleteRange_DoRecord(int32_t nStart, int32_t nCount, FX_BOOL bSel = FALSE);
void ResetEngine();
void RebuildParagraphs();
void RemoveAllParags();
@@ -150,12 +150,12 @@ private: void UpdatePages();
void UpdateTxtBreak();
- FX_BOOL ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, FX_BOOL bPreIsCR = FALSE);
+ FX_BOOL ReplaceParagEnd(FX_LPWSTR &lpText, int32_t &nLength, FX_BOOL bPreIsCR = FALSE);
void RecoverParagEnd(CFX_WideString &wsText);
- FX_INT32 MovePage2Char(FX_INT32 nIndex);
- void TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const;
- FX_INT32 MoveForward(FX_BOOL &bBefore);
- FX_INT32 MoveBackward(FX_BOOL &bBefore);
+ int32_t MovePage2Char(int32_t nIndex);
+ void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const;
+ int32_t MoveForward(FX_BOOL &bBefore);
+ int32_t MoveBackward(FX_BOOL &bBefore);
FX_BOOL MoveUp(CFX_PointF &ptCaret);
FX_BOOL MoveDown(CFX_PointF &ptCaret);
FX_BOOL MoveLineStart();
@@ -165,8 +165,8 @@ private: FX_BOOL MoveHome();
FX_BOOL MoveEnd();
FX_BOOL IsFitArea(CFX_WideString &wsText);
- void UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore = TRUE);
- void GetCaretRect(CFX_RectF &rtCaret, FX_INT32 nPageIndex, FX_INT32 nCaret, FX_BOOL bBefore = TRUE);
+ void UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ void GetCaretRect(CFX_RectF &rtCaret, int32_t nPageIndex, int32_t nCaret, FX_BOOL bBefore = TRUE);
void UpdateCaretIndex(const CFX_PointF & ptCaret);
FX_BOOL IsSelect();
@@ -177,21 +177,21 @@ private: CFX_ArrayTemplate<IFDE_TxtEdtPage*> m_PagePtrArray;
CFX_ArrayTemplate<CFDE_TxtEdtParag*> m_ParagPtrArray;
CFX_ArrayTemplate<FDE_LPTXTEDTSELRANGE> m_SelRangePtrArr;
- FX_INT32 m_nPageLineCount;
- FX_INT32 m_nLineCount;
- FX_INT32 m_nAnchorPos;
- FX_INT32 m_nLayoutPos;
+ int32_t m_nPageLineCount;
+ int32_t m_nLineCount;
+ int32_t m_nAnchorPos;
+ int32_t m_nLayoutPos;
FX_FLOAT m_fCaretPosReserve;
- FX_INT32 m_nCaret;
+ int32_t m_nCaret;
FX_BOOL m_bBefore;
- FX_INT32 m_nCaretPage;
+ int32_t m_nCaretPage;
CFX_RectF m_rtCaret;
FX_DWORD m_dwFindFlags;
FX_BOOL m_bLock;
- FX_INT32 m_nLimit;
+ int32_t m_nLimit;
FX_WCHAR m_wcAliasChar;
- FX_INT32 m_nFirstLineEnd;
+ int32_t m_nFirstLineEnd;
FX_BOOL m_bAutoLineEnd;
FX_WCHAR m_wLineEnd;
@@ -202,9 +202,9 @@ class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord public:
CFDE_TxtEdtDoRecord_Insert(FX_BSTR bsDoRecord);
CFDE_TxtEdtDoRecord_Insert( CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
FX_LPCWSTR lpText,
- FX_INT32 nLength);
+ int32_t nLength);
virtual void Release();
virtual FX_BOOL Undo();
virtual FX_BOOL Redo();
@@ -214,7 +214,7 @@ protected: void Deserialize(FX_BSTR bsDoRecord);
private:
CFDE_TxtEdtEngine * m_pEngine;
- FX_INT32 m_nCaret;
+ int32_t m_nCaret;
CFX_WideString m_wsInsert;
};
class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord
@@ -222,8 +222,8 @@ class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord public:
CFDE_TxtEdtDoRecord_DeleteRange(FX_BSTR bsDoRecord);
CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nIndex,
- FX_INT32 nCaret,
+ int32_t nIndex,
+ int32_t nCaret,
const CFX_WideString &wsRange,
FX_BOOL bSel = FALSE);
virtual void Release();
@@ -236,8 +236,8 @@ protected: private:
CFDE_TxtEdtEngine * m_pEngine;
FX_BOOL m_bSel;
- FX_INT32 m_nIndex;
- FX_INT32 m_nCaret;
+ int32_t m_nIndex;
+ int32_t m_nCaret;
CFX_WideString m_wsRange;
};
#ifdef FDE_USEFORMATBLOCK
@@ -246,12 +246,12 @@ class CFDE_TxtEdtDoRecord_FieldInsert : public IFDE_TxtEdtDoRecord public:
CFDE_TxtEdtDoRecord_FieldInsert(FX_BSTR bsDoRecord);
CFDE_TxtEdtDoRecord_FieldInsert(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nOldFieldLength,
- FX_INT32 nNewFieldLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nOldFieldLength,
+ int32_t nNewFieldLength,
const CFX_WideString &wsIns,
FX_BOOL bSel = FALSE);
virtual void Release();
@@ -264,12 +264,12 @@ protected: private:
CFDE_TxtEdtEngine * m_pEngine;
- FX_INT32 m_nCaret;
+ int32_t m_nCaret;
CFDE_TxtEdtField * m_pField;
- FX_INT32 m_nIndexInField;
- FX_INT32 m_nFieldBgn;
- FX_INT32 m_nOldFieldLength;
- FX_INT32 m_nNewFieldLength;
+ int32_t m_nIndexInField;
+ int32_t m_nFieldBgn;
+ int32_t m_nOldFieldLength;
+ int32_t m_nNewFieldLength;
CFX_WideString m_wsIns;
FX_BOOL m_bSel;
};
@@ -278,12 +278,12 @@ class CFDE_TxtEdtDoRecord_FieldDelete : public IFDE_TxtEdtDoRecord public:
CFDE_TxtEdtDoRecord_FieldDelete(FX_BSTR bsDoRecord);
CFDE_TxtEdtDoRecord_FieldDelete(CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
+ int32_t nCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nOldLength,
- FX_INT32 nNewLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nOldLength,
+ int32_t nNewLength,
const CFX_WideString &wsDel,
FX_BOOL bSel = FALSE);
virtual void Release();
@@ -295,12 +295,12 @@ protected: void Deserialize(FX_BSTR bsDoRecord);
private:
CFDE_TxtEdtEngine * m_pEngine;
- FX_INT32 m_nCaret;
+ int32_t m_nCaret;
CFDE_TxtEdtField * m_pField;
- FX_INT32 m_nIndexInField;
- FX_INT32 m_nFieldBgn;
- FX_INT32 m_nOldFieldLength;
- FX_INT32 m_nNewFieldLength;
+ int32_t m_nIndexInField;
+ int32_t m_nFieldBgn;
+ int32_t m_nOldFieldLength;
+ int32_t m_nNewFieldLength;
CFX_WideString m_wsDel;
FX_BOOL m_bSel;
};
@@ -309,12 +309,12 @@ class CFDE_TxtEdtDoRecord_FieldReplace : public IFDE_TxtEdtDoRecord public:
CFDE_TxtEdtDoRecord_FieldReplace(FX_BSTR bsDoRecord);
CFDE_TxtEdtDoRecord_FieldReplace( CFDE_TxtEdtEngine * pEngine,
- FX_INT32 nCaret,
- FX_INT32 nNewCaret,
+ int32_t nCaret,
+ int32_t nNewCaret,
CFDE_TxtEdtField * pField,
- FX_INT32 nIndexInField,
- FX_INT32 nFieldBgn,
- FX_INT32 nFieldNewLength,
+ int32_t nIndexInField,
+ int32_t nFieldBgn,
+ int32_t nFieldNewLength,
const CFX_WideString &wsDel,
const CFX_WideString &wsIns,
FX_BOOL bSel);
@@ -327,12 +327,12 @@ protected: void Deserialize(FX_BSTR bsDoRecord);
private:
CFDE_TxtEdtEngine * m_pEngine;
- FX_INT32 m_nCaret;
- FX_INT32 m_nNewCaret;
+ int32_t m_nCaret;
+ int32_t m_nNewCaret;
CFDE_TxtEdtField * m_pField;
- FX_INT32 m_nIndexInField;
- FX_INT32 m_nFieldBgn;
- FX_INT32 m_nFieldNewLength;
+ int32_t m_nIndexInField;
+ int32_t m_nFieldBgn;
+ int32_t m_nFieldNewLength;
CFX_WideString m_wsDel;
CFX_WideString m_wsIns;
FX_BOOL m_bSel;
diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.cpp b/xfa/src/fee/src/fee/fde_txtedtpage.cpp index e0a94f81fa..30b4d1bf3e 100644 --- a/xfa/src/fee/src/fee/fde_txtedtpage.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtpage.cpp @@ -14,7 +14,7 @@ #include "fde_txtedtparag.h"
#include "fde_txtedtbuf.h"
#define FDE_TXTEDT_TOLERANCE 0.1f
-IFDE_TxtEdtPage * IFDE_TxtEdtPage::Create(IFDE_TxtEdtEngine * pEngine, FX_INT32 nIndex)
+IFDE_TxtEdtPage * IFDE_TxtEdtPage::Create(IFDE_TxtEdtEngine * pEngine, int32_t nIndex)
{
return (IFDE_TxtEdtPage*)FX_NEW CFDE_TxtEdtPage(pEngine, nIndex);
}
@@ -46,11 +46,11 @@ FX_BOOL CFDE_TxtEdtTextSet::GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) {
return FALSE;
}
-FX_INT32 CFDE_TxtEdtTextSet::GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText)
+int32_t CFDE_TxtEdtTextSet::GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText)
{
FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText;
FX_LPWSTR pBuffer = wsText.GetBuffer(pPiece->nCount);
- for (FX_INT32 i = 0; i < pPiece->nCount; i++) {
+ for (int32_t i = 0; i < pPiece->nCount; i++) {
pBuffer[i] = m_pPage->GetChar((FX_LPVOID)hText, i);
}
wsText.ReleaseBuffer(pPiece->nCount);
@@ -68,13 +68,13 @@ FX_ARGB CFDE_TxtEdtTextSet::GetFontColor(FDE_HVISUALOBJ hText) {
return m_pPage->GetEngine()->GetEditParams()->dwFontColor;
}
-FX_INT32 CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms )
+int32_t CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms )
{
if (hText == NULL) {
return 0;
}
FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText;
- FX_INT32 nLength = pPiece->nCount;
+ int32_t nLength = pPiece->nCount;
if (nLength < 1) {
return 0;
}
@@ -97,18 +97,18 @@ FX_INT32 CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS tr.wLineBreakChar = pTextParams->wLineBreakChar;
return pBreak->GetDisplayPos(&tr, pCharPos, bCharCode, pWSForms);
}
-FX_INT32 CFDE_TxtEdtTextSet::GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray)
+int32_t CFDE_TxtEdtTextSet::GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray)
{
return GetCharRects_Impl(hText, rtArray);
}
-FX_INT32 CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox )
+int32_t CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox )
{
if (hText == NULL) {
return 0;
}
FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText;
CFDE_TxtEdtEngine * pEngine = (CFDE_TxtEdtEngine*)(m_pPage->GetEngine());
- FX_INT32 nLength = pPiece->nCount;
+ int32_t nLength = pPiece->nCount;
if (nLength < 1) {
return 0;
}
@@ -129,7 +129,7 @@ FX_INT32 CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFAr tr.wLineBreakChar = pTextParams->wLineBreakChar;
return pEngine->GetTextBreak()->GetCharRects(&tr, rtArray, bBBox);
}
-CFDE_TxtEdtPage::CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, FX_INT32 nPageIndex)
+CFDE_TxtEdtPage::CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, int32_t nPageIndex)
: m_pIter(NULL)
, m_pTextSet(NULL)
, m_nRefCount(0)
@@ -192,15 +192,15 @@ FX_BOOL CFDE_TxtEdtPage::GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) {
return FALSE;
}
-FX_INT32 CFDE_TxtEdtPage::GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox ) const
+int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex, CFX_RectF &rect, FX_BOOL bBBox ) const
{
FXSYS_assert(m_nRefCount > 0);
FXSYS_assert(nIndex >= 0 && nIndex < m_nCharCount);
if (m_nRefCount < 1) {
return 0;
}
- FX_INT32 nCount = m_PieceMassArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_PieceMassArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
const FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i);
if (nIndex >= pPiece->nStart && nIndex < (pPiece->nStart + pPiece->nCount)) {
CFX_RectFArray rectArr;
@@ -216,17 +216,17 @@ FX_INT32 CFDE_TxtEdtPage::GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL FXSYS_assert(0);
return 0;
}
-FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore)
+int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore)
{
FX_BOOL bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
CFX_PointF ptF = fPoint;
NormalizePt2Rect(ptF, m_rtPageContents, FDE_TXTEDT_TOLERANCE);
- FX_INT32 nCount = m_PieceMassArr.GetSize();
+ int32_t nCount = m_PieceMassArr.GetSize();
CFX_RectF rtLine;
- FX_INT32 nBgn = 0;
- FX_INT32 nEnd = 0;
+ int32_t nBgn = 0;
+ int32_t nEnd = 0;
FX_BOOL bInLine = FALSE;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nCount; i ++) {
const FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i);
if (!bInLine && (bVertical ? (pPiece->rtPiece.left <= ptF.x && pPiece->rtPiece.right() > ptF.x) \
@@ -245,7 +245,7 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor }
}
NormalizePt2Rect(ptF, rtLine, FDE_TXTEDT_TOLERANCE);
- FX_INT32 nCaret = 0;
+ int32_t nCaret = 0;
FDE_LPTEXTEDITPIECE pPiece = NULL;
for (i = nBgn; i <= nEnd; i ++) {
pPiece = m_PieceMassArr.GetPtrAt(i);
@@ -253,8 +253,8 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor if (pPiece->rtPiece.Contains(ptF)) {
CFX_RectFArray rectArr;
m_pTextSet->GetCharRects((FDE_HVISUALOBJ)pPiece, rectArr);
- FX_INT32 nRtCount = rectArr.GetSize();
- for (FX_INT32 j = 0; j < nRtCount; j ++) {
+ int32_t nRtCount = rectArr.GetSize();
+ for (int32_t j = 0; j < nRtCount; j ++) {
if (rectArr[j].Contains(ptF)) {
nCaret = m_nPageStart + pPiece->nStart + j;
if (nCaret >= m_pEditEngine->GetTextBufLength()) {
@@ -285,34 +285,34 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor bBefore = TRUE;
return nCaret;
}
-FX_INT32 CFDE_TxtEdtPage::GetCharStart() const
+int32_t CFDE_TxtEdtPage::GetCharStart() const
{
return m_nPageStart;
}
-FX_INT32 CFDE_TxtEdtPage::GetCharCount() const
+int32_t CFDE_TxtEdtPage::GetCharCount() const
{
return m_nCharCount;
}
-FX_INT32 CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox ) const
+int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox ) const
{
pCharPos = (FXTEXT_CHARPOS*)FDE_Alloc(sizeof(FXTEXT_CHARPOS) * m_nCharCount);
- FX_INT32 nCharPosCount = 0;
+ int32_t nCharPosCount = 0;
FDE_HVISUALOBJ hVisualObj = NULL;
- FX_INT32 nVisualObjCount = m_PieceMassArr.GetSize();
+ int32_t nVisualObjCount = m_PieceMassArr.GetSize();
FXTEXT_CHARPOS* pos = pCharPos;
CFX_RectF rtObj;
- for (FX_INT32 i = 0; i < nVisualObjCount; i ++) {
+ for (int32_t i = 0; i < nVisualObjCount; i ++) {
hVisualObj = (FDE_HVISUALOBJ)m_PieceMassArr.GetPtrAt(i);
m_pTextSet->GetRect(hVisualObj, rtObj);
if (!rtClip.IntersectWith(rtObj)) {
continue;
}
- FX_INT32 nCount = m_pTextSet->GetDisplayPos(hVisualObj, pos, FALSE);
+ int32_t nCount = m_pTextSet->GetDisplayPos(hVisualObj, pos, FALSE);
nCharPosCount += nCount;
pos += nCount;
}
if ((nCharPosCount * 5) < (m_nCharCount << 2)) {
- FX_INT32 nLength = sizeof(FXTEXT_CHARPOS) * nCharPosCount;
+ int32_t nLength = sizeof(FXTEXT_CHARPOS) * nCharPosCount;
FXTEXT_CHARPOS * pTemp = (FXTEXT_CHARPOS*)FDE_Alloc(nLength);
FXSYS_memcpy(pTemp, pCharPos, nLength);
FDE_Free(pCharPos);
@@ -320,16 +320,16 @@ FX_INT32 CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS }
return nCharPosCount;
}
-void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const
+void CFDE_TxtEdtPage::CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const
{
- FX_INT32 nPieceCount = m_PieceMassArr.GetSize();
- FX_INT32 nEnd = nStart + nCount - 1;
+ int32_t nPieceCount = m_PieceMassArr.GetSize();
+ int32_t nEnd = nStart + nCount - 1;
FX_BOOL bInRange = FALSE;
- for (FX_INT32 i = 0; i < nPieceCount; i ++) {
+ for (int32_t i = 0; i < nPieceCount; i ++) {
FDE_LPTEXTEDITPIECE piece = m_PieceMassArr.GetPtrAt(i);
if (!bInRange) {
if (nStart >= piece->nStart && nStart < (piece->nStart + piece->nCount)) {
- FX_INT32 nRangeEnd = piece->nCount - 1;
+ int32_t nRangeEnd = piece->nCount - 1;
FX_BOOL bEnd = FALSE;
if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) {
nRangeEnd = nEnd - piece->nStart;
@@ -337,7 +337,7 @@ void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_R }
CFX_RectFArray rcArr;
m_pTextSet->GetCharRects((FDE_HVISUALOBJ)piece, rcArr);
- FX_INT32 nSize = rcArr.GetSize();
+ int32_t nSize = rcArr.GetSize();
CFX_RectF rectPiece = rcArr[nStart - piece->nStart];
rectPiece.Union(rcArr[nRangeEnd]);
RectFArr.Add(rectPiece);
@@ -360,14 +360,14 @@ void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_R }
return;
}
-FX_INT32 CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount)
+int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, int32_t &nCount)
{
if (m_nRefCount < 0) {
return - 1;
}
IFDE_TxtEdtBuf * pBuf = m_pEditEngine->GetTextBuf();
FX_BOOL bBefore;
- FX_INT32 nIndex = GetCharIndex(fPoint, bBefore);
+ int32_t nIndex = GetCharIndex(fPoint, bBefore);
if (nIndex == m_pEditEngine->GetTextBufLength()) {
nIndex = m_pEditEngine->GetTextBufLength() - 1;
}
@@ -378,7 +378,7 @@ FX_INT32 CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount) pIter->Attach(FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pBuf));
pIter->SetAt(nIndex);
nCount = pIter->GetWordLength();
- FX_INT32 nRet = pIter->GetWordPos();
+ int32_t nRet = pIter->GetWordPos();
pIter->Release();
return nRet;
}
@@ -386,7 +386,7 @@ FX_BOOL CFDE_TxtEdtPage::IsLoaded(FX_LPCRECTF pClipBox ) {
return m_bLoaded;
}
-FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause )
+int32_t CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause )
{
if (m_nRefCount > 0) {
m_nRefCount ++;
@@ -405,12 +405,12 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) IFX_TxtBreak * pBreak = m_pEditEngine->GetTextBreak();
pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pBreak->ClearBreakPieces();
- FX_INT32 nLineCount = m_pEditEngine->GetLineCount();
- FX_INT32 nPageLineCount = m_pEditEngine->GetPageLineCount();
- FX_INT32 nLength = pBuf->GetTextLength();
- FX_INT32 nStartLine = nPageLineCount * m_nPageIndex;
- FX_INT32 nEndLine = FX_MIN((nStartLine + nPageLineCount - 1), (m_pEditEngine->GetLineCount() - 1));
- FX_INT32 nPageStart, nPageEnd, nTemp, nBgnParag, nStartLineInParag, nEndParag, nEndLineInParag;
+ int32_t nLineCount = m_pEditEngine->GetLineCount();
+ int32_t nPageLineCount = m_pEditEngine->GetPageLineCount();
+ int32_t nLength = pBuf->GetTextLength();
+ int32_t nStartLine = nPageLineCount * m_nPageIndex;
+ int32_t nEndLine = FX_MIN((nStartLine + nPageLineCount - 1), (m_pEditEngine->GetLineCount() - 1));
+ int32_t nPageStart, nPageEnd, nTemp, nBgnParag, nStartLineInParag, nEndParag, nEndLineInParag;
nBgnParag = m_pEditEngine->Line2Parag(0, 0, nStartLine, nStartLineInParag);
m_pBgnParag = (CFDE_TxtEdtParag*)m_pEditEngine->GetParag(nBgnParag);
m_pBgnParag->LoadParag();
@@ -430,12 +430,12 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) }
m_PieceMassArr.RemoveAll(TRUE);
FX_DWORD dwBreakStatus = FX_TXTBREAK_None;
- FX_INT32 nLineStart = nPageStart;
- FX_INT32 nPieceStart = 0;
+ int32_t nLineStart = nPageStart;
+ int32_t nPieceStart = 0;
if (m_pCharWidth != NULL) {
delete [] m_pCharWidth;
}
- m_pCharWidth = new FX_INT32[nPageEnd - nPageStart + 1];
+ m_pCharWidth = new int32_t[nPageEnd - nPageStart + 1];
pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pBreak->ClearBreakPieces();
m_nPageStart = nPageStart;
@@ -445,7 +445,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) IFX_CharIter * pIter = m_pIter->Clone();
pIter->SetAt(nPageStart);
m_pIter->SetAt(nPageStart);
- FX_INT32 nTextEnd = m_pEditEngine->GetTextBufLength();
+ int32_t nTextEnd = m_pEditEngine->GetTextBufLength();
FX_BOOL bFirstPiece = TRUE;
do {
if (bReload) {
@@ -458,8 +458,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) dwBreakStatus = pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
}
if (dwBreakStatus > FX_TXTBREAK_PieceBreak) {
- FX_INT32 nPieceCount = pBreak->CountBreakPieces();
- for (FX_INT32 j = 0; j < nPieceCount; j ++) {
+ int32_t nPieceCount = pBreak->CountBreakPieces();
+ for (int32_t j = 0; j < nPieceCount; j ++) {
const CFX_TxtPiece * pPiece = pBreak->GetBreakPiece(j);
FDE_TEXTEDITPIECE TxtEdtPiece;
FXSYS_memset(&TxtEdtPiece, 0, sizeof(FDE_TEXTEDITPIECE));
@@ -508,7 +508,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) }
nPieceStart += TxtEdtPiece.nCount;
m_PieceMassArr.Add(TxtEdtPiece);
- for (FX_INT32 k = 0; k < TxtEdtPiece.nCount; k ++) {
+ for (int32_t k = 0; k < TxtEdtPiece.nCount; k ++) {
CFX_Char* ptc = pPiece->GetCharPtr(k);
m_pCharWidth[TxtEdtPiece.nStart + k] = ptc->m_iCharWidth;
}
@@ -528,8 +528,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) fDelta = pParams->fPlateWidth - m_rtPageContents.width;
} else if (pParams->dwAlignment & FDE_TEXTEDITALIGN_Center) {
if ((pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) && m_nCharCount > 1) {
- FX_INT32 nCount = m_nCharCount - 1;
- FX_INT32 n = (m_pEditEngine->m_nLimit - nCount) / 2;
+ int32_t nCount = m_nCharCount - 1;
+ int32_t n = (m_pEditEngine->m_nLimit - nCount) / 2;
fDelta = (m_rtPageContents.width / nCount) * n;
} else {
fDelta = (pParams->fPlateWidth - m_rtPageContents.width) / 2;
@@ -537,8 +537,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) }
}
FX_FLOAT fOffset = m_rtPageContents.left - fDelta;
- FX_INT32 nCount = m_PieceMassArr.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_PieceMassArr.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i);
pPiece->rtPiece.Offset(-fOffset, 0.0f);
}
@@ -546,7 +546,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) }
if (m_pEditEngine->GetEditParams()->dwLayoutStyles & FDE_TEXTEDITLAYOUT_LastLineHeight) {
m_rtPageContents.height -= pParams->fLineSpace - pParams->fFontSize;
- FX_INT32 nCount = m_PieceMassArr.GetSize();
+ int32_t nCount = m_PieceMassArr.GetSize();
FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(nCount - 1);
pPiece->rtPiece.height = pParams->fFontSize;
}
@@ -601,12 +601,12 @@ FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas, FX_POSITION &pos pos = NULL;
return NULL;
}
- FX_INT32 nPos = (FX_INT32)(FX_UINTPTR)pos;
+ int32_t nPos = (int32_t)(uintptr_t)pos;
pVisualSet = m_pTextSet;
if (nPos + 1 > m_PieceMassArr.GetSize()) {
pos = NULL;
} else {
- pos = (FX_POSITION)(FX_UINTPTR)(nPos + 1);
+ pos = (FX_POSITION)(uintptr_t)(nPos + 1);
}
return (FDE_HVISUALOBJ)(m_PieceMassArr.GetPtrAt(nPos - 1));
}
@@ -614,9 +614,9 @@ FDE_HVISUALOBJ CFDE_TxtEdtPage::GetParentCanvas(FDE_HVISUALOBJ hCanvas, IFDE_Vis {
return NULL;
}
-FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, FX_INT32 index) const
+FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, int32_t index) const
{
- FX_INT32 nIndex = m_nPageStart + ((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index;
+ int32_t nIndex = m_nPageStart + ((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index;
if (nIndex != m_pIter->GetAt()) {
m_pIter->SetAt(nIndex);
}
@@ -624,9 +624,9 @@ FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, FX_INT32 index) const m_pIter->Next();
return wChar;
}
-FX_INT32 CFDE_TxtEdtPage::GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const
+int32_t CFDE_TxtEdtPage::GetWidth(FX_LPVOID pIdentity, int32_t index) const
{
- FX_INT32 nWidth = m_pCharWidth[((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index];
+ int32_t nWidth = m_pCharWidth[((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index];
return nWidth;
}
void CFDE_TxtEdtPage::NormalizePt2Rect(CFX_PointF &ptF, const CFX_RectF &rtF, FX_FLOAT fTolerance) const
diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.h b/xfa/src/fee/src/fee/fde_txtedtpage.h index 7c0d0d1ae0..b2854d4afb 100644 --- a/xfa/src/fee/src/fee/fde_txtedtpage.h +++ b/xfa/src/fee/src/fee/fde_txtedtpage.h @@ -44,9 +44,9 @@ static FDE_TXTEDT_CHARTYPE FDE_GetEditSelCharType(FX_WCHAR wChar) }
}
typedef struct _FDE_TXTEDTPIECE {
- FX_INT32 nStart;
- FX_INT32 nCount;
- FX_INT32 nBidiLevel;
+ int32_t nStart;
+ int32_t nCount;
+ int32_t nBidiLevel;
CFX_RectF rtPiece;
FX_DWORD dwCharStyles;
} FDE_TEXTEDITPIECE, * FDE_LPTEXTEDITPIECE;
@@ -62,13 +62,13 @@ public: virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix &matrix);
virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt);
virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt);
- virtual FX_INT32 GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText);
+ virtual int32_t GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText);
virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText);
virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText);
virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText);
- virtual FX_INT32 GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL);
- virtual FX_INT32 GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray);
- virtual FX_INT32 GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox = FALSE);
+ virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL);
+ virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray);
+ virtual int32_t GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox = FALSE);
private:
CFDE_TxtEdtPage * m_pPage;
@@ -76,7 +76,7 @@ private: class CFDE_TxtEdtPage : public IFDE_TxtEdtPage
{
public:
- CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, FX_INT32 nLineIndex);
+ CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, int32_t nLineIndex);
virtual void Release();
virtual IFDE_TxtEdtEngine * GetEngine() const;
@@ -86,24 +86,24 @@ public: virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix &matrix);
virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt);
virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt);
- virtual FX_INT32 GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const;
- virtual FX_INT32 GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore);
- virtual FX_INT32 SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount);
- virtual FX_INT32 GetCharStart() const;
- virtual FX_INT32 GetCharCount() const;
- virtual void CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const;
- virtual FX_INT32 GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox) const;
+ virtual int32_t GetCharRect(int32_t nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const;
+ virtual int32_t GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore);
+ virtual int32_t SelectWord(const CFX_PointF &fPoint, int32_t &nCount);
+ virtual int32_t GetCharStart() const;
+ virtual int32_t GetCharCount() const;
+ virtual void CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const;
+ virtual int32_t GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox) const;
virtual FX_BOOL IsLoaded(FX_LPCRECTF pClipBox = NULL);
- virtual FX_INT32 LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL);
+ virtual int32_t LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL);
virtual void UnloadPage(FX_LPCRECTF pClipBox = NULL);
virtual const CFX_RectF& GetContentsBox();
virtual FX_POSITION GetFirstPosition(FDE_HVISUALOBJ hCanvas);
virtual FDE_HVISUALOBJ GetNext(FDE_HVISUALOBJ hCanvas, FX_POSITION &pos, IFDE_VisualSet *&pVisualSet);
virtual FDE_HVISUALOBJ GetParentCanvas(FDE_HVISUALOBJ hCanvas, IFDE_VisualSet *&pVisualSet);
- virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, FX_INT32 index) const;
- virtual FX_INT32 GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const;
+ virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, int32_t index) const;
+ virtual int32_t GetWidth(FX_LPVOID pIdentity, int32_t index) const;
protected:
virtual ~CFDE_TxtEdtPage();
private:
@@ -115,16 +115,16 @@ private: CFDE_TxtEdtParag * m_pBgnParag;
CFDE_TxtEdtParag * m_pEndParag;
- FX_INT32 m_nRefCount;
- FX_INT32 m_nPageStart;
- FX_INT32 m_nCharCount;
- FX_INT32 m_nPageIndex;
+ int32_t m_nRefCount;
+ int32_t m_nPageStart;
+ int32_t m_nCharCount;
+ int32_t m_nPageIndex;
FX_BOOL m_bLoaded;
FX_BOOL m_bLastPage;
CFX_RectF m_rtPage;
CFX_RectF m_rtPageMargin;
CFX_RectF m_rtPageContents;
CFX_RectF m_rtPageCanvas;
- FX_INT32* m_pCharWidth;
+ int32_t* m_pCharWidth;
};
#endif
diff --git a/xfa/src/fee/src/fee/fde_txtedtparag.cpp b/xfa/src/fee/src/fee/fde_txtedtparag.cpp index 9887ddcd3c..ad9082c605 100644 --- a/xfa/src/fee/src/fee/fde_txtedtparag.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtparag.cpp @@ -29,7 +29,7 @@ CFDE_TxtEdtParag::~CFDE_TxtEdtParag() void CFDE_TxtEdtParag::LoadParag()
{
if (m_lpData != NULL) {
- ((FX_INT32*)m_lpData)[0]++;
+ ((int32_t*)m_lpData)[0]++;
return;
}
IFX_TxtBreak * pTxtBreak = m_pEngine->GetTextBreak();
@@ -41,11 +41,11 @@ void CFDE_TxtEdtParag::LoadParag() }
IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf, wcAlias);
pIter->SetAt(m_nCharStart);
- FX_INT32 nEndIndex = m_nCharStart + m_nCharCount;
- CFX_ArrayTemplate<FX_INT32> LineBaseArr;
+ int32_t nEndIndex = m_nCharStart + m_nCharCount;
+ CFX_ArrayTemplate<int32_t> LineBaseArr;
FX_BOOL bReload = FALSE;
FX_DWORD dwBreakStatus = FX_TXTBREAK_None;
- FX_INT32 nTextEnd = m_pEngine->GetTextBufLength();
+ int32_t nTextEnd = m_pEngine->GetTextBufLength();
do {
if (bReload) {
dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
@@ -57,9 +57,9 @@ void CFDE_TxtEdtParag::LoadParag() dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
}
if (dwBreakStatus > FX_TXTBREAK_PieceBreak) {
- FX_INT32 nCount = pTxtBreak->CountBreakPieces();
- FX_INT32 nTotal = 0;
- for (FX_INT32 j = 0; j < nCount; j ++) {
+ int32_t nCount = pTxtBreak->CountBreakPieces();
+ int32_t nTotal = 0;
+ for (int32_t j = 0; j < nCount; j ++) {
const CFX_TxtPiece * Piece = pTxtBreak->GetBreakPiece(j);
nTotal += Piece->GetLength();
}
@@ -74,18 +74,18 @@ void CFDE_TxtEdtParag::LoadParag() pIter->Release();
pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pTxtBreak->ClearBreakPieces();
- FX_INT32 nLineCount = LineBaseArr.GetSize();
+ int32_t nLineCount = LineBaseArr.GetSize();
m_nLineCount = nLineCount;
if (m_lpData == NULL) {
- m_lpData = FX_Alloc(FX_INT32, nLineCount + 1);
+ m_lpData = FX_Alloc(int32_t, nLineCount + 1);
} else {
- m_lpData = FX_Realloc(FX_INT32, m_lpData, (nLineCount + 1));
+ m_lpData = FX_Realloc(int32_t, m_lpData, (nLineCount + 1));
}
- FX_INT32 * pIntArr = (FX_INT32*)m_lpData;
+ int32_t * pIntArr = (int32_t*)m_lpData;
pIntArr[0] = 1;
m_nLineCount = nLineCount;
pIntArr ++;
- for (FX_INT32 j = 0; j < nLineCount; j ++, pIntArr ++) {
+ for (int32_t j = 0; j < nLineCount; j ++, pIntArr ++) {
*pIntArr = LineBaseArr[j];
}
LineBaseArr.RemoveAll();
@@ -93,9 +93,9 @@ void CFDE_TxtEdtParag::LoadParag() void CFDE_TxtEdtParag::UnloadParag()
{
FXSYS_assert(m_lpData != NULL);
- ((FX_INT32*)m_lpData)[0]--;
- FXSYS_assert(((FX_INT32*)m_lpData)[0] >= 0);
- if (((FX_INT32*)m_lpData)[0] == 0) {
+ ((int32_t*)m_lpData)[0]--;
+ FXSYS_assert(((int32_t*)m_lpData)[0] >= 0);
+ if (((int32_t*)m_lpData)[0] == 0) {
FX_Free(m_lpData);
m_lpData = NULL;
}
@@ -105,12 +105,12 @@ void CFDE_TxtEdtParag::CalcLines() IFX_TxtBreak * pTxtBreak = m_pEngine->GetTextBreak();
IFDE_TxtEdtBuf * pTxtBuf = m_pEngine->GetTextBuf();
IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf);
- FX_INT32 nCount = 0;
+ int32_t nCount = 0;
FX_DWORD dwBreakStatus = FX_TXTBREAK_None;
- FX_INT32 nEndIndex = m_nCharStart + m_nCharCount;
+ int32_t nEndIndex = m_nCharStart + m_nCharCount;
pIter->SetAt(m_nCharStart);
FX_BOOL bReload = FALSE;
- FX_INT32 nTextEnd = m_pEngine->GetTextBufLength();
+ int32_t nTextEnd = m_pEngine->GetTextBufLength();
do {
if (bReload) {
dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
@@ -135,13 +135,13 @@ void CFDE_TxtEdtParag::CalcLines() pTxtBreak->ClearBreakPieces();
m_nLineCount = nCount;
}
-void CFDE_TxtEdtParag::GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const
+void CFDE_TxtEdtParag::GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const
{
- FX_INT32 * pLineBaseArr = (FX_INT32*)m_lpData;
+ int32_t * pLineBaseArr = (int32_t*)m_lpData;
FXSYS_assert(nLineIndex < m_nLineCount);
nStart = m_nCharStart;
pLineBaseArr ++;
- for (FX_INT32 i = 0; i < nLineIndex; i ++) {
+ for (int32_t i = 0; i < nLineIndex; i ++) {
nStart += *pLineBaseArr;
pLineBaseArr ++;
}
diff --git a/xfa/src/fee/src/fee/fde_txtedtparag.h b/xfa/src/fee/src/fee/fde_txtedtparag.h index 276654e2fa..aca5d8febc 100644 --- a/xfa/src/fee/src/fee/fde_txtedtparag.h +++ b/xfa/src/fee/src/fee/fde_txtedtparag.h @@ -13,25 +13,25 @@ class CFDE_TxtEdtParag : public IFDE_TxtEdtParag public:
CFDE_TxtEdtParag(CFDE_TxtEdtEngine * pEngine);
~CFDE_TxtEdtParag();
- virtual FX_INT32 GetTextLength() const
+ virtual int32_t GetTextLength() const
{
return m_nCharCount;
}
- virtual FX_INT32 GetStartIndex() const
+ virtual int32_t GetStartIndex() const
{
return m_nCharStart;
}
- virtual FX_INT32 CountLines() const
+ virtual int32_t CountLines() const
{
return m_nLineCount;
}
- virtual void GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const;
+ virtual void GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const;
void LoadParag();
void UnloadParag();
void CalcLines();
- FX_INT32 m_nCharStart;
- FX_INT32 m_nCharCount;
- FX_INT32 m_nLineCount;
+ int32_t m_nCharStart;
+ int32_t m_nCharCount;
+ int32_t m_nLineCount;
private:
FX_LPVOID m_lpData;
CFDE_TxtEdtEngine* m_pEngine;
diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp index 4847af9ed3..ff8dafcf0f 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp @@ -44,14 +44,14 @@ FX_WCHAR CFX_CharIter::GetChar() {
return m_wsText.GetAt(m_nIndex);
}
-void CFX_CharIter::SetAt(FX_INT32 nIndex)
+void CFX_CharIter::SetAt(int32_t nIndex)
{
if (nIndex < 0 || nIndex >= m_wsText.GetLength()) {
return;
}
m_nIndex = nIndex;
}
-FX_INT32 CFX_CharIter::GetAt() const
+int32_t CFX_CharIter::GetAt() const
{
return m_nIndex;
}
@@ -118,7 +118,7 @@ FX_BOOL CFX_WordBreak::Next(FX_BOOL bPrev) }
return TRUE;
}
-void CFX_WordBreak::SetAt(FX_INT32 nIndex)
+void CFX_WordBreak::SetAt(int32_t nIndex)
{
if (m_pPreIter) {
m_pPreIter->Release();
@@ -130,23 +130,23 @@ void CFX_WordBreak::SetAt(FX_INT32 nIndex) m_pCurIter = m_pPreIter->Clone();
FindNextBreakPos(m_pCurIter, FALSE, FALSE);
}
-FX_INT32 CFX_WordBreak::GetWordPos() const
+int32_t CFX_WordBreak::GetWordPos() const
{
return m_pPreIter->GetAt();
}
-FX_INT32 CFX_WordBreak::GetWordLength() const
+int32_t CFX_WordBreak::GetWordLength() const
{
return m_pCurIter->GetAt() - m_pPreIter->GetAt() + 1;
}
void CFX_WordBreak::GetWord(CFX_WideString &wsWord) const
{
- FX_INT32 nWordLength = GetWordLength();
+ int32_t nWordLength = GetWordLength();
if (nWordLength <= 0) {
return;
}
FX_LPWSTR lpBuf = wsWord.GetBuffer(nWordLength);
IFX_CharIter * pTempIter = m_pPreIter->Clone();
- FX_INT32 i = 0;
+ int32_t i = 0;
while (pTempIter->GetAt() <= m_pCurIter->GetAt()) {
lpBuf[i++] = pTempIter->GetChar();
FX_BOOL bEnd = pTempIter->Next();
@@ -190,7 +190,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter * pIter, FX_BOOL bPrev, return TRUE;
}
if (bFirst) {
- FX_INT32 nFlags = 0;
+ int32_t nFlags = 0;
if (eCurType == FX_WordBreakProp_MidLetter) {
if (eNextType == FX_WordBreakProp_ALetter) {
nFlags = 1;
@@ -219,7 +219,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter * pIter, FX_BOOL bPrev, bFirst = FALSE;
}
if (wBreak) {
- FX_INT32 nFlags = 0;
+ int32_t nFlags = 0;
if (eNextType == FX_WordBreakProp_MidLetter) {
if (eCurType == FX_WordBreakProp_ALetter) {
nFlags = 1;
diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h index d897fc5867..3954f01a44 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h @@ -7,7 +7,7 @@ #ifndef _FX_WORDBREAK_IMPL_H
#define _FX_WORDBREAK_IMPL_H
extern const FX_WORD gs_FX_WordBreak_Table[16];
-extern const FX_BYTE gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1];
+extern const uint8_t gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1];
enum FX_WordBreakProp {
FX_WordBreakProp_None = 0 ,
FX_WordBreakProp_CR ,
@@ -31,15 +31,15 @@ public: virtual void Release();
virtual FX_BOOL Next(FX_BOOL bPrev = FALSE);
virtual FX_WCHAR GetChar();
- virtual void SetAt(FX_INT32 nIndex);
- virtual FX_INT32 GetAt() const;
+ virtual void SetAt(int32_t nIndex);
+ virtual int32_t GetAt() const;
virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const;
virtual IFX_CharIter * Clone();
protected:
~CFX_CharIter();
private:
const CFX_WideString &m_wsText;
- FX_INT32 m_nIndex;
+ int32_t m_nIndex;
};
class CFX_WordBreak : public IFX_WordBreak
{
@@ -49,9 +49,9 @@ public: virtual void Attach(IFX_CharIter * pIter);
virtual void Attach(const CFX_WideString &wsText);
virtual FX_BOOL Next(FX_BOOL bPrev);
- virtual void SetAt(FX_INT32 nIndex);
- virtual FX_INT32 GetWordPos() const;
- virtual FX_INT32 GetWordLength() const;
+ virtual void SetAt(int32_t nIndex);
+ virtual int32_t GetWordPos() const;
+ virtual int32_t GetWordLength() const;
virtual void GetWord(CFX_WideString &wsWord) const;
virtual FX_BOOL IsEOF(FX_BOOL bTail ) const;
protected:
diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp b/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp index 23e30479f4..957d2fcc5e 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp @@ -10,7 +10,7 @@ extern const FX_WORD gs_FX_WordBreak_Table[16] = { 0xFFFF, 0xFFF9, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xEFBB, 0xE77B,
0xFFFB, 0xFFFB, 0xFFFB, 0xE77B, 0xE73B, 0xFFFB, 0xFFFB, 0xFFFB,
};
-extern const FX_BYTE gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1] = {
+extern const uint8_t gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x90, 0xA0, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x89, 0x00, 0x00,
0x07, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x70, 0x00, 0x0C,
diff --git a/xfa/src/fgas/include/fx_alg.h b/xfa/src/fgas/include/fx_alg.h index ed946641f2..0ee8508083 100644 --- a/xfa/src/fgas/include/fx_alg.h +++ b/xfa/src/fgas/include/fx_alg.h @@ -10,11 +10,11 @@ #ifdef __cplusplus
extern "C" {
#endif
-FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst);
-FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst);
-FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst);
-FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow);
-FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces);
+int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst);
+int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst);
+int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst);
+uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow);
+int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces);
#ifdef __cplusplus
};
#endif
@@ -22,13 +22,13 @@ template<class baseType> class CFX_DSPATemplate
{
public:
- FX_INT32 Lookup(const baseType &find, const baseType *pArray, FX_INT32 iCount)
+ int32_t Lookup(const baseType &find, const baseType *pArray, int32_t iCount)
{
FXSYS_assert(pArray != NULL);
if (iCount < 1) {
return -1;
}
- FX_INT32 iStart = 0, iEnd = iCount - 1, iMid;
+ int32_t iStart = 0, iEnd = iCount - 1, iMid;
do {
iMid = (iStart + iEnd) / 2;
const baseType &v = pArray[iMid];
diff --git a/xfa/src/fgas/include/fx_cpg.h b/xfa/src/fgas/include/fx_cpg.h index 43c6520152..2556426dbc 100644 --- a/xfa/src/fgas/include/fx_cpg.h +++ b/xfa/src/fgas/include/fx_cpg.h @@ -130,28 +130,28 @@ class IFX_CodePage; #define FX_CHARSET_MSWin_EasterEuropean 238
#define FX_CHARSET_US 254
#define FX_CHARSET_OEM 255
-FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset);
+FX_WORD FX_GetCodePageFromCharset(uint8_t charset);
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage);
-FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength);
-FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength);
+FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength);
+FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength);
FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage);
-void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength);
-void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength);
-void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength);
-void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength);
-void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength);
-void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength);
-FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak = FALSE);
-FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen);
+void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength);
+void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength);
+void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength);
+void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength);
+void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength);
+void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength);
+int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak = FALSE);
+int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen);
enum FX_CODESYSTEM {
FX_MBCS = 0,
FX_SBCS ,
FX_DBCS ,
};
typedef struct _FX_CODEPAGE_HEADER {
- FX_UINT16 uCPID;
- FX_UINT8 uMinCharBytes;
- FX_UINT8 uMaxCharBytes;
+ uint16_t uCPID;
+ uint8_t uMinCharBytes;
+ uint8_t uMaxCharBytes;
FX_CODESYSTEM eCPType;
FX_BOOL bHasLeadByte;
FX_WCHAR wMinChar;
@@ -166,13 +166,13 @@ typedef struct _FX_CODEPAGE_HEADER { #define FX_CPMAPTYPE_NoMapping 3
#define FX_CPMAPTYPE_Delta 4
typedef struct _FX_CPCU_MAPTABLE1 {
- FX_UINT16 uMapType;
- FX_UINT16 uUniocde;
+ uint16_t uMapType;
+ uint16_t uUniocde;
} FX_CPCU_MAPTABLE1;
typedef struct _FX_CPCU_MAPTABLE2 {
- FX_UINT8 uTrailByte;
- FX_UINT8 uMapType;
- FX_UINT16 uOffset;
+ uint8_t uTrailByte;
+ uint8_t uMapType;
+ uint16_t uOffset;
} FX_CPCU_MAPTABLE2;
typedef struct _FX_CPCU_MAPINFO {
FX_CPCU_MAPTABLE1 *pMapTable1;
@@ -180,13 +180,13 @@ typedef struct _FX_CPCU_MAPINFO { FX_LPCBYTE pMapData;
} FX_CPCU_MAPINFO;
typedef struct _FX_CPUC_MAPTABLE {
- FX_UINT16 uStartUnicode;
- FX_UINT16 uEndUnicode;
- FX_UINT16 uMapType;
- FX_UINT16 uOffset;
+ uint16_t uStartUnicode;
+ uint16_t uEndUnicode;
+ uint16_t uMapType;
+ uint16_t uOffset;
} FX_CPUC_MAPTABLE;
typedef struct _FX_CPUC_MAPINFO {
- FX_UINT32 uMapCount;
+ uint32_t uMapCount;
FX_CPUC_MAPTABLE *pMapTable;
FX_LPCBYTE pMapData;
} FX_CPUC_MAPINFO;
@@ -197,12 +197,12 @@ typedef struct _FX_CODEPAGE { } FX_CODEPAGE, * FX_LPCODEPAGE;
typedef FX_CODEPAGE const * FX_LPCCODEPAGE;
typedef struct _FX_STR2CPHASH {
- FX_UINT32 uHash;
- FX_UINT32 uCodePage;
+ uint32_t uHash;
+ uint32_t uCodePage;
} FX_STR2CPHASH;
typedef struct _FX_CHARSET_MAP {
- FX_UINT16 charset;
- FX_UINT16 codepage;
+ uint16_t charset;
+ uint16_t codepage;
} FX_CHARSET_MAP;
typedef struct _FX_LANG2CPMAP {
FX_WORD wLanguage;
@@ -216,9 +216,9 @@ public: virtual FX_WORD GetCodePageNumber() const = 0;
virtual FX_CODESYSTEM GetCodeSystemType() const = 0;
virtual FX_BOOL HasLeadByte() const = 0;
- virtual FX_BOOL IsLeadByte(FX_BYTE byte) const = 0;
- virtual FX_INT32 GetMinBytesPerChar() const = 0;
- virtual FX_INT32 GetMaxBytesPerChar() const = 0;
+ virtual FX_BOOL IsLeadByte(uint8_t byte) const = 0;
+ virtual int32_t GetMinBytesPerChar() const = 0;
+ virtual int32_t GetMaxBytesPerChar() const = 0;
virtual FX_WCHAR GetMinCharcode() const = 0;
virtual FX_WCHAR GetMaxCharcode() const = 0;
virtual FX_WCHAR GetDefCharcode() const = 0;
diff --git a/xfa/src/fgas/include/fx_datetime.h b/xfa/src/fgas/include/fx_datetime.h index d18b899fc6..dcaf18398f 100644 --- a/xfa/src/fgas/include/fx_datetime.h +++ b/xfa/src/fgas/include/fx_datetime.h @@ -8,7 +8,7 @@ #define _FX_DATETIME_H_
class CFX_Unitime;
class CFX_DateTime;
-typedef FX_INT64 FX_UNITIME;
+typedef int64_t FX_UNITIME;
enum FX_WEEKDAY {
FX_Sunday = 0,
FX_Monday ,
@@ -18,9 +18,9 @@ enum FX_WEEKDAY { FX_Friday ,
FX_Saturday ,
};
-FX_BOOL FX_IsLeapYear(FX_INT32 iYear);
-FX_INT32 FX_DaysInYear(FX_INT32 iYear);
-FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth);
+FX_BOOL FX_IsLeapYear(int32_t iYear);
+int32_t FX_DaysInYear(int32_t iYear);
+uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
class CFX_Unitime
{
public:
@@ -84,25 +84,25 @@ public: }
void Now();
void SetGMTime();
- void Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0);
+ void Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, FX_WORD millisecond = 0);
void Set(FX_UNITIME t);
- FX_INT32 GetYear() const;
- FX_BYTE GetMonth() const;
- FX_BYTE GetDay() const;
+ int32_t GetYear() const;
+ uint8_t GetMonth() const;
+ uint8_t GetDay() const;
FX_WEEKDAY GetDayOfWeek() const;
FX_WORD GetDayOfYear() const;
- FX_INT64 GetDayOfAD() const;
- FX_BYTE GetHour() const;
- FX_BYTE GetMinute() const;
- FX_BYTE GetSecond() const;
+ int64_t GetDayOfAD() const;
+ uint8_t GetHour() const;
+ uint8_t GetMinute() const;
+ uint8_t GetSecond() const;
FX_WORD GetMillisecond() const;
- FX_BOOL AddYears(FX_INT32 iYears);
- FX_BOOL AddMonths(FX_INT32 iMonths);
- FX_BOOL AddDays(FX_INT32 iDays);
- FX_BOOL AddHours(FX_INT32 iHours);
- FX_BOOL AddMinutes(FX_INT32 iMinutes);
- FX_BOOL AddSeconds(FX_INT32 iSeconds);
- FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds);
+ FX_BOOL AddYears(int32_t iYears);
+ FX_BOOL AddMonths(int32_t iMonths);
+ FX_BOOL AddDays(int32_t iDays);
+ FX_BOOL AddHours(int32_t iHours);
+ FX_BOOL AddMinutes(int32_t iMinutes);
+ FX_BOOL AddSeconds(int32_t iSeconds);
+ FX_BOOL AddMilliseconds(int32_t iMilliseconds);
friend CFX_Unitime operator + (const CFX_Unitime &t1, const CFX_Unitime &t2)
{
return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime);
@@ -206,37 +206,37 @@ private: #pragma pack(push, 1)
#endif
typedef struct _FX_DATE {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
} FX_DATE, * FX_LPDATE;
typedef FX_DATE const * FX_LPCDATE;
typedef struct _FX_TIME {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
FX_WORD millisecond;
} FX_TIME, * FX_LPTIME;
typedef FX_TIME const * FX_LPCTIME;
typedef struct _FX_TIMEZONE {
- FX_INT8 tzHour;
- FX_BYTE tzMinute;
+ int8_t tzHour;
+ uint8_t tzMinute;
} FX_TIMEZONE, * FX_LPTIMEZONE;
typedef FX_TIMEZONE const * FX_LPCTIMEZONE;
typedef struct _FX_DATETIME {
union {
struct {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
} sDate;
FX_DATE aDate;
} Date;
union {
struct {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
FX_WORD millisecond;
} sTime;
FX_TIME aTime;
@@ -248,17 +248,17 @@ typedef struct _FX_DATETIMEZONE { struct {
union {
struct {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
};
FX_DATE date;
};
union {
struct {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
FX_WORD millisecond;
};
FX_TIME time;
@@ -268,8 +268,8 @@ typedef struct _FX_DATETIMEZONE { };
union {
struct {
- FX_INT8 tzHour;
- FX_BYTE tzMinute;
+ int8_t tzHour;
+ uint8_t tzMinute;
};
FX_TIMEZONE tz;
};
@@ -336,26 +336,26 @@ public: FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime());
return *this;
}
- virtual FX_BOOL Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0);
+ virtual FX_BOOL Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, FX_WORD millisecond = 0);
virtual FX_BOOL FromUnitime(FX_UNITIME t);
virtual FX_UNITIME ToUnitime() const;
- virtual FX_INT32 GetYear() const;
- virtual FX_BYTE GetMonth() const;
- virtual FX_BYTE GetDay() const;
+ virtual int32_t GetYear() const;
+ virtual uint8_t GetMonth() const;
+ virtual uint8_t GetDay() const;
virtual FX_WEEKDAY GetDayOfWeek() const;
virtual FX_WORD GetDayOfYear() const;
- virtual FX_INT64 GetDayOfAD() const;
- virtual FX_BYTE GetHour() const;
- virtual FX_BYTE GetMinute() const;
- virtual FX_BYTE GetSecond() const;
+ virtual int64_t GetDayOfAD() const;
+ virtual uint8_t GetHour() const;
+ virtual uint8_t GetMinute() const;
+ virtual uint8_t GetSecond() const;
virtual FX_WORD GetMillisecond() const;
- virtual FX_BOOL AddYears(FX_INT32 iYears);
- virtual FX_BOOL AddMonths(FX_INT32 iMonths);
- virtual FX_BOOL AddDays(FX_INT32 iDays);
- virtual FX_BOOL AddHours(FX_INT32 iHours);
- virtual FX_BOOL AddMinutes(FX_INT32 iMinutes);
- virtual FX_BOOL AddSeconds(FX_INT32 iSeconds);
- virtual FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds);
+ virtual FX_BOOL AddYears(int32_t iYears);
+ virtual FX_BOOL AddMonths(int32_t iMonths);
+ virtual FX_BOOL AddDays(int32_t iDays);
+ virtual FX_BOOL AddHours(int32_t iHours);
+ virtual FX_BOOL AddMinutes(int32_t iMinutes);
+ virtual FX_BOOL AddSeconds(int32_t iSeconds);
+ virtual FX_BOOL AddMilliseconds(int32_t iMilliseconds);
friend CFX_DateTime operator + (const CFX_DateTime &dt1, const CFX_DateTime &dt2)
{
CFX_DateTime dt;
diff --git a/xfa/src/fgas/include/fx_fnt.h b/xfa/src/fgas/include/fx_fnt.h index 491feaea37..85d6e3edff 100644 --- a/xfa/src/fgas/include/fx_fnt.h +++ b/xfa/src/fgas/include/fx_fnt.h @@ -40,13 +40,13 @@ class IFX_FontMgr; class IFX_FontProvider
{
public:
- virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0;
+ virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0;
};
class IFX_Font
{
public:
static IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage, IFX_FontMgr *pFontMgr);
- static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr);
+ static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr);
static IFX_Font* LoadFont(FX_LPCWSTR pszFileName, IFX_FontMgr *pFontMgr);
static IFX_Font* LoadFont(IFX_Stream *pFontStream, IFX_FontMgr *pFontMgr, FX_BOOL bSaveStream = FALSE);
static IFX_Font* LoadFont(CFX_Font *pExtFont, IFX_FontMgr *pFontMgr, FX_BOOL bTakeOver = FALSE);
@@ -56,16 +56,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const = 0;
virtual void GetPsName(CFX_WideString &wsName) const = 0;
virtual FX_DWORD GetFontStyles() const = 0;
- virtual FX_BYTE GetCharSet() const = 0;
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0;
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0;
- virtual FX_INT32 GetAscent() const = 0;
- virtual FX_INT32 GetDescent() const = 0;
+ virtual uint8_t GetCharSet() const = 0;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0;
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0;
+ virtual int32_t GetAscent() const = 0;
+ virtual int32_t GetDescent() const = 0;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE) = 0;
virtual FX_BOOL GetBBox(CFX_Rect &bbox) = 0;
- virtual FX_INT32 GetItalicAngle() const = 0;
+ virtual int32_t GetItalicAngle() const = 0;
virtual void Reset() = 0;
- virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const = 0;
+ virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const = 0;
virtual void* GetDevFont() const = 0;
virtual void SetFontProvider(IFX_FontProvider* pProvider) = 0;
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
@@ -89,7 +89,7 @@ typedef struct _FX_FONTSIGNATURE : public CFX_Target { typedef struct _FX_FONTDESCRIPTOR : public CFX_Target {
FX_WCHAR wsFontFace[32];
FX_DWORD dwFontStyles;
- FX_BYTE uCharSet;
+ uint8_t uCharSet;
FX_FONTSIGNATURE FontSignature;
} FX_FONTDESCRIPTOR, * FX_LPFONTDESCRIPTOR;
typedef FX_FONTDESCRIPTOR const * FX_LPCFONTDESCRIPTOR;
@@ -114,11 +114,11 @@ public: static IFX_FontMgr* Create(FX_LPEnumAllFonts pEnumerator, FX_LPMatchFont pMatcher = NULL, FX_LPVOID pUserData = NULL);
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength) = 0;
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName) = 0;
virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE) = 0;
virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
@@ -130,7 +130,7 @@ class IFX_FontMgrDelegate {
public:
virtual IFX_Font* GetDefFontByCodePage(IFX_FontMgr* pFontMgr, FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(IFX_FontMgr* pFontMgr, FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(IFX_FontMgr* pFontMgr, FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
};
@@ -148,7 +148,7 @@ public: static IFX_FontMgr* Create(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL);
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
@@ -156,12 +156,12 @@ public: {
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
}
- virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0;
- virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0;
- virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0;
+ virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, int32_t iFaceIndex, int32_t* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0;
virtual void ClearFontCache() = 0;
virtual void RemoveFont(IFX_Font *pFont) = 0;
diff --git a/xfa/src/fgas/include/fx_lbk.h b/xfa/src/fgas/include/fx_lbk.h index 3c7aa5d7dd..f161bb4355 100644 --- a/xfa/src/fgas/include/fx_lbk.h +++ b/xfa/src/fgas/include/fx_lbk.h @@ -22,6 +22,6 @@ enum FX_LINEBREAKTYPE { #define FX_LBCP FX_LBT_COM_PROHIBITED_BRK
#define FX_LBPB FX_LBT_PROHIBITED_BRK
#define FX_LBHS FX_LBT_HANGUL_SPACE_BRK
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength);
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp);
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength);
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp);
#endif
diff --git a/xfa/src/fgas/include/fx_locale.h b/xfa/src/fgas/include/fx_locale.h index 25a6dda4e1..7f4cce5776 100644 --- a/xfa/src/fgas/include/fx_locale.h +++ b/xfa/src/fgas/include/fx_locale.h @@ -61,8 +61,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const = 0;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const = 0;
virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const = 0;
@@ -112,11 +112,11 @@ class CFX_Decimal {
public:
CFX_Decimal();
- CFX_Decimal(FX_UINT32 val);
- CFX_Decimal(FX_UINT64 val);
- CFX_Decimal(FX_INT32 val);
- CFX_Decimal(FX_INT64 val);
- CFX_Decimal(FX_FLOAT val, FX_UINT8 scale = 3);
+ CFX_Decimal(uint32_t val);
+ CFX_Decimal(uint64_t val);
+ CFX_Decimal(int32_t val);
+ CFX_Decimal(int64_t val);
+ CFX_Decimal(FX_FLOAT val, uint8_t scale = 3);
CFX_Decimal(FX_WSTR str);
CFX_Decimal(FX_BSTR str);
operator CFX_WideString() const;
@@ -132,29 +132,29 @@ public: CFX_Decimal operator * (const CFX_Decimal& val) const;
CFX_Decimal operator / (const CFX_Decimal& val) const;
CFX_Decimal operator % (const CFX_Decimal& val) const;
- void SetScale(FX_UINT8 newScale);
- FX_UINT8 GetScale();
+ void SetScale(uint8_t newScale);
+ uint8_t GetScale();
void SetAbs();
void SetNegate();
void SetFloor();
void SetCeiling();
void SetTruncate();
protected:
- CFX_Decimal(FX_UINT32 hi, FX_UINT32 mid, FX_UINT32 lo, FX_BOOL neg, FX_UINT8 scale);
+ CFX_Decimal(uint32_t hi, uint32_t mid, uint32_t lo, FX_BOOL neg, uint8_t scale);
inline FX_BOOL IsNotZero() const
{
return m_uHi || m_uMid || m_uLo;
}
- inline FX_INT8 Compare (const CFX_Decimal& val) const;
+ inline int8_t Compare (const CFX_Decimal& val) const;
inline void Swap(CFX_Decimal& val);
inline void FloorOrCeil(FX_BOOL bFloor);
CFX_Decimal AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) const;
CFX_Decimal Multiply(const CFX_Decimal& val) const;
CFX_Decimal Divide(const CFX_Decimal& val) const;
CFX_Decimal Modulus(const CFX_Decimal& val) const;
- FX_UINT32 m_uFlags;
- FX_UINT32 m_uHi;
- FX_UINT32 m_uLo;
- FX_UINT32 m_uMid;
+ uint32_t m_uFlags;
+ uint32_t m_uHi;
+ uint32_t m_uLo;
+ uint32_t m_uMid;
};
#endif
diff --git a/xfa/src/fgas/include/fx_mem.h b/xfa/src/fgas/include/fx_mem.h index 18cd85e422..265c582884 100644 --- a/xfa/src/fgas/include/fx_mem.h +++ b/xfa/src/fgas/include/fx_mem.h @@ -31,7 +31,7 @@ class CFX_Target public:
void* operator new(size_t size)
{
- return FX_Alloc(FX_BYTE, size);
+ return FX_Alloc(uint8_t, size);
}
void operator delete(void *p)
{
diff --git a/xfa/src/fgas/include/fx_rbk.h b/xfa/src/fgas/include/fx_rbk.h index 3053fc5e1b..cff63ee490 100644 --- a/xfa/src/fgas/include/fx_rbk.h +++ b/xfa/src/fgas/include/fx_rbk.h @@ -69,17 +69,17 @@ typedef struct _FX_RTFTEXTOBJ { iVerticalScale = 100;
}
FX_LPCWSTR pStr;
- FX_INT32 *pWidths;
- FX_INT32 iLength;
+ int32_t *pWidths;
+ int32_t iLength;
IFX_Font *pFont;
FX_FLOAT fFontSize;
FX_DWORD dwLayoutStyles;
- FX_INT32 iCharRotation;
- FX_INT32 iBidiLevel;
+ int32_t iCharRotation;
+ int32_t iBidiLevel;
FX_LPCRECTF pRect;
FX_WCHAR wLineBreakChar;
- FX_INT32 iHorizontalScale;
- FX_INT32 iVerticalScale;
+ int32_t iHorizontalScale;
+ int32_t iVerticalScale;
} FX_RTFTEXTOBJ, * FX_LPRTFTEXTOBJ;
typedef FX_RTFTEXTOBJ const * FX_LPCRTFTEXTOBJ;
class CFX_RTFPiece : public CFX_Target
@@ -117,24 +117,24 @@ public: }
m_iChars ++;
}
- FX_INT32 GetEndPos() const
+ int32_t GetEndPos() const
{
return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth;
}
- FX_INT32 GetLength() const
+ int32_t GetLength() const
{
return m_iChars;
}
- FX_INT32 GetEndChar() const
+ int32_t GetEndChar() const
{
return m_iStartChar + m_iChars;
}
- CFX_RTFChar& GetChar(FX_INT32 index)
+ CFX_RTFChar& GetChar(int32_t index)
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return *m_pChars->GetDataPtr(m_iStartChar + index);
}
- CFX_RTFChar* GetCharPtr(FX_INT32 index) const
+ CFX_RTFChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return m_pChars->GetDataPtr(m_iStartChar + index);
@@ -142,9 +142,9 @@ public: void GetString (FX_LPWSTR pText) const
{
FXSYS_assert(pText != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pText ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -155,12 +155,12 @@ public: GetString(pText);
wsText.ReleaseBuffer(m_iChars);
}
- void GetWidths(FX_INT32 *pWidths) const
+ void GetWidths(int32_t *pWidths) const
{
FXSYS_assert(pWidths != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pWidths ++ = pChar->m_iCharWidth;
}
@@ -180,16 +180,16 @@ public: m_iVerticalScale = 100;
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iStartPos;
- FX_INT32 m_iWidth;
- FX_INT32 m_iStartChar;
- FX_INT32 m_iChars;
- FX_INT32 m_iBidiLevel;
- FX_INT32 m_iBidiPos;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iFontHeight;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
+ int32_t m_iStartPos;
+ int32_t m_iWidth;
+ int32_t m_iStartChar;
+ int32_t m_iChars;
+ int32_t m_iBidiLevel;
+ int32_t m_iBidiPos;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
FX_DWORD m_dwLayoutStyles;
FX_DWORD m_dwIdentity;
CFX_RTFCharArray *m_pChars;
@@ -214,22 +214,22 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
- virtual void SetHorizontalScale(FX_INT32 iScale) = 0;
- virtual void SetVerticalScale(FX_INT32 iScale) = 0;
- virtual void SetCharRotation(FX_INT32 iCharRotation) = 0;
+ virtual void SetHorizontalScale(int32_t iScale) = 0;
+ virtual void SetVerticalScale(int32_t iScale) = 0;
+ virtual void SetCharRotation(int32_t iCharRotation) = 0;
virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0;
virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) = 0;
virtual void SetReadingOrder(FX_BOOL bRTL = FALSE) = 0;
- virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left) = 0;
+ virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) = 0;
virtual void SetUserData(IFX_Unknown *pUserData) = 0;
virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0;
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) = 0;
- virtual FX_INT32 CountBreakPieces() const = 0;
- virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const = 0;
+ virtual int32_t CountBreakPieces() const = 0;
+ virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const = 0;
virtual void GetLineRect(CFX_RectF &rect) const = 0;
virtual void ClearBreakPieces() = 0;
virtual void Reset() = 0;
- virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
- virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
+ virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
+ virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_sax.h b/xfa/src/fgas/include/fx_sax.h index c0159f8c22..e45ca4e6d8 100644 --- a/xfa/src/fgas/include/fx_sax.h +++ b/xfa/src/fgas/include/fx_sax.h @@ -39,8 +39,8 @@ class IFX_SAXReader {
public:
virtual void Release() = 0;
- virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0;
- virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0;
+ virtual int32_t ContinueParse(IFX_Pause *pPause = NULL) = 0;
virtual void SkipCurrentNode() = 0;
virtual void SetHandler(IFX_SAXReaderHandler *pHandler) = 0;
};
diff --git a/xfa/src/fgas/include/fx_stm.h b/xfa/src/fgas/include/fx_stm.h index ae424dba2d..e6094d445c 100644 --- a/xfa/src/fgas/include/fx_stm.h +++ b/xfa/src/fgas/include/fx_stm.h @@ -11,7 +11,7 @@ IFX_FileRead* FX_CreateFileRead(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream #ifdef FX_FILESIZE
IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_FILESIZE iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
#else
-IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
+IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
#endif
IFX_FileWrite* FX_CreateFileWrite(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream = FALSE);
enum FX_STREAMACCESS {
@@ -34,27 +34,27 @@ public: static IFX_Stream* CreateStream(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
static IFX_Stream* CreateStream(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
static IFX_Stream* CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess);
- static IFX_Stream* CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess);
- static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE);
+ static IFX_Stream* CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess);
+ static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE);
static IFX_Stream* CreateTextStream(IFX_Stream *pBaseStream, FX_BOOL bDeleteOnRelease);
virtual void Release() = 0;
virtual IFX_Stream* Retain() = 0;
virtual FX_DWORD GetAccessModes() const = 0;
- virtual FX_INT32 GetLength() const = 0;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0;
- virtual FX_INT32 GetPosition() = 0;
+ virtual int32_t GetLength() const = 0;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
+ virtual int32_t GetPosition() = 0;
virtual FX_BOOL IsEOF() const = 0;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL) = 0;
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0;
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL) = 0;
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(FX_INT32 iLength) = 0;
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const = 0;
+ virtual FX_BOOL SetLength(int32_t iLength) = 0;
+ virtual int32_t GetBOM(uint8_t bom[4]) const = 0;
virtual FX_WORD GetCodePage() const = 0;
virtual FX_WORD SetCodePage(FX_WORD wCodePage) = 0;
virtual void Lock() = 0;
virtual void Unlock() = 0;
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) = 0;
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_sys.h b/xfa/src/fgas/include/fx_sys.h index c0b5c7445f..8e099bce05 100644 --- a/xfa/src/fgas/include/fx_sys.h +++ b/xfa/src/fgas/include/fx_sys.h @@ -11,10 +11,10 @@ extern "C" { #endif
#define FX_RAD2DEG(r) ((r) * 180.0f / FX_PI)
#define FX_DEG2RAD(a) ((a) * FX_PI / 180.0f)
-typedef FX_INT8 * FX_LPINT8;
-typedef FX_INT8 const * FX_LPCINT8;
-typedef FX_INT32 * FX_LPINT32;
-typedef FX_INT32 const * FX_LPCINT32;
+typedef int8_t * FX_LPINT8;
+typedef int8_t const * FX_LPCINT8;
+typedef int32_t * FX_LPINT32;
+typedef int32_t const * FX_LPCINT32;
typedef long FX_LONG;
typedef FX_LONG * FX_LPLONG;
typedef FX_LONG const * FX_LPCLONG;
@@ -24,30 +24,30 @@ typedef FX_DOUBLE * FX_LPDOUBLE; typedef FX_DOUBLE const * FX_LPCDOUBLE;
FX_FLOAT FX_tan(FX_FLOAT a);
FX_FLOAT FX_log(FX_FLOAT b, FX_FLOAT x);
-FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
-FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
+FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
+FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count);
-FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
-FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
-inline FX_BOOL FX_islower(FX_INT32 ch)
+int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
+int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
+inline FX_BOOL FX_islower(int32_t ch)
{
return ch >= 'a' && ch <= 'z';
}
-inline FX_BOOL FX_isupper(FX_INT32 ch)
+inline FX_BOOL FX_isupper(int32_t ch)
{
return ch >= 'A' && ch <= 'Z';
}
-inline FX_INT32 FX_tolower(FX_INT32 ch)
+inline int32_t FX_tolower(int32_t ch)
{
return FX_isupper(ch) ? (ch + 0x20) : ch;
}
-inline FX_INT32 FX_toupper(FX_INT32 ch)
+inline int32_t FX_toupper(int32_t ch)
{
return FX_islower(ch) ? (ch - 0x20) : ch;
}
-FX_INT32 FX_filelength(FXSYS_FILE *file);
-FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size);
-void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size);
+int32_t FX_filelength(FXSYS_FILE *file);
+FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size);
+void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size);
void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size);
FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsPath);
FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &wsRelativePath, CFX_WideString &wsAbsolutePath);
diff --git a/xfa/src/fgas/include/fx_tbk.h b/xfa/src/fgas/include/fx_tbk.h index ab64d1dac0..69b42f1fd7 100644 --- a/xfa/src/fgas/include/fx_tbk.h +++ b/xfa/src/fgas/include/fx_tbk.h @@ -60,8 +60,8 @@ class IFX_TxtBreak; class IFX_TxtAccess
{
public:
- virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, FX_INT32 index) const = 0;
- virtual FX_INT32 GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const = 0;
+ virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, int32_t index) const = 0;
+ virtual int32_t GetWidth(FX_LPVOID pIdentity, int32_t index) const = 0;
};
typedef struct _FX_TXTRUN {
_FX_TXTRUN()
@@ -85,14 +85,14 @@ typedef struct _FX_TXTRUN { IFX_TxtAccess *pAccess;
FX_LPVOID pIdentity;
FX_LPCWSTR pStr;
- FX_INT32 *pWidths;
- FX_INT32 iLength;
+ int32_t *pWidths;
+ int32_t iLength;
IFX_Font *pFont;
FX_FLOAT fFontSize;
FX_DWORD dwStyles;
- FX_INT32 iHorizontalScale;
- FX_INT32 iVerticalScale;
- FX_INT32 iCharRotation;
+ int32_t iHorizontalScale;
+ int32_t iVerticalScale;
+ int32_t iCharRotation;
FX_DWORD dwCharStyles;
FX_LPCRECTF pRect;
FX_WCHAR wLineBreakChar;
@@ -116,19 +116,19 @@ public: , m_pUserData(NULL)
{
}
- FX_INT32 GetEndPos() const
+ int32_t GetEndPos() const
{
return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth;
}
- FX_INT32 GetLength() const
+ int32_t GetLength() const
{
return m_iChars;
}
- FX_INT32 GetEndChar() const
+ int32_t GetEndChar() const
{
return m_iStartChar + m_iChars;
}
- CFX_TxtChar* GetCharPtr(FX_INT32 index) const
+ CFX_TxtChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return m_pChars->GetDataPtr(m_iStartChar + index);
@@ -136,9 +136,9 @@ public: void GetString(FX_LPWSTR pText) const
{
FXSYS_assert(pText != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_Char *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pText ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -150,25 +150,25 @@ public: GetString(pText);
wsText.ReleaseBuffer(m_iChars);
}
- void GetWidths(FX_INT32 *pWidths) const
+ void GetWidths(int32_t *pWidths) const
{
FXSYS_assert(pWidths != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_Char *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pWidths ++ = pChar->m_iCharWidth;
}
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iStartPos;
- FX_INT32 m_iWidth;
- FX_INT32 m_iStartChar;
- FX_INT32 m_iChars;
- FX_INT32 m_iBidiLevel;
- FX_INT32 m_iBidiPos;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
+ int32_t m_iStartPos;
+ int32_t m_iWidth;
+ int32_t m_iStartChar;
+ int32_t m_iChars;
+ int32_t m_iBidiLevel;
+ int32_t m_iBidiPos;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
FX_DWORD m_dwCharStyles;
CFX_TxtCharArray *m_pChars;
FX_LPVOID m_pUserData;
@@ -189,23 +189,23 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0;
virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
- virtual void SetHorizontalScale(FX_INT32 iScale) = 0;
- virtual void SetVerticalScale(FX_INT32 iScale) = 0;
- virtual void SetCharRotation(FX_INT32 iCharRotation) = 0;
+ virtual void SetHorizontalScale(int32_t iScale) = 0;
+ virtual void SetVerticalScale(int32_t iScale) = 0;
+ virtual void SetCharRotation(int32_t iCharRotation) = 0;
virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0;
- virtual void SetAlignment(FX_INT32 iAlignment) = 0;
+ virtual void SetAlignment(int32_t iAlignment) = 0;
virtual FX_DWORD GetContextCharStyles() const = 0;
virtual void SetContextCharStyles(FX_DWORD dwCharStyles) = 0;
virtual void SetCombWidth(FX_FLOAT fCombWidth) = 0;
virtual void SetUserData(FX_LPVOID pUserData) = 0;
virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0;
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak) = 0;
- virtual FX_INT32 CountBreakChars() const = 0;
- virtual FX_INT32 CountBreakPieces() const = 0;
- virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const = 0;
+ virtual int32_t CountBreakChars() const = 0;
+ virtual int32_t CountBreakPieces() const = 0;
+ virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const = 0;
virtual void ClearBreakPieces() = 0;
virtual void Reset() = 0;
- virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
- virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
+ virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
+ virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_ucd.h b/xfa/src/fgas/include/fx_ucd.h index 715c8af4dd..7b5b6532a5 100644 --- a/xfa/src/fgas/include/fx_ucd.h +++ b/xfa/src/fgas/include/fx_ucd.h @@ -14,7 +14,7 @@ #define FX_JAPCHARPROPERTYEX_Bottom 0x30
typedef struct _FX_JAPCHARPROPERTYEX {
FX_WCHAR wChar;
- FX_BYTE uAlign;
+ uint8_t uAlign;
} FX_JAPCHARPROPERTYEX, *FX_LPJAPCHARPROPERTYEX;
typedef FX_JAPCHARPROPERTYEX const * FX_LPCJAPCHARPROPERTYEX;
FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch);
diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/include/fx_utl.h index 850543786c..35b676f41e 100644 --- a/xfa/src/fgas/include/fx_utl.h +++ b/xfa/src/fgas/include/fx_utl.h @@ -34,16 +34,16 @@ private: class CFX_BaseArray : public CFX_Target
{
protected:
- CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize);
+ CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize);
~CFX_BaseArray();
- FX_INT32 GetSize() const;
- FX_INT32 GetBlockSize() const;
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ int32_t GetSize() const;
+ int32_t GetBlockSize() const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
FX_LPBYTE GetBuffer() const;
- FX_INT32 Append(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ int32_t Append(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
FX_LPVOID m_pData;
};
@@ -51,13 +51,13 @@ template<class baseType> class CFX_BaseArrayTemplate : public CFX_BaseArray
{
public:
- CFX_BaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
- CFX_BaseArrayTemplate(FX_INT32 iGrowSize, FX_INT32 iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {}
- FX_INT32 GetSize() const
+ CFX_BaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
+ CFX_BaseArrayTemplate(int32_t iGrowSize, int32_t iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {}
+ int32_t GetSize() const
{
return CFX_BaseArray::GetSize();
}
- FX_INT32 GetBlockSize() const
+ int32_t GetBlockSize() const
{
return CFX_BaseArray::GetBlockSize();
}
@@ -65,9 +65,9 @@ public: {
return (baseType*)CFX_BaseArray::AddSpaceTo(CFX_BaseArray::GetSize());
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseArray::GetSize();
+ int32_t index = CFX_BaseArray::GetSize();
*(baseType*)CFX_BaseArray::AddSpaceTo(index) = element;
return index;
}
@@ -75,31 +75,31 @@ public: {
return (baseType*)CFX_BaseArray::GetBuffer();
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseArray::GetAt(index);
}
- void SetAt(FX_INT32 index, const baseType &element)
+ void SetAt(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseArray::GetAt(index) = element;
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseArray::AddSpaceTo(index) = element;
}
- FX_INT32 Append(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseArray::Append(src, iStart, iCount);
}
- FX_INT32 Copy(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseArray::Copy(src, iStart, iCount);
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
return CFX_BaseArray::RemoveLast(iCount);
}
@@ -115,41 +115,41 @@ template<class baseType> class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray
{
public:
- CFX_ObjectBaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
+ CFX_ObjectBaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
~CFX_ObjectBaseArrayTemplate()
{
RemoveAll(FALSE);
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseArray::GetSize();
}
- FX_INT32 GetBlockSize() const
+ int32_t GetBlockSize() const
{
return CFX_BaseArray::GetBlockSize();
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseArray::GetSize();
+ int32_t index = CFX_BaseArray::GetSize();
baseType *p = (baseType*)CFX_BaseArray::AddSpaceTo(index);
FXTARGET_New ((void*)p)baseType(element);
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseArray::GetAt(index);
}
- FX_INT32 Append(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
FXSYS_assert(GetBlockSize() == src.GetBlockSize());
if (iCount == 0) {
return 0;
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
@@ -163,21 +163,21 @@ public: iSize = CFX_BaseArray::GetSize();
CFX_BaseArray::AddSpaceTo(iSize + iCount - 1);
FX_LPBYTE *pStart = CFX_BaseArray::GetAt(iSize);
- FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize();
+ int32_t iBlockSize = CFX_BaseArray::GetBlockSize();
iSize = iStart + iCount;
- for (FX_INT32 i = iStart; i < iSize; i ++) {
+ for (int32_t i = iStart; i < iSize; i ++) {
FXTARGET_NewWith ((void*)pStart)baseType(src.GetAt(i));
pStart += iBlockSize;
}
return iCount;
}
- FX_INT32 Copy(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
FXSYS_assert(GetBlockSize() == src.GetBlockSize());
if (iCount == 0) {
return 0;
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
@@ -191,32 +191,32 @@ public: RemoveAll(TRUE);
CFX_BaseArray::AddSpaceTo(iCount - 1);
FX_LPBYTE *pStart = CFX_BaseArray::GetAt(0);
- FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize();
+ int32_t iBlockSize = CFX_BaseArray::GetBlockSize();
iSize = iStart + iCount;
- for (FX_INT32 i = iStart; i < iSize; i ++) {
+ for (int32_t i = iStart; i < iSize; i ++) {
FXTARGET_New ((void*)pStart)baseType(src.GetAt(i));
pStart += iBlockSize;
}
return iCount;
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
- FX_INT32 iSize = CFX_BaseArray::GetSize();
+ int32_t iSize = CFX_BaseArray::GetSize();
if (iCount < 0 || iCount > iSize) {
iCount = iSize;
}
if (iCount == 0) {
return iSize;
}
- for (FX_INT32 i = iSize - iCount; i < iSize; i ++) {
+ for (int32_t i = iSize - iCount; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
return CFX_BaseArray::RemoveLast(iCount);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseArray::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseArray::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
CFX_BaseArray::RemoveAll(bLeaveMemory);
@@ -225,14 +225,14 @@ public: class CFX_BaseMassArray : public CFX_Target
{
protected:
- CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseMassArray();
- FX_INT32 GetSize() const;
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
- FX_INT32 Append(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ int32_t GetSize() const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
+ int32_t Append(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
@@ -240,9 +240,9 @@ template<class baseType> class CFX_MassArrayTemplate : public CFX_BaseMassArray
{
public:
- CFX_MassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
- CFX_MassArrayTemplate(FX_INT32 iChunkSize, FX_INT32 iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {}
- FX_INT32 GetSize() const
+ CFX_MassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
+ CFX_MassArrayTemplate(int32_t iChunkSize, int32_t iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {}
+ int32_t GetSize() const
{
return CFX_BaseMassArray::GetSize();
}
@@ -250,37 +250,37 @@ public: {
return (baseType*)CFX_BaseMassArray::AddSpaceTo(CFX_BaseMassArray::GetSize());
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseMassArray::GetSize();
+ int32_t index = CFX_BaseMassArray::GetSize();
*(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseMassArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseMassArray::GetAt(index);
}
- void SetAt(FX_INT32 index, const baseType &element)
+ void SetAt(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseMassArray::GetAt(index) = element;
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
}
- FX_INT32 Append(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseMassArray::Append(src, iStart, iCount);
}
- FX_INT32 Copy(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseMassArray::Copy(src, iStart, iCount);
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
return CFX_BaseMassArray::RemoveLast(iCount);
}
@@ -290,7 +290,7 @@ public: }
};
typedef CFX_MassArrayTemplate<FX_LPVOID> CFX_PtrMassArray;
-typedef CFX_MassArrayTemplate<FX_INT32> CFX_Int32MassArray;
+typedef CFX_MassArrayTemplate<int32_t> CFX_Int32MassArray;
typedef CFX_MassArrayTemplate<FX_DWORD> CFX_DWordMassArray;
typedef CFX_MassArrayTemplate<FX_WORD> CFX_WordMassArray;
typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray;
@@ -299,87 +299,87 @@ template<class baseType> class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray
{
public:
- CFX_ObjectMassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
+ CFX_ObjectMassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
~CFX_ObjectMassArrayTemplate()
{
RemoveAll(FALSE);
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseMassArray::GetSize();
+ int32_t index = CFX_BaseMassArray::GetSize();
baseType *p = (baseType*)CFX_BaseMassArray::AddSpaceTo(index);
FXTARGET_New ((void*)p)baseType(element);
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseMassArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseMassArray::GetAt(index);
}
- FX_INT32 Append(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Add(src.GetAt(i));
}
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 Copy(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
RemoveAll(TRUE);
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Add(src.GetAt(i));
}
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
- FX_INT32 iSize = CFX_BaseMassArray::GetSize();
+ int32_t iSize = CFX_BaseMassArray::GetSize();
if (iCount < 0 || iCount > iSize) {
iCount = iSize;
}
if (iCount == 0) {
return iSize;
}
- for (FX_INT32 i = iSize - iCount; i < iSize; i ++) {
+ for (int32_t i = iSize - iCount; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
return CFX_BaseMassArray::RemoveLast(iCount);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseMassArray::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseMassArray::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
CFX_BaseMassArray::RemoveAll(bLeaveMemory);
@@ -388,10 +388,10 @@ public: class CFX_BaseDiscreteArray : public CFX_Target
{
protected:
- CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseDiscreteArray();
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
void RemoveAll();
FX_LPVOID m_pData;
};
@@ -399,17 +399,17 @@ template<class baseType> class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray
{
public:
- CFX_DiscreteArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {}
- baseType& GetAt(FX_INT32 index, const baseType &defValue) const
+ CFX_DiscreteArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {}
+ baseType& GetAt(int32_t index, const baseType &defValue) const
{
baseType *p = (baseType*)CFX_BaseDiscreteArray::GetAt(index);
return p == NULL ? (baseType&)defValue : *p;
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseDiscreteArray::GetAt(index);
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseDiscreteArray::AddSpaceTo(index) = element;
}
@@ -424,13 +424,13 @@ typedef CFX_DiscreteArrayTemplate<FX_WORD> CFX_WordDiscreteArray; class CFX_BaseStack : public CFX_Target
{
protected:
- CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseStack();
FX_LPBYTE Push();
void Pop();
FX_LPBYTE GetTopElement() const;
- FX_INT32 GetSize() const;
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ int32_t GetSize() const;
+ FX_LPBYTE GetAt(int32_t index) const;
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
@@ -438,10 +438,10 @@ template<class baseType> class CFX_StackTemplate : public CFX_BaseStack
{
public:
- CFX_StackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
- FX_INT32 Push(const baseType &element)
+ CFX_StackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
+ int32_t Push(const baseType &element)
{
- FX_INT32 index = CFX_BaseStack::GetSize();
+ int32_t index = CFX_BaseStack::GetSize();
*(baseType*)CFX_BaseStack::Push() = element;
return index;
}
@@ -453,11 +453,11 @@ public: {
return (baseType*)CFX_BaseStack::GetTopElement();
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseStack::GetSize();
}
- baseType* GetAt(FX_INT32 index) const
+ baseType* GetAt(int32_t index) const
{
return (baseType*)CFX_BaseStack::GetAt(index);
}
@@ -469,19 +469,19 @@ public: typedef CFX_StackTemplate<FX_LPVOID> CFX_PtrStack;
typedef CFX_StackTemplate<FX_DWORD> CFX_DWordStack;
typedef CFX_StackTemplate<FX_WORD> CFX_WordStack;
-typedef CFX_StackTemplate<FX_INT32> CFX_Int32Stack;
+typedef CFX_StackTemplate<int32_t> CFX_Int32Stack;
template<class baseType>
class CFX_ObjectStackTemplate : public CFX_BaseStack
{
public:
- CFX_ObjectStackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
+ CFX_ObjectStackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
~CFX_ObjectStackTemplate()
{
RemoveAll();
}
- FX_INT32 Push(const baseType &element)
+ int32_t Push(const baseType &element)
{
- FX_INT32 index = CFX_BaseStack::GetSize();
+ int32_t index = CFX_BaseStack::GetSize();
baseType *p = (baseType*)CFX_BaseStack::Push();
FXTARGET_New ((void*)p)baseType(element);
return index;
@@ -498,38 +498,38 @@ public: {
return (baseType*)CFX_BaseStack::GetTopElement();
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseStack::GetSize();
}
- baseType* GetAt(FX_INT32 index) const
+ baseType* GetAt(int32_t index) const
{
return (baseType*)CFX_BaseStack::GetAt(index);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseStack::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseStack::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)CFX_BaseStack::GetAt(i))->~baseType();
}
CFX_BaseStack::RemoveAll(bLeaveMemory);
}
- FX_INT32 Copy(const CFX_ObjectStackTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectStackTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseStack::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
RemoveAll(TRUE);
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Push(*src.GetAt(i));
}
return CFX_BaseStack::GetSize();
@@ -659,9 +659,9 @@ public: {
m_pParentNode = pNode;
}
- FX_INT32 CountChildNodes() const
+ int32_t CountChildNodes() const
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CPLTreeNode *pNode = m_pChildNode;
while (pNode) {
iCount ++;
@@ -669,9 +669,9 @@ public: }
return iCount;
}
- CPLTreeNode* GetChildNode(FX_INT32 iIndex) const
+ CPLTreeNode* GetChildNode(int32_t iIndex) const
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CPLTreeNode *pNode = m_pChildNode;
while (pNode) {
if (iIndex == iCount) {
@@ -682,9 +682,9 @@ public: }
return NULL;
}
- FX_INT32 GetNodeIndex() const
+ int32_t GetNodeIndex() const
{
- FX_INT32 index = 0;
+ int32_t index = 0;
CPLTreeNode *pNode = m_pPrevNode;
while (pNode != NULL) {
index ++;
@@ -722,9 +722,9 @@ public: {
m_pNextNode = pNode;
}
- FX_INT32 GetNodeLevel() const
+ int32_t GetNodeLevel() const
{
- FX_INT32 iLevel = 0;
+ int32_t iLevel = 0;
CPLTreeNode *pNode = (CPLTreeNode*)this;
while ((pNode = pNode->m_pParentNode) != NULL) {
iLevel ++;
diff --git a/xfa/src/fgas/src/crt/fx_algorithm.cpp b/xfa/src/fgas/src/crt/fx_algorithm.cpp index e2d77d1a0e..86a6095d45 100644 --- a/xfa/src/fgas/src/crt/fx_algorithm.cpp +++ b/xfa/src/fgas/src/crt/fx_algorithm.cpp @@ -29,7 +29,7 @@ typedef struct _FX_BASE64DATA { FX_DWORD data7 : 8;
} FX_BASE64DATA, * FX_LPBASE64ENCODEDATA;
typedef FX_BASE64DATA const * FX_LPCBASE64DATA;
-static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_CHAR dst[4])
+static void FX_Base64EncodePiece(const FX_BASE64DATA &src, int32_t iBytes, FX_CHAR dst[4])
{
dst[0] = g_FXBase64EncoderMap[src.data2];
FX_DWORD b = src.data1 << 4;
@@ -52,21 +52,21 @@ static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_C dst[2] = dst[3] = '=';
}
}
-FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst)
+int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 3 * 4;
+ int32_t iDstLen = iSrcLen / 3 * 4;
if ((iSrcLen % 3) != 0) {
iDstLen += 4;
}
return iDstLen;
}
FX_BASE64DATA srcData;
- FX_INT32 iBytes = 3;
+ int32_t iBytes = 3;
FX_LPSTR pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 2) {
@@ -88,7 +88,7 @@ FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst) }
return pDstEnd - pDst;
}
-const static FX_BYTE g_FXBase64DecoderMap[256] = {
+const static uint8_t g_FXBase64DecoderMap[256] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -122,23 +122,23 @@ const static FX_BYTE g_FXBase64DecoderMap[256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
-static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE64DATA &dst, FX_INT32 &iBytes)
+static void FX_Base64DecodePiece(const FX_CHAR src[4], int32_t iChars, FX_BASE64DATA &dst, int32_t &iBytes)
{
FXSYS_assert(iChars > 0 && iChars < 5);
iBytes = 1;
- dst.data2 = g_FXBase64DecoderMap[(FX_BYTE)src[0]];
+ dst.data2 = g_FXBase64DecoderMap[(uint8_t)src[0]];
if (iChars > 1) {
- FX_BYTE b = g_FXBase64DecoderMap[(FX_BYTE)src[1]];
+ uint8_t b = g_FXBase64DecoderMap[(uint8_t)src[1]];
dst.data1 = b >> 4;
dst.data4 = b;
if (iChars > 2) {
iBytes = 2;
- b = g_FXBase64DecoderMap[(FX_BYTE)src[2]];
+ b = g_FXBase64DecoderMap[(uint8_t)src[2]];
dst.data3 = b >> 2;
dst.data6 = b;
if (iChars > 3) {
iBytes = 3;
- dst.data5 = g_FXBase64DecoderMap[(FX_BYTE)src[3]];
+ dst.data5 = g_FXBase64DecoderMap[(uint8_t)src[3]];
} else {
dst.data5 = 0;
}
@@ -149,7 +149,7 @@ static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE6 dst.data1 = 0;
}
}
-FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst)
+int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
@@ -162,7 +162,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 4 * 3;
+ int32_t iDstLen = iSrcLen / 4 * 3;
iSrcLen %= 4;
if (iSrcLen == 1) {
iDstLen += 1;
@@ -175,7 +175,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
FX_CHAR srcData[4];
FX_BASE64DATA dstData;
- FX_INT32 iChars = 4, iBytes;
+ int32_t iChars = 4, iBytes;
FX_LPBYTE pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 3) {
@@ -206,7 +206,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
return pDstEnd - pDst;
}
-FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst)
+int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
@@ -219,7 +219,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 4 * 3;
+ int32_t iDstLen = iSrcLen / 4 * 3;
iSrcLen %= 4;
if (iSrcLen == 1) {
iDstLen += 1;
@@ -232,7 +232,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
FX_CHAR srcData[4];
FX_BASE64DATA dstData;
- FX_INT32 iChars = 4, iBytes;
+ int32_t iChars = 4, iBytes;
FX_LPBYTE pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 3) {
@@ -265,7 +265,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
return pDstEnd - pDst;
}
-const static FX_BYTE g_FXHex2DecMap[256] = {
+const static uint8_t g_FXHex2DecMap[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -283,11 +283,11 @@ const static FX_BYTE g_FXHex2DecMap[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
-FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow)
+uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow)
{
return (g_FXHex2DecMap[hexHigh] << 4) + g_FXHex2DecMap[hexLow];
}
-FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces)
+int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces)
{
if (pStr == NULL) {
return 0;
diff --git a/xfa/src/fgas/src/crt/fx_codepage.cpp b/xfa/src/fgas/src/crt/fx_codepage.cpp index 798edc9776..239fa8874c 100644 --- a/xfa/src/fgas/src/crt/fx_codepage.cpp +++ b/xfa/src/fgas/src/crt/fx_codepage.cpp @@ -39,11 +39,11 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { { 254, 437 },
{ 255, 850 },
};
-FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset)
+FX_WORD FX_GetCodePageFromCharset(uint8_t charset)
{
- FX_INT32 iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1;
+ int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP & cp = g_FXCharset2CodePageTable[iMid];
@@ -92,9 +92,9 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { };
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage)
{
- FX_INT32 iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1;
+ int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP & cp = g_FXCodepage2CharsetTable[iMid];
@@ -247,9 +247,9 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { };
FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage)
{
- FX_INT32 iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1;
+ int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_LANG2CPMAP &cp = g_FXLang2CodepageTable[iMid];
@@ -329,7 +329,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { { 0xf2a9730b, 0x3a8 }, { 0xf3d463c2, 0x3a4 }, { 0xf52a70a3, 0xc42e }, { 0xf5693147, 0x6fb3 },
{ 0xf637e157, 0x478 }, { 0xfc213f3a, 0x2717 }, { 0xff654d14, 0x3b5 },
};
-FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength)
+FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -338,9 +338,9 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) if (iLength == 0) {
return 0xFFFF;
}
- FX_UINT32 uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE);
- FX_INT32 iStart = 0, iMid;
- FX_INT32 iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1;
+ uint32_t uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE);
+ int32_t iStart = 0, iMid;
+ int32_t iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1;
FXSYS_assert(iEnd >= 0);
do {
iMid = (iStart + iEnd) / 2;
@@ -355,7 +355,7 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) } while (iStart <= iEnd);
return 0xFFFF;
}
-FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength)
+FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength)
{
if (iLength < 0) {
iLength = FXSYS_wcslen(pStr);
@@ -365,7 +365,7 @@ FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength) }
CFX_ByteString csStr;
FX_LPSTR pBuf = csStr.GetBuffer(iLength + 1);
- for (FX_INT32 i = 0; i < iLength; ++i) {
+ for (int32_t i = 0; i < iLength; ++i) {
*pBuf ++ = (FX_CHAR) * pStr ++;
}
csStr.ReleaseBuffer(iLength);
diff --git a/xfa/src/fgas/src/crt/fx_cpmgr.cpp b/xfa/src/fgas/src/crt/fx_cpmgr.cpp index 7bb2aa4a8d..e57273d614 100644 --- a/xfa/src/fgas/src/crt/fx_cpmgr.cpp +++ b/xfa/src/fgas/src/crt/fx_cpmgr.cpp @@ -41,10 +41,10 @@ extern const FX_CPCU_MAPINFO g_CP1257_CUMap; extern const FX_CPCU_MAPINFO g_CP1258_CUMap;
FX_LPCCODEPAGE FX_GetCodePage(FX_WORD wCodePage)
{
- FX_INT32 iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1;
+ int32_t iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
- FX_UINT16 uCPID;
+ int32_t iStart = 0, iMid;
+ uint16_t uCPID;
do {
iMid = (iStart + iEnd) / 2;
const FX_CODEPAGE &cp = g_FXCodePageMgr[iMid];
diff --git a/xfa/src/fgas/src/crt/fx_encode.cpp b/xfa/src/fgas/src/crt/fx_encode.cpp index 892b5a9059..9de79e3649 100644 --- a/xfa/src/fgas/src/crt/fx_encode.cpp +++ b/xfa/src/fgas/src/crt/fx_encode.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h"
#include "fx_codepage.h"
-void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength)
+void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -28,7 +28,7 @@ void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength) }
}
}
-void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength)
+void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength)
{
FXSYS_assert(pSrc != NULL && pDst != NULL);
if (iLength < 0) {
@@ -50,7 +50,7 @@ void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength) }
}
}
-void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength)
+void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -62,7 +62,7 @@ void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength) pDst[iLength] = (FX_WCHAR)pSrc[iLength];
}
}
-void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength)
+void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength)
{
FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -73,7 +73,7 @@ void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLeng }
}
}
-void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength)
+void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -85,7 +85,7 @@ void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength) *pDst++ = (FX_WORD) * pSrc++;
}
}
-void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength)
+void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength)
{
FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -104,33 +104,33 @@ inline FX_WORD FX_WordFromBytes(FX_LPCBYTE pStr) {
return (pStr[1] << 8 | pStr[0]);
}
-FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak)
+int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak)
{
if (wCodePage == FX_CODEPAGE_UTF8) {
return FX_UTF8Decode(pSrc, pSrcLen, pDst, pDstLen);
}
return -1;
}
-FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen)
+int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen)
{
if (pSrcLen == NULL || pDstLen == NULL) {
return -1;
}
- FX_INT32 iSrcLen = *pSrcLen;
+ int32_t iSrcLen = *pSrcLen;
if (iSrcLen < 1) {
*pSrcLen = *pDstLen = 0;
return 1;
}
- FX_INT32 iDstLen = *pDstLen;
+ int32_t iDstLen = *pDstLen;
FX_BOOL bValidDst = (pDst != NULL && iDstLen > 0);
FX_DWORD dwCode = 0;
- FX_INT32 iPending = 0;
- FX_INT32 iSrcNum = 0, iDstNum = 0;
- FX_INT32 k = 0;
- FX_INT32 iIndex = 0;
+ int32_t iPending = 0;
+ int32_t iSrcNum = 0, iDstNum = 0;
+ int32_t k = 0;
+ int32_t iIndex = 0;
k = 1;
while (iIndex < iSrcLen) {
- FX_BYTE byte = (FX_BYTE) * (pSrc + iIndex);
+ uint8_t byte = (uint8_t) * (pSrc + iIndex);
if (byte < 0x80) {
iPending = 0;
k = 1;
diff --git a/xfa/src/fgas/src/crt/fx_memory.cpp b/xfa/src/fgas/src/crt/fx_memory.cpp index 12d081a645..9645852cb7 100644 --- a/xfa/src/fgas/src/crt/fx_memory.cpp +++ b/xfa/src/fgas/src/crt/fx_memory.cpp @@ -45,7 +45,7 @@ CFX_StaticStore::~CFX_StaticStore() FX_LPSTATICSTORECHUNK CFX_StaticStore::AllocChunk(size_t size)
{
FXSYS_assert(size != 0);
- register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_STATICSTORECHUNK) + size);
+ register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_STATICSTORECHUNK) + size);
if (pChunk == NULL) {
return NULL;
}
@@ -106,8 +106,8 @@ CFX_FixedStore::~CFX_FixedStore() }
FX_LPFIXEDSTORECHUNK CFX_FixedStore::AllocChunk()
{
- FX_INT32 iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize;
- register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(FX_BYTE, iTotalSize);
+ int32_t iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize;
+ register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(uint8_t, iTotalSize);
if (pChunk == NULL) {
return NULL;
}
@@ -206,7 +206,7 @@ CFX_DynamicStore::~CFX_DynamicStore() FX_LPDYNAMICSTORECHUNK CFX_DynamicStore::AllocChunk(size_t size)
{
FXSYS_assert(size != 0);
- register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size);
+ register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size);
if (pChunk == NULL) {
return NULL;
}
diff --git a/xfa/src/fgas/src/crt/fx_memory.h b/xfa/src/fgas/src/crt/fx_memory.h index 9121c32c0f..fa58429107 100644 --- a/xfa/src/fgas/src/crt/fx_memory.h +++ b/xfa/src/fgas/src/crt/fx_memory.h @@ -21,7 +21,7 @@ public: }
virtual void* Alloc(size_t size)
{
- return FX_Alloc(FX_BYTE, size);
+ return FX_Alloc(uint8_t, size);
}
virtual void Free(void *pBlock)
{
diff --git a/xfa/src/fgas/src/crt/fx_stream.cpp b/xfa/src/fgas/src/crt/fx_stream.cpp index fff3fe1e86..009cb41f5a 100644 --- a/xfa/src/fgas/src/crt/fx_stream.cpp +++ b/xfa/src/fgas/src/crt/fx_stream.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h"
#include "fx_stream.h"
-IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize, FX_BOOL bReleaseBufferRead )
+IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize, FX_BOOL bReleaseBufferRead )
{
CFX_Stream *pSR = FX_NEW CFX_Stream;
if (!pSR) {
@@ -86,7 +86,7 @@ IFX_Stream* IFX_Stream::CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess) }
return pSR;
}
-IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess)
+IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess)
{
CFX_Stream *pSR = FX_NEW CFX_Stream;
if (pSR == NULL) {
@@ -216,18 +216,18 @@ FX_BOOL CFX_FileStreamImp::LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess }
return TRUE;
}
-FX_INT32 CFX_FileStreamImp::GetLength() const
+int32_t CFX_FileStreamImp::GetLength() const
{
FXSYS_assert(m_hFile != NULL);
return m_iLength;
}
-FX_INT32 CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_fseek(m_hFile, iOffset, eSeek);
return FXSYS_ftell(m_hFile);
}
-FX_INT32 CFX_FileStreamImp::GetPosition()
+int32_t CFX_FileStreamImp::GetPosition()
{
FXSYS_assert(m_hFile != NULL);
return FXSYS_ftell(m_hFile);
@@ -237,26 +237,26 @@ FX_BOOL CFX_FileStreamImp::IsEOF() const FXSYS_assert(m_hFile != NULL);
return FXSYS_ftell(m_hFile) >= m_iLength;
}
-FX_INT32 CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
return FXSYS_fread(pBuffer, 1, iBufferSize, m_hFile);
}
-FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_iLength <= 0) {
return 0;
}
- FX_INT32 iPosition = FXSYS_ftell(m_hFile);
- FX_INT32 iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength);
+ int32_t iPosition = FXSYS_ftell(m_hFile);
+ int32_t iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength);
if (iLen <= 0) {
return 0;
}
iLen = FXSYS_fread(pStr, 2, iLen, m_hFile);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (*pStr != L'\0' && iCount < iLen) {
pStr ++, iCount ++;
}
@@ -267,26 +267,26 @@ FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_B bEOS = (iPosition >= m_iLength);
return iCount;
}
-FX_INT32 CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile);
+ int32_t iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile);
if (iRet != 0) {
- FX_INT32 iPos = FXSYS_ftell(m_hFile);
+ int32_t iPos = FXSYS_ftell(m_hFile);
if (iPos > m_iLength) {
m_iLength = iPos;
}
}
return iRet;
}
-FX_INT32 CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pStr != NULL && iLength > 0);
- FX_INT32 iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile);
+ int32_t iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile);
if (iRet != 0) {
- FX_INT32 iPos = FXSYS_ftell(m_hFile);
+ int32_t iPos = FXSYS_ftell(m_hFile);
if (iPos > m_iLength) {
m_iLength = iPos;
}
@@ -298,7 +298,7 @@ void CFX_FileStreamImp::Flush() FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_fflush(m_hFile);
}
-FX_BOOL CFX_FileStreamImp::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FX_BOOL bRet = FX_fsetsize(m_hFile, iLength);
@@ -321,11 +321,11 @@ FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dw m_iLength = m_pFileRead->GetSize();
return TRUE;
}
-FX_INT32 CFX_FileReadStreamImp::GetLength() const
+int32_t CFX_FileReadStreamImp::GetLength() const
{
return m_iLength;
}
-FX_INT32 CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
switch (eSeek) {
case FX_STREAMSEEK_Begin:
@@ -349,7 +349,7 @@ FX_BOOL CFX_FileReadStreamImp::IsEOF() const {
return m_iPosition >= m_iLength;
}
-FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pFileRead != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
@@ -362,7 +362,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize }
return 0;
}
-FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pFileRead != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
@@ -370,7 +370,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, if (iMaxLength <= 0) {
return 0;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iMaxLength && pStr[i] != L'\0') {
++i;
}
@@ -390,7 +390,7 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() m_pBufferRead->Release();
}
}
-FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
+FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
{
FXSYS_assert(m_pBufferRead == NULL && pBufferRead != NULL);
if (dwAccess & FX_STREAMACCESS_Write) {
@@ -412,13 +412,13 @@ FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_ }
return TRUE;
}
-FX_INT32 CFX_BufferReadStreamImp::GetLength() const
+int32_t CFX_BufferReadStreamImp::GetLength() const
{
return m_iBufferSize;
}
-FX_INT32 CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
switch (eSeek) {
case FX_STREAMSEEK_Begin:
m_iPosition = iOffset;
@@ -441,11 +441,11 @@ FX_BOOL CFX_BufferReadStreamImp::IsEOF() const {
return m_pBufferRead ? m_pBufferRead->IsEOF() : TRUE;
}
-FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pBufferRead != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
if (m_iPosition >= iLength) {
return 0;
}
@@ -454,26 +454,26 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi }
FX_DWORD dwBlockOffset = m_pBufferRead->GetBlockOffset();
FX_DWORD dwBlockSize = m_pBufferRead->GetBlockSize();
- if (m_iPosition < (FX_INT32)dwBlockOffset) {
+ if (m_iPosition < (int32_t)dwBlockOffset) {
if (!m_pBufferRead->ReadNextBlock(TRUE)) {
return 0;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
dwBlockSize = m_pBufferRead->GetBlockSize();
}
- while (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) {
+ while (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) {
if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(FALSE)) {
break;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
dwBlockSize = m_pBufferRead->GetBlockSize();
}
- if (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) {
+ if (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) {
return 0;
}
FX_LPCBYTE pBufferTmp = m_pBufferRead->GetBlockBuffer();
FX_DWORD dwOffsetTmp = m_iPosition - dwBlockOffset;
- FX_DWORD dwCopySize = FX_MIN(iBufferSize, (FX_INT32)(dwBlockSize - dwOffsetTmp));
+ FX_DWORD dwCopySize = FX_MIN(iBufferSize, (int32_t)(dwBlockSize - dwOffsetTmp));
FXSYS_memcpy(pBuffer, pBufferTmp + dwOffsetTmp, dwCopySize);
dwOffsetTmp = dwCopySize;
iBufferSize -= dwCopySize;
@@ -492,7 +492,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi m_iPosition += dwOffsetTmp;
return dwOffsetTmp;
}
-FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pBufferRead != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
@@ -500,7 +500,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength if (iMaxLength <= 0) {
return 0;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iMaxLength && pStr[i] != L'\0') {
++i;
}
@@ -524,16 +524,16 @@ FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR m_pFileWrite = pFileWrite;
return TRUE;
}
-FX_INT32 CFX_FileWriteStreamImp::GetLength() const
+int32_t CFX_FileWriteStreamImp::GetLength() const
{
if (!m_pFileWrite) {
return 0;
}
- return (FX_INT32)m_pFileWrite->GetSize();
+ return (int32_t)m_pFileWrite->GetSize();
}
-FX_INT32 CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
switch (eSeek) {
case FX_STREAMSEEK_Begin:
m_iPosition = iOffset;
@@ -556,7 +556,7 @@ FX_BOOL CFX_FileWriteStreamImp::IsEOF() const {
return m_iPosition >= GetLength();
}
-FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
if (!m_pFileWrite) {
return 0;
@@ -566,7 +566,7 @@ FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferS }
return iBufferSize;
}
-FX_INT32 CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return WriteData((FX_LPCBYTE)pStr, iLength * sizeof(FX_WCHAR));
}
@@ -584,7 +584,7 @@ CFX_BufferStreamImp::CFX_BufferStreamImp() , m_iLength(0)
{
}
-FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess)
+FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess)
{
FXSYS_assert(m_pData == NULL);
FXSYS_assert(pData != NULL && iTotalSize > 0);
@@ -595,12 +595,12 @@ FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iTotalSize;
return TRUE;
}
-FX_INT32 CFX_BufferStreamImp::GetLength() const
+int32_t CFX_BufferStreamImp::GetLength() const
{
FXSYS_assert(m_pData != NULL);
return m_iLength;
}
-FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
FXSYS_assert(m_pData != NULL);
if (eSeek == FX_STREAMSEEK_Begin) {
@@ -618,7 +618,7 @@ FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) }
return m_iPosition;
}
-FX_INT32 CFX_BufferStreamImp::GetPosition()
+int32_t CFX_BufferStreamImp::GetPosition()
{
FXSYS_assert(m_pData != NULL);
return m_iPosition;
@@ -628,11 +628,11 @@ FX_BOOL CFX_BufferStreamImp::IsEOF() const FXSYS_assert(m_pData != NULL);
return m_iPosition >= m_iLength;
}
-FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pData != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -640,16 +640,16 @@ FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_iPosition += iLen;
return iLen;
}
-FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pData != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
- FX_INT32 iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength);
+ int32_t iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength);
if (iLen <= 0) {
return 0;
}
FX_LPCWSTR pSrc = (FX_LPCWSTR)(FX_LPSTR)(m_pData + m_iPosition);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (*pSrc != L'\0' && iCount < iLen) {
*pStr ++ = *pSrc ++, iCount ++;
}
@@ -657,11 +657,11 @@ FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX bEOS = (*pSrc == L'\0') || (m_iPosition >= m_iLength);
return iCount;
}
-FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -672,11 +672,11 @@ FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize }
return iLen;
}
-FX_INT32 CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pStr != NULL && iLength > 0);
- FX_INT32 iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength);
+ int32_t iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength);
if (iLen <= 0) {
return 0;
}
@@ -718,7 +718,7 @@ CFX_TextStream::~CFX_TextStream() }
void CFX_TextStream::InitStream()
{
- FX_INT32 iPosition = m_pStreamImp->GetPosition();
+ int32_t iPosition = m_pStreamImp->GetPosition();
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, 0);
m_pStreamImp->ReadData((FX_LPBYTE)&m_dwBOM, 3);
#if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_
@@ -777,15 +777,15 @@ FX_DWORD CFX_TextStream::GetAccessModes() const {
return m_pStreamImp->GetAccessModes() | FX_STREAMACCESS_Text;
}
-FX_INT32 CFX_TextStream::GetLength() const
+int32_t CFX_TextStream::GetLength() const
{
return m_pStreamImp->GetLength();
}
-FX_INT32 CFX_TextStream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_TextStream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
return m_pStreamImp->Seek(eSeek, iOffset);
}
-FX_INT32 CFX_TextStream::GetPosition()
+int32_t CFX_TextStream::GetPosition()
{
return m_pStreamImp->GetPosition();
}
@@ -793,11 +793,11 @@ FX_BOOL CFX_TextStream::IsEOF() const {
return m_pStreamImp->IsEOF();
}
-FX_INT32 CFX_TextStream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_TextStream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
return m_pStreamImp->ReadData(pBuffer, iBufferSize);
}
-FX_INT32 CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return m_pStreamImp->WriteData(pBuffer, iBufferSize);
}
@@ -805,7 +805,7 @@ void CFX_TextStream::Flush() {
m_pStreamImp->Flush();
}
-FX_BOOL CFX_TextStream::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_TextStream::SetLength(int32_t iLength)
{
return m_pStreamImp->SetLength(iLength);
}
@@ -813,7 +813,7 @@ FX_WORD CFX_TextStream::GetCodePage() const {
return m_wCodePage;
}
-IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength)
+IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)
{
IFX_Stream *pSR = m_pStreamImp->CreateSharedStream(dwAccess, iOffset, iLength);
if (pSR == NULL) {
@@ -829,13 +829,13 @@ IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffs }
return pSR;
}
-FX_INT32 CFX_TextStream::GetBOM(FX_BYTE bom[4]) const
+int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const
{
if (m_wBOMLength < 1) {
return 0;
}
*(FX_DWORD*)bom = m_dwBOM;
- return (FX_INT32)m_wBOMLength;
+ return (int32_t)m_wBOMLength;
}
FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage)
{
@@ -846,15 +846,15 @@ FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) m_wCodePage = wCodePage;
return v;
}
-FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize)
+int32_t CFX_TextStream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize)
{
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iLen;
+ int32_t iLen;
if (m_wCodePage == FX_CODEPAGE_UTF16LE || m_wCodePage == FX_CODEPAGE_UTF16BE) {
- FX_INT32 iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize;
+ int32_t iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize;
m_pStreamImp->Lock();
iLen = m_pStreamImp->ReadData((FX_LPBYTE)pStr, iBytes);
m_pStreamImp->Unlock();
@@ -872,21 +872,21 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL }
#endif
} else {
- FX_INT32 pos = m_pStreamImp->GetPosition();
- FX_INT32 iBytes = pByteSize == NULL ? iMaxLength : *pByteSize;
+ int32_t pos = m_pStreamImp->GetPosition();
+ int32_t iBytes = pByteSize == NULL ? iMaxLength : *pByteSize;
iBytes = FX_MIN(iBytes, m_pStreamImp->GetLength() - pos);
if (iBytes > 0) {
if (m_pBuf == NULL) {
- m_pBuf = (FX_LPBYTE)FX_Alloc(FX_BYTE, iBytes);
+ m_pBuf = (FX_LPBYTE)FX_Alloc(uint8_t, iBytes);
m_iBufSize = iBytes;
} else if (iBytes > m_iBufSize) {
- m_pBuf = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pBuf, iBytes);
+ m_pBuf = (FX_LPBYTE)FX_Realloc(uint8_t, m_pBuf, iBytes);
m_iBufSize = iBytes;
}
m_pStreamImp->Lock();
iLen = m_pStreamImp->ReadData(m_pBuf, iBytes);
- FX_INT32 iSrc = iLen;
- FX_INT32 iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE);
+ int32_t iSrc = iLen;
+ int32_t iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE);
m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen);
m_pStreamImp->Unlock();
if (iDecode < 1) {
@@ -899,14 +899,14 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL bEOS = m_pStreamImp->IsEOF();
return iMaxLength;
}
-FX_INT32 CFX_TextStream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_TextStream::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL && iLength > 0);
if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) {
return -1;
}
if (m_wCodePage == FX_CODEPAGE_UTF8) {
- FX_INT32 len = iLength;
+ int32_t len = iLength;
CFX_UTF8Encoder encoder;
while (len -- > 0) {
encoder.Input(*pStr ++);
@@ -1004,7 +1004,7 @@ FX_BOOL CFX_Stream::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess) }
return bRet;
}
-FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess)
+FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess)
{
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) {
return FALSE;
@@ -1027,7 +1027,7 @@ FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dw }
return bRet;
}
-FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
+FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
{
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) {
return FALSE;
@@ -1061,7 +1061,7 @@ IFX_Stream* CFX_Stream::Retain() m_iRefCount++;
return this;
}
-FX_INT32 CFX_Stream::GetLength() const
+int32_t CFX_Stream::GetLength() const
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1071,7 +1071,7 @@ FX_INT32 CFX_Stream::GetLength() const }
return m_iLength;
}
-FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_Stream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1079,8 +1079,8 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) if (m_eStreamType == FX_STREAMTYPE_File || m_eStreamType == FX_STREAMTYPE_Buffer) {
return m_iPosition = m_pStreamImp->Seek(eSeek, iOffset);
}
- FX_INT32 iEnd = m_iStart + m_iLength;
- FX_INT32 iPosition = m_iStart + iOffset;
+ int32_t iEnd = m_iStart + m_iLength;
+ int32_t iPosition = m_iStart + iOffset;
if (eSeek == FX_STREAMSEEK_Begin) {
m_iPosition = iPosition;
} else if (eSeek == FX_STREAMSEEK_Current) {
@@ -1096,7 +1096,7 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) }
return m_iPosition - m_iStart;
}
-FX_INT32 CFX_Stream::GetPosition()
+int32_t CFX_Stream::GetPosition()
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1116,13 +1116,13 @@ FX_BOOL CFX_Stream::IsEOF() const }
return m_iPosition >= m_iStart + m_iLength;
}
-FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_Stream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -1135,14 +1135,14 @@ FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize)
+int32_t CFX_Stream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize)
{
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iEnd = m_iStart + m_iLength;
- FX_INT32 iLen = iEnd - m_iPosition;
+ int32_t iEnd = m_iStart + m_iLength;
+ int32_t iLen = iEnd - m_iPosition;
if (pByteSize != NULL) {
iLen = FX_MIN(iLen, *pByteSize);
}
@@ -1162,7 +1162,7 @@ FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bE m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_Stream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
if (m_pStreamImp == NULL) {
@@ -1171,7 +1171,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) {
return -1;
}
- FX_INT32 iLen = iBufferSize;
+ int32_t iLen = iBufferSize;
if (m_eStreamType == FX_STREAMTYPE_Stream) {
iLen = FX_MIN(m_iStart + m_iTotalSize - m_iPosition, iBufferSize);
if (iLen <= 0) {
@@ -1179,7 +1179,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) }
}
m_pStreamImp->Lock();
- FX_INT32 iEnd = m_iStart + m_iLength;
+ int32_t iEnd = m_iStart + m_iLength;
if (m_pStreamImp->GetPosition() != m_iPosition) {
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition);
}
@@ -1191,7 +1191,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_Stream::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL && iLength > 0);
if (m_pStreamImp == NULL) {
@@ -1200,7 +1200,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) {
return -1;
}
- FX_INT32 iLen = iLength;
+ int32_t iLen = iLength;
if (m_eStreamType == FX_STREAMTYPE_Stream) {
iLen = FX_MIN((m_iStart + m_iTotalSize - m_iPosition) / 2, iLength);
if (iLen <= 0) {
@@ -1208,7 +1208,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) }
}
m_pStreamImp->Lock();
- FX_INT32 iEnd = m_iStart + m_iLength;
+ int32_t iEnd = m_iStart + m_iLength;
if (m_pStreamImp->GetPosition() != m_iPosition) {
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition);
}
@@ -1230,7 +1230,7 @@ void CFX_Stream::Flush() }
m_pStreamImp->Flush();
}
-FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_Stream::SetLength(int32_t iLength)
{
if (m_pStreamImp == NULL) {
return FALSE;
@@ -1240,7 +1240,7 @@ FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength) }
return m_pStreamImp->SetLength(iLength);
}
-FX_INT32 CFX_Stream::GetBOM(FX_BYTE bom[4]) const
+int32_t CFX_Stream::GetBOM(uint8_t bom[4]) const
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1263,7 +1263,7 @@ FX_WORD CFX_Stream::SetCodePage(FX_WORD wCodePage) return FX_CODEPAGE_UTF16BE;
#endif
}
-IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength)
+IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)
{
FXSYS_assert( iLength > 0);
if (m_pStreamImp == NULL) {
@@ -1275,12 +1275,12 @@ IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, if ((m_dwAccess & FX_STREAMACCESS_Write) == 0 && (dwAccess & FX_STREAMACCESS_Write) != 0) {
return NULL;
}
- register FX_INT32 iStart = m_iStart + iOffset;
- register FX_INT32 iTotal = m_iStart + m_iLength;
+ register int32_t iStart = m_iStart + iOffset;
+ register int32_t iTotal = m_iStart + m_iLength;
if (iStart < m_iStart || iStart >= iTotal) {
return NULL;
}
- register FX_INT32 iEnd = iStart + iLength;
+ register int32_t iEnd = iStart + iLength;
if (iEnd < iStart || iEnd > iTotal) {
return NULL;
}
@@ -1325,10 +1325,10 @@ FX_FILESIZE CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
m_pStream->Lock();
- m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset);
- FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size);
+ m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset);
+ int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#else
CFGAS_FileRead::CFGAS_FileRead(IFX_Stream *pStream, FX_BOOL bReleaseStream)
@@ -1350,10 +1350,10 @@ FX_DWORD CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_DWORD offset, FX_DWORD size)
{
m_pStream->Lock();
- m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset);
- FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size);
+ m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset);
+ int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#endif
#ifdef FX_FILESIZE
@@ -1447,14 +1447,14 @@ FX_BOOL CFX_BufferAccImp::ReadBlock(void* buffer, FX_FILESIZE offset, size_t siz return TRUE;
}
#else
-IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream)
+IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream)
{
if (!pBufferRead) {
return NULL;
}
return FX_NEW CFX_BufferAccImp(pBufferRead, iFileSize, bReleaseStream);
}
-CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream)
+CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream)
: m_pBufferRead(pBufferRead)
, m_bReleaseStream(bReleaseStream)
, m_iBufSize(iFileSize)
@@ -1566,15 +1566,15 @@ FX_BOOL CFGAS_FileWrite::Flush() }
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, size_t size)
{
- return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size;
+ return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size;
}
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_FILESIZE offset, size_t size)
{
m_pStream->Lock();
m_pStream->Seek(FX_STREAMSEEK_Begin, offset);
- FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size);
+ int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#else
CFGAS_FileWrite::CFGAS_FileWrite(IFX_Stream *pStream, FX_BOOL bReleaseStream)
@@ -1600,14 +1600,14 @@ FX_DWORD CFGAS_FileWrite::Flush() }
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD size)
{
- return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size;
+ return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size;
}
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD offset, FX_DWORD size)
{
m_pStream->Lock();
m_pStream->Seek(FX_STREAMSEEK_Begin, offset);
- FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size);
+ int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#endif
diff --git a/xfa/src/fgas/src/crt/fx_stream.h b/xfa/src/fgas/src/crt/fx_stream.h index 30cb98486e..2273ab1d9b 100644 --- a/xfa/src/fgas/src/crt/fx_stream.h +++ b/xfa/src/fgas/src/crt/fx_stream.h @@ -28,16 +28,16 @@ public: {
return m_dwAccess;
}
- virtual FX_INT32 GetLength() const = 0;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0;
- virtual FX_INT32 GetPosition() = 0;
+ virtual int32_t GetLength() const = 0;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
+ virtual int32_t GetPosition() = 0;
virtual FX_BOOL IsEOF() const = 0;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) = 0;
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0;
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) = 0;
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(FX_INT32 iLength) = 0;
+ virtual FX_BOOL SetLength(int32_t iLength) = 0;
protected:
CFX_StreamImp();
virtual ~CFX_StreamImp() {}
@@ -49,44 +49,44 @@ public: CFX_FileStreamImp();
virtual ~CFX_FileStreamImp();
FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
+ virtual FX_BOOL SetLength(int32_t iLength);
protected:
FXSYS_FILE *m_hFile;
- FX_INT32 m_iLength;
+ int32_t m_iLength;
};
class CFX_BufferStreamImp : public CFX_StreamImp
{
public:
CFX_BufferStreamImp();
virtual ~CFX_BufferStreamImp() {}
- FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
FX_LPBYTE m_pData;
- FX_INT32 m_iTotalSize;
- FX_INT32 m_iPosition;
- FX_INT32 m_iLength;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iLength;
};
class CFX_FileReadStreamImp : public CFX_StreamImp
{
@@ -94,69 +94,69 @@ public: CFX_FileReadStreamImp();
virtual ~CFX_FileReadStreamImp() {}
FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return 0;
}
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
IFX_FileRead *m_pFileRead;
- FX_INT32 m_iPosition;
- FX_INT32 m_iLength;
+ int32_t m_iPosition;
+ int32_t m_iLength;
};
class CFX_BufferReadStreamImp : public CFX_StreamImp
{
public:
CFX_BufferReadStreamImp();
~CFX_BufferReadStreamImp();
- FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
+ FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return 0;
}
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
private:
IFX_BufferRead *m_pBufferRead;
FX_BOOL m_bReleaseBufferRead;
- FX_INT32 m_iPosition;
- FX_INT32 m_iBufferSize;
+ int32_t m_iPosition;
+ int32_t m_iBufferSize;
};
class CFX_FileWriteStreamImp : public CFX_StreamImp
{
@@ -164,31 +164,31 @@ public: CFX_FileWriteStreamImp();
virtual ~CFX_FileWriteStreamImp() {}
FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
return 0;
}
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
IFX_FileWrite *m_pFileWrite;
- FX_INT32 m_iPosition;
+ int32_t m_iPosition;
};
enum FX_STREAMTYPE {
FX_SREAMTYPE_Unknown = 0,
@@ -203,27 +203,27 @@ public: CFX_Stream();
~CFX_Stream();
FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess);
- FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess);
+ FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
- FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
+ FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
virtual void Release();
virtual IFX_Stream* Retain();
virtual FX_DWORD GetAccessModes() const
{
return m_dwAccess;
}
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const;
+ virtual FX_BOOL SetLength(int32_t iLength);
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
virtual FX_WORD GetCodePage() const;
virtual FX_WORD SetCodePage(FX_WORD wCodePage);
virtual void Lock()
@@ -234,16 +234,16 @@ public: {
CFX_ThreadLock::Unlock();
}
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength);
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength);
protected:
FX_STREAMTYPE m_eStreamType;
CFX_StreamImp *m_pStreamImp;
FX_DWORD m_dwAccess;
- FX_INT32 m_iTotalSize;
- FX_INT32 m_iPosition;
- FX_INT32 m_iStart;
- FX_INT32 m_iLength;
- FX_INT32 m_iRefCount;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iStart;
+ int32_t m_iLength;
+ int32_t m_iRefCount;
};
class CFX_TextStream : public IFX_Stream, public CFX_ThreadLock
{
@@ -254,19 +254,19 @@ public: virtual IFX_Stream* Retain();
virtual FX_DWORD GetAccessModes() const;
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
+ virtual FX_BOOL SetLength(int32_t iLength);
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const;
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
virtual FX_WORD GetCodePage() const;
virtual FX_WORD SetCodePage(FX_WORD wCodePage);
@@ -279,16 +279,16 @@ public: CFX_ThreadLock::Unlock();
}
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength);
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength);
protected:
FX_WORD m_wCodePage;
FX_WORD m_wBOMLength;
FX_DWORD m_dwBOM;
FX_LPBYTE m_pBuf;
- FX_INT32 m_iBufSize;
+ int32_t m_iBufSize;
FX_BOOL m_bDelStream;
IFX_Stream *m_pStreamImp;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
void InitStream();
};
#ifdef FX_FILESIZE
@@ -347,7 +347,7 @@ protected: class CFX_BufferAccImp : public IFX_FileRead
{
public:
- CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream);
+ CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream);
virtual ~CFX_BufferAccImp();
virtual void Release()
@@ -360,7 +360,7 @@ public: protected:
IFX_BufferRead *m_pBufferRead;
FX_BOOL m_bReleaseStream;
- FX_INT32 m_iBufSize;
+ int32_t m_iBufSize;
};
#endif
#ifdef FX_FILESIZE
diff --git a/xfa/src/fgas/src/crt/fx_system.cpp b/xfa/src/fgas/src/crt/fx_system.cpp index c8e4407a79..88f1631b7f 100644 --- a/xfa/src/fgas/src/crt/fx_system.cpp +++ b/xfa/src/fgas/src/crt/fx_system.cpp @@ -30,7 +30,7 @@ FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count) }
return dstStr;
}
-FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
+int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_WCHAR wch1 = 0, wch2 = 0;
@@ -43,7 +43,7 @@ FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) }
return wch1 - wch2;
}
-FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
+int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_CHAR ch1 = 0, ch2 = 0;
@@ -56,20 +56,20 @@ FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) }
return ch1 - ch2;
}
-FX_INT32 FX_filelength(FXSYS_FILE *file)
+int32_t FX_filelength(FXSYS_FILE *file)
{
FXSYS_assert(file != NULL);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
return _filelength(_fileno(file));
#else
- FX_INT32 iPos = FXSYS_ftell(file);
+ int32_t iPos = FXSYS_ftell(file);
FXSYS_fseek(file, 0, FXSYS_SEEK_END);
- FX_INT32 iLen = FXSYS_ftell(file);
+ int32_t iLen = FXSYS_ftell(file);
FXSYS_fseek(file, iPos, FXSYS_SEEK_SET);
return iLen;
#endif
}
-FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size)
+FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size)
{
FXSYS_assert(file != NULL);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
@@ -79,13 +79,13 @@ FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size) FX_DWORD dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT);
::SetFilePointer(hFile, size, 0, FILE_BEGIN);
FX_BOOL bRet = ::SetEndOfFile(hFile);
- ::SetFilePointer(hFile, (FX_INT32)dwPos, 0, FILE_BEGIN);
+ ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN);
return bRet;
#else
return FALSE;
#endif
}
-FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen )
+FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength , int32_t *pUsedLen )
{
FXSYS_assert(pcsStr != NULL);
if (iLength < 0) {
@@ -93,7 +93,7 @@ FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) }
return FX_wcstof(CFX_WideString::FromLocal(pcsStr, iLength), iLength, pUsedLen);
}
-FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen )
+FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength , int32_t *pUsedLen )
{
FXSYS_assert(pwsStr != NULL);
if (iLength < 0) {
@@ -102,7 +102,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) if (iLength == 0) {
return 0.0f;
}
- FX_INT32 iUsedLen = 0;
+ int32_t iUsedLen = 0;
FX_BOOL bNegtive = FALSE;
switch (pwsStr[iUsedLen]) {
case '-':
@@ -138,7 +138,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) }
return bNegtive ? -fValue : fValue;
}
-void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size)
+void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size)
{
FXSYS_assert(pBuf != NULL && size > 0 && (size & 0x03) == 0);
FXSYS_assert((((size_t)pBuf) & 0x03) == 0);
@@ -161,11 +161,11 @@ void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size) }
FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsUrl)
{
- FX_INT32 iUrlLen = wsUrl.GetLength();
+ int32_t iUrlLen = wsUrl.GetLength();
if (iUrlLen == 0) {
return TRUE;
}
- for (FX_INT32 i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i)
+ for (int32_t i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i)
if (wsUrl.GetAt(i) == ':') {
return FALSE;
}
@@ -190,7 +190,7 @@ FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &ws return wsAbsolutePath.GetLength() > 0;
}
}
- FX_INT32 nBackCount = 0;
+ int32_t nBackCount = 0;
for(;;) {
if (pRelStart >= pRelEnd) {
wsAbsolutePath = wsBasePath;
diff --git a/xfa/src/fgas/src/crt/fx_utils.cpp b/xfa/src/fgas/src/crt/fx_utils.cpp index 6f8452237f..55d97f0ea6 100644 --- a/xfa/src/fgas/src/crt/fx_utils.cpp +++ b/xfa/src/fgas/src/crt/fx_utils.cpp @@ -20,14 +20,14 @@ void CFX_ThreadLock::Unlock() {
}
typedef struct _FX_BASEARRAYDATA : public CFX_Target {
- FX_INT32 iGrowSize;
- FX_INT32 iBlockSize;
- FX_INT32 iTotalCount;
- FX_INT32 iBlockCount;
+ int32_t iGrowSize;
+ int32_t iBlockSize;
+ int32_t iTotalCount;
+ int32_t iBlockCount;
FX_LPBYTE pBuffer;
} FX_BASEARRAYDATA, * FX_LPBASEARRAYDATA;
typedef FX_BASEARRAYDATA const * FX_LPCBASEARRAYDATA;
-CFX_BaseArray::CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize)
+CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize)
{
FXSYS_assert(iGrowSize > 0 && iBlockSize > 0);
m_pData = FXTARGET_New FX_BASEARRAYDATA;
@@ -43,38 +43,38 @@ CFX_BaseArray::~CFX_BaseArray() }
FXTARGET_Delete pData;
}
-FX_INT32 CFX_BaseArray::GetSize() const
+int32_t CFX_BaseArray::GetSize() const
{
return ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
}
-FX_INT32 CFX_BaseArray::GetBlockSize() const
+int32_t CFX_BaseArray::GetBlockSize() const
{
return ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
}
-FX_LPBYTE CFX_BaseArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseArray::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBYTE &pBuffer = ((FX_LPBASEARRAYDATA)m_pData)->pBuffer;
- FX_INT32 &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount;
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
if (index >= iTotalCount) {
- FX_INT32 iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize;
+ int32_t iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize;
iTotalCount = (index / iGrowSize + 1) * iGrowSize;
- FX_INT32 iNewSize = iTotalCount * iBlockSize;
+ int32_t iNewSize = iTotalCount * iBlockSize;
if (pBuffer == NULL) {
- pBuffer = (FX_LPBYTE)FX_Alloc(FX_BYTE, iNewSize);
+ pBuffer = (FX_LPBYTE)FX_Alloc(uint8_t, iNewSize);
} else {
- pBuffer = (FX_LPBYTE)FX_Realloc(FX_BYTE, pBuffer, iNewSize);
+ pBuffer = (FX_LPBYTE)FX_Realloc(uint8_t, pBuffer, iNewSize);
}
}
FXSYS_assert(pBuffer != NULL);
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
if (index >= iBlockCount) {
iBlockCount = index + 1;
}
return pBuffer + index * iBlockSize;
}
-FX_LPBYTE CFX_BaseArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseArray::GetAt(int32_t index) const
{
FXSYS_assert(index > -1 && index < ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount);
return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer + index * ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
@@ -83,12 +83,12 @@ FX_LPBYTE CFX_BaseArray::GetBuffer() const {
return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer;
}
-FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseArray::Append(const CFX_BaseArray &src, int32_t iStart, int32_t iCount)
{
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize);
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
- FX_INT32 iAdded = src.GetSize();
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t iAdded = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iAdded);
if (iCount < 0) {
iCount = iAdded;
@@ -104,11 +104,11 @@ FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT FX_memcpy(pDst, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize);
return iCount;
}
-FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseArray::Copy(const CFX_BaseArray &src, int32_t iStart, int32_t iCount)
{
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize);
- FX_INT32 iCopied = src.GetSize();
+ int32_t iCopied = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iCopied);
if (iCount < 0) {
iCount = iCopied;
@@ -124,9 +124,9 @@ FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 FX_memcpy(((FX_LPBASEARRAYDATA)m_pData)->pBuffer, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize);
return iCount;
}
-FX_INT32 CFX_BaseArray::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseArray::RemoveLast(int32_t iCount)
{
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
if (iCount < 0 || iCount > iBlockCount) {
iCount = iBlockCount;
iBlockCount = 0;
@@ -147,7 +147,7 @@ void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) }
((FX_LPBASEARRAYDATA)m_pData)->iBlockCount = 0;
}
-CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize)
: m_iChunkSize(iChunkSize)
, m_iBlockSize(iBlockSize)
, m_iChunkCount(0)
@@ -162,20 +162,20 @@ CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() RemoveAll();
delete m_pData;
}
-FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBYTE pChunk;
if (index < m_iBlockCount) {
pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
} else {
- FX_INT32 iMemSize = m_iChunkSize * m_iBlockSize;
+ int32_t iMemSize = m_iChunkSize * m_iBlockSize;
while (TRUE) {
if (index < m_iChunkCount * m_iChunkSize) {
pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
break;
} else {
- pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize);
+ pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize);
if (m_iChunkCount < m_pData->GetSize()) {
m_pData->SetAt(m_iChunkCount, pChunk);
} else {
@@ -189,17 +189,17 @@ FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index) m_iBlockCount = index + 1;
return pChunk + (index % m_iChunkSize) * m_iBlockSize;
}
-FX_LPBYTE CFX_BaseMassArrayImp::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseMassArrayImp::GetAt(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iBlockCount);
FX_LPBYTE pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
FXSYS_assert(pChunk != NULL);
return pChunk + (index % m_iChunkSize) * m_iBlockSize;
}
-FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount)
{
FXSYS_assert(m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iAdded = src.m_iBlockCount;
+ int32_t iAdded = src.m_iBlockCount;
FXSYS_assert(iStart > -1 && iStart < iAdded);
if (iCount < 0) {
iCount = iAdded;
@@ -210,16 +210,16 @@ FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 if (iCount < 1) {
return m_iBlockCount;
}
- FX_INT32 iBlockCount = m_iBlockCount;
- FX_INT32 iTotal = m_iBlockCount + iCount;
+ int32_t iBlockCount = m_iBlockCount;
+ int32_t iTotal = m_iBlockCount + iCount;
AddSpaceTo(iTotal - 1);
Append(iBlockCount, src, iStart, iCount);
return m_iBlockCount;
}
-FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount)
{
FXSYS_assert(m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iCopied = src.m_iBlockCount;
+ int32_t iCopied = src.m_iBlockCount;
FXSYS_assert(iStart > -1);
if (iStart >= iCopied) {
return 0;
@@ -240,20 +240,20 @@ FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iS Append(0, src, iStart, iCount);
return m_iBlockCount;
}
-void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart, FX_INT32 iSrcCount)
+void CFX_BaseMassArrayImp::Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart, int32_t iSrcCount)
{
FXSYS_assert(iDstStart > -1 && m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iSrcTotal = src.m_iBlockCount;
+ int32_t iSrcTotal = src.m_iBlockCount;
FXSYS_assert(iSrcTotal > 0 && m_iBlockCount >= iDstStart + iSrcCount);
FXSYS_assert(iSrcStart > -1 && iSrcStart < iSrcTotal && iSrcCount > 0 && iSrcStart + iSrcCount <= iSrcTotal);
- FX_INT32 iDstChunkIndex = iDstStart / m_iChunkSize;
- FX_INT32 iSrcChunkIndex = iSrcStart / src.m_iChunkSize;
+ int32_t iDstChunkIndex = iDstStart / m_iChunkSize;
+ int32_t iSrcChunkIndex = iSrcStart / src.m_iChunkSize;
FX_LPBYTE pDstChunk = (FX_LPBYTE)GetAt(iDstStart);
FX_LPBYTE pSrcChunk = (FX_LPBYTE)src.GetAt(iSrcStart);
- FX_INT32 iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize);
- FX_INT32 iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize);
- FX_INT32 iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize));
- FX_INT32 iCopyBytes = iCopySize * m_iBlockSize;
+ int32_t iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize);
+ int32_t iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize);
+ int32_t iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize));
+ int32_t iCopyBytes = iCopySize * m_iBlockSize;
while (iSrcCount > 0) {
FXSYS_assert(pDstChunk != NULL && pSrcChunk != NULL);
FXSYS_memcpy(pDstChunk, pSrcChunk, iCopyBytes);
@@ -278,7 +278,7 @@ void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp iCopyBytes = iCopySize * m_iBlockSize;
}
}
-FX_INT32 CFX_BaseMassArrayImp::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::RemoveLast(int32_t iCount)
{
if (iCount < 0 || iCount >= m_iBlockCount) {
m_iBlockCount = 0;
@@ -293,7 +293,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iBlockCount = 0;
return;
}
- for (FX_INT32 i = 0; i < m_iChunkCount; i ++) {
+ for (int32_t i = 0; i < m_iChunkCount; i ++) {
FX_LPVOID p = m_pData->GetAt(i);
if (p == NULL) {
continue;
@@ -304,7 +304,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iChunkCount = 0;
m_iBlockCount = 0;
}
-CFX_BaseMassArray::CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseMassArray::CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize)
{
m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize);
}
@@ -312,27 +312,27 @@ CFX_BaseMassArray::~CFX_BaseMassArray() {
FXTARGET_Delete m_pData;
}
-FX_INT32 CFX_BaseMassArray::GetSize() const
+int32_t CFX_BaseMassArray::GetSize() const
{
return m_pData->m_iBlockCount;
}
-FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(int32_t index)
{
return m_pData->AddSpaceTo(index);
}
-FX_LPBYTE CFX_BaseMassArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseMassArray::GetAt(int32_t index) const
{
return m_pData->GetAt(index);
}
-FX_INT32 CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount)
{
return m_pData->Append(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount);
}
-FX_INT32 CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount)
{
return m_pData->Copy(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount);
}
-FX_INT32 CFX_BaseMassArray::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseMassArray::RemoveLast(int32_t iCount)
{
return m_pData->RemoveLast(iCount);
}
@@ -341,13 +341,13 @@ void CFX_BaseMassArray::RemoveAll(FX_BOOL bLeaveMemory) m_pData->RemoveAll(bLeaveMemory);
}
typedef struct _FX_BASEDISCRETEARRAYDATA {
- FX_INT32 iBlockSize;
- FX_INT32 iChunkSize;
- FX_INT32 iChunkCount;
+ int32_t iBlockSize;
+ int32_t iChunkSize;
+ int32_t iChunkCount;
CFX_PtrArray ChunkBuffer;
} FX_BASEDISCRETEARRAYDATA, * FX_LPBASEDISCRETEARRAYDATA;
typedef FX_BASEDISCRETEARRAYDATA const * FX_LPCBASEDISCRETEARRAYDATA;
-CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize)
{
FXSYS_assert(iChunkSize > 0 && iBlockSize > 0);
FX_LPBASEDISCRETEARRAYDATA pData;
@@ -362,20 +362,20 @@ CFX_BaseDiscreteArray::~CFX_BaseDiscreteArray() RemoveAll();
delete (FX_LPBASEDISCRETEARRAYDATA)m_pData;
}
-FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
- FX_INT32 &iChunkCount = pData->iChunkCount;
- FX_INT32 iChunkSize = pData->iChunkSize;
+ int32_t &iChunkCount = pData->iChunkCount;
+ int32_t iChunkSize = pData->iChunkSize;
FX_LPBYTE pChunk = NULL;
- FX_INT32 iChunk = index / iChunkSize;
+ int32_t iChunk = index / iChunkSize;
if (iChunk < iChunkCount) {
pChunk = (FX_LPBYTE)pData->ChunkBuffer.GetAt(iChunk);
}
if (pChunk == NULL) {
- FX_INT32 iMemSize = iChunkSize * pData->iBlockSize;
- pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize);
+ int32_t iMemSize = iChunkSize * pData->iBlockSize;
+ pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize);
FXSYS_memset(pChunk, 0, iMemSize);
pData->ChunkBuffer.SetAtGrow(iChunk, pChunk);
if (iChunkCount <= iChunk) {
@@ -384,12 +384,12 @@ FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index) }
return pChunk + (index % iChunkSize) * pData->iBlockSize;
}
-FX_LPBYTE CFX_BaseDiscreteArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseDiscreteArray::GetAt(int32_t index) const
{
FXSYS_assert(index > -1);
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
- FX_INT32 iChunkSize = pData->iChunkSize;
- FX_INT32 iChunk = index / iChunkSize;
+ int32_t iChunkSize = pData->iChunkSize;
+ int32_t iChunk = index / iChunkSize;
if (iChunk >= pData->iChunkCount) {
return NULL;
}
@@ -403,8 +403,8 @@ void CFX_BaseDiscreteArray::RemoveAll() {
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
CFX_PtrArray &ChunkBuffer = pData->ChunkBuffer;
- FX_INT32 &iChunkCount = pData->iChunkCount;
- for (FX_INT32 i = 0; i < iChunkCount; i++) {
+ int32_t &iChunkCount = pData->iChunkCount;
+ for (int32_t i = 0; i < iChunkCount; i++) {
FX_LPVOID p = ChunkBuffer.GetAt(i);
if (p == NULL) {
continue;
@@ -414,7 +414,7 @@ void CFX_BaseDiscreteArray::RemoveAll() ChunkBuffer.RemoveAll();
iChunkCount = 0;
}
-CFX_BaseStack::CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseStack::CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize)
{
m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize);
}
@@ -428,7 +428,7 @@ FX_LPBYTE CFX_BaseStack::Push() }
void CFX_BaseStack::Pop()
{
- FX_INT32 &iBlockCount = m_pData->m_iBlockCount;
+ int32_t &iBlockCount = m_pData->m_iBlockCount;
if (iBlockCount < 1) {
return;
}
@@ -436,17 +436,17 @@ void CFX_BaseStack::Pop() }
FX_LPBYTE CFX_BaseStack::GetTopElement() const
{
- FX_INT32 iSize = m_pData->m_iBlockCount;
+ int32_t iSize = m_pData->m_iBlockCount;
if (iSize < 1) {
return NULL;
}
return m_pData->GetAt(iSize - 1);
}
-FX_INT32 CFX_BaseStack::GetSize() const
+int32_t CFX_BaseStack::GetSize() const
{
return m_pData->m_iBlockCount;
}
-FX_LPBYTE CFX_BaseStack::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseStack::GetAt(int32_t index) const
{
return m_pData->GetAt(index);
}
diff --git a/xfa/src/fgas/src/crt/fx_utils.h b/xfa/src/fgas/src/crt/fx_utils.h index a073b80e57..92c2bcb198 100644 --- a/xfa/src/fgas/src/crt/fx_utils.h +++ b/xfa/src/fgas/src/crt/fx_utils.h @@ -9,24 +9,24 @@ class CFX_BaseMassArrayImp : public CFX_Target
{
public:
- CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseMassArrayImp();
FX_LPBYTE AddSpace()
{
return AddSpaceTo(m_iBlockCount);
}
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
- FX_INT32 Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
+ int32_t Append(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
- FX_INT32 m_iChunkSize;
- FX_INT32 m_iBlockSize;
- FX_INT32 m_iChunkCount;
- FX_INT32 m_iBlockCount;
+ int32_t m_iChunkSize;
+ int32_t m_iBlockSize;
+ int32_t m_iChunkCount;
+ int32_t m_iBlockCount;
CFX_PtrArray *m_pData;
protected:
- void Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart = 0, FX_INT32 iSrcCount = -1);
+ void Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart = 0, int32_t iSrcCount = -1);
};
#endif
diff --git a/xfa/src/fgas/src/font/fx_fontutils.cpp b/xfa/src/fgas/src/font/fx_fontutils.cpp index b2a7028fb8..24e77c1c93 100644 --- a/xfa/src/fgas/src/font/fx_fontutils.cpp +++ b/xfa/src/fgas/src/font/fx_fontutils.cpp @@ -218,9 +218,9 @@ static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { };
FGAS_LPCFONTUSB FGAS_GetUnicodeBitField(FX_WCHAR wUnicode)
{
- FX_INT32 iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1;
+ int32_t iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FGAS_FONTUSB &usb = g_FXGdiFontUSBTable[iMid];
diff --git a/xfa/src/fgas/src/font/fx_gdifont.cpp b/xfa/src/fgas/src/font/fx_gdifont.cpp index e9ab665b5a..437a25c7e4 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.cpp +++ b/xfa/src/fgas/src/font/fx_gdifont.cpp @@ -16,7 +16,7 @@ CFX_GdiFontCache::CFX_GdiFontCache() CFX_GdiFontCache::~CFX_GdiFontCache()
{
FX_POSITION pos = m_GlyphMap.GetStartPosition();
- FX_INT32 iGlyph;
+ int32_t iGlyph;
FX_LPGDIGOCACHE pGlyph;
while (pos != NULL) {
pGlyph = NULL;
@@ -53,7 +53,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX }
return pFont;
}
-IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr)
+IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr)
{
CFX_GdiFont *pFont = FX_NEW CFX_GdiFont(pFontMgr);
if (!pFont->LoadFont(pBuffer, iLength)) {
@@ -107,8 +107,8 @@ CFX_GdiFont::CFX_GdiFont(IFX_FontMgr *pFontMgr) }
CFX_GdiFont::~CFX_GdiFont()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
pFont->Release();
}
@@ -131,8 +131,8 @@ CFX_GdiFont::~CFX_GdiFont() }
void CFX_GdiFont::ClearCache()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
((CFX_GdiFont*)pFont)->ClearCache();
}
@@ -181,7 +181,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F lf.lfCharSet = SYMBOL_CHARSET;
} else {
FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage);
- lf.lfCharSet = wCharSet != 0xFFFF ? (FX_BYTE)wCharSet : DEFAULT_CHARSET;
+ lf.lfCharSet = wCharSet != 0xFFFF ? (uint8_t)wCharSet : DEFAULT_CHARSET;
}
if (pszFontFamily == NULL) {
lf.lfFaceName[0] = L'\0';
@@ -190,7 +190,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F }
return LoadFont(lf);
}
-FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength)
+FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength)
{
FXSYS_assert(m_hFont == NULL && pBuffer != NULL && iLength > 0);
Gdiplus::PrivateFontCollection pfc;
@@ -247,7 +247,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFileName) FX_BOOL CFX_GdiFont::LoadFont(IFX_Stream *pFontStream)
{
FXSYS_assert(m_hFont == NULL && pFontStream != NULL);
- FX_INT32 iLength = pFontStream->GetLength();
+ int32_t iLength = pFontStream->GetLength();
if (iLength < 1) {
return FALSE;
}
@@ -272,9 +272,9 @@ FX_BOOL CFX_GdiFont::LoadFont(const LOGFONTW &lf) ::GetOutlineTextMetricsW(m_hDC, sizeof(m_OutlineTM), &m_OutlineTM);
return TRUE;
}
-FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc)
+int32_t CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc)
{
- FX_INT32 iCount = fc.GetFamilyCount();
+ int32_t iCount = fc.GetFamilyCount();
if (iCount < 1) {
return iCount;
}
@@ -282,9 +282,9 @@ FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc) if (pFontFamilies == NULL) {
return -1;
}
- FX_INT32 iFind = 0;
+ int32_t iFind = 0;
fc.GetFamilies(iCount, pFontFamilies, &iFind);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
CFX_WideString wsFamilyName;
FX_LPWSTR pName = wsFamilyName.GetBuffer(LF_FACESIZE);
pFontFamilies[i].GetFamilyName(pName);
@@ -306,12 +306,12 @@ void CFX_GdiFont::GetFamilyName(CFX_WideString &wsFamily) const FXSYS_assert(m_hFont != NULL);
wsFamily = m_LogFont.lfFaceName;
}
-FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
+FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
{
- iWidth = (FX_INT32)(FX_SHORT)m_WidthCache.GetAt(wUnicode, 0);
+ iWidth = (int32_t)(int16_t)m_WidthCache.GetAt(wUnicode, 0);
if (iWidth == 0 || iWidth == -1) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
if (!::GetCharWidthI(m_hDC, iGlyph, 1, NULL, &iWidth)) {
@@ -324,18 +324,18 @@ FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL b iWidth = -1;
}
Lock();
- m_WidthCache.SetAtGrow(wUnicode, (FX_SHORT)iWidth);
+ m_WidthCache.SetAtGrow(wUnicode, (int16_t)iWidth);
Unlock();
}
return iWidth > 0;
}
-FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode)
+FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode)
{
return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode);
}
-FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
+int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
{
- FX_INT32 iGlyph = 0XFFFF;
+ int32_t iGlyph = 0XFFFF;
if (::GetGlyphIndicesW(m_hDC, &wUnicode, 1, (LPWORD)&iGlyph, GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR && iGlyph != 0xFFFF) {
if (ppFont != NULL) {
*ppFont = (IFX_Font*)this;
@@ -355,7 +355,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F if (pFont != NULL && pFont != (IFX_Font*)this) {
iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyph != 0xFFFF) {
- FX_INT32 i = m_SubstFonts.Find(pFont);
+ int32_t i = m_SubstFonts.Find(pFont);
if (i > -1) {
iGlyph |= ((i + 1) << 24);
if (ppFont != NULL) {
@@ -373,7 +373,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F return 0xFFFF;
}
m_FontMapper.SetAt((void*)wBitField, (void*)pFont);
- FX_INT32 i = m_SubstFonts.GetSize();
+ int32_t i = m_SubstFonts.GetSize();
m_SubstFonts.Add(pFont);
iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyph != 0xFFFF) {
@@ -387,21 +387,21 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F }
return 0xFFFF;
}
-FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
+int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
{
return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode);
}
-FX_INT32 CFX_GdiFont::GetAscent() const
+int32_t CFX_GdiFont::GetAscent() const
{
return m_OutlineTM.otmAscent;
}
-FX_INT32 CFX_GdiFont::GetDescent() const
+int32_t CFX_GdiFont::GetDescent() const
{
return m_OutlineTM.otmDescent;
}
FX_BOOL CFX_GdiFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode)
{
- FX_INT32 iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode);
+ int32_t iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode);
if (iGlyphIndex == 0xFFFF) {
return FALSE;
}
@@ -429,7 +429,7 @@ FX_BOOL CFX_GdiFont::GetBBox(CFX_Rect &bbox) bbox.height = m_OutlineTM.otmrcFontBox.bottom - m_OutlineTM.otmrcFontBox.top;
return TRUE;
}
-FX_INT32 CFX_GdiFont::GetItalicAngle() const
+int32_t CFX_GdiFont::GetItalicAngle() const
{
return m_OutlineTM.otmItalicAngle / 10;
}
@@ -440,9 +440,9 @@ void CFX_GdiFont::Reset() ClearCache();
Unlock();
}
-IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const
+IFX_Font* CFX_GdiFont::GetSubstFont(int32_t iGlyphIndex) const
{
- FX_INT32 iHigher = (iGlyphIndex & 0x7F000000) >> 24;
+ int32_t iHigher = (iGlyphIndex & 0x7F000000) >> 24;
if (iHigher == 0) {
return (IFX_Font*)this;
}
@@ -451,7 +451,7 @@ IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const }
return (IFX_Font*)m_SubstFonts[iHigher - 1];
}
-FX_DWORD CFX_GdiFont::GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize)
+FX_DWORD CFX_GdiFont::GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize)
{
static const UINT uFormat = GGO_GLYPH_INDEX | GGO_GRAY8_BITMAP;
IFX_Font *pFont = GetSubstFont(iGlyphIndex);
@@ -511,11 +511,11 @@ FX_DWORD CFX_GdiFont::GetMAT2HashCode(const FIXED *pFixed) }
return ((dwHash1 & 0x0000FFFF) << 16) | (dwHash2 & 0x0000FFFF);
}
-void CFX_GdiFont::CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb)
+void CFX_GdiFont::CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb)
{
- FX_INT32 padding = ((iWidth + 3) / 4) * 4 - iWidth;
+ int32_t padding = ((iWidth + 3) / 4) * 4 - iWidth;
FX_DWORD alpha;
- FX_INT32 i, j;
+ int32_t i, j;
for (j = iHeight - 1; j >= 0; --j) {
for (i = iWidth - 1; i >= 0; --i) {
if ((alpha = *pOutline++) == 0) {
diff --git a/xfa/src/fgas/src/font/fx_gdifont.h b/xfa/src/fgas/src/font/fx_gdifont.h index 3c159f5057..b9143602e6 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.h +++ b/xfa/src/fgas/src/font/fx_gdifont.h @@ -31,7 +31,7 @@ public: virtual void Release();
virtual IFX_Font* Retain();
FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage);
- FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength);
+ FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t iLength);
FX_BOOL LoadFont(FX_LPCWSTR pszFileName);
FX_BOOL LoadFont(IFX_Stream *pFontStream);
FX_BOOL LoadFont(const LOGFONTW &lf);
@@ -44,23 +44,23 @@ public: {
return m_dwStyles;
}
- virtual FX_BYTE GetCharSet() const
+ virtual uint8_t GetCharSet() const
{
return m_LogFont.lfCharSet;
}
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetAscent() const;
- virtual FX_INT32 GetDescent() const;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetAscent() const;
+ virtual int32_t GetDescent() const;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE);
virtual FX_BOOL GetBBox(CFX_Rect &bbox);
- virtual FX_INT32 GetItalicAngle() const;
+ virtual int32_t GetItalicAngle() const;
virtual void Reset();
- FX_DWORD GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize);
+ FX_DWORD GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize);
FX_DWORD GetHashCode() const;
protected:
IFX_FontMgr *m_pFontMgr;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
CFX_WordDiscreteArray m_WidthCache;
OUTLINETEXTMETRICW m_OutlineTM;
HGDIOBJ m_hOldFont;
@@ -75,13 +75,13 @@ protected: CFX_MapPtrToPtr m_FontMapper;
CFX_MapPtrToPtr m_FontCache;
void ClearCache();
- FX_INT32 GetFontFamilies(Gdiplus::FontCollection &fc);
+ int32_t GetFontFamilies(Gdiplus::FontCollection &fc);
void RetrieveFontStyles();
- IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const;
- FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
+ IFX_Font* GetSubstFont(int32_t iGlyphIndex) const;
+ FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
+ int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
FX_DWORD GetMAT2HashCode(const FIXED *pFixed);
- void CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb);
+ void CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb);
friend class CFX_GdiFontMgr;
};
#endif
diff --git a/xfa/src/fgas/src/font/fx_gefont.cpp b/xfa/src/fgas/src/font/fx_gefont.cpp index f952bc730e..a67b7b47bb 100644 --- a/xfa/src/fgas/src/font/fx_gefont.cpp +++ b/xfa/src/fgas/src/font/fx_gefont.cpp @@ -24,7 +24,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX return pFont;
#endif
}
-IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr)
+IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr)
{
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
if (NULL != pFontMgr) {
@@ -138,8 +138,8 @@ CFX_GEFont::CFX_GEFont(const CFX_GEFont &src, FX_DWORD dwFontStyles) }
CFX_GEFont::~CFX_GEFont()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
pFont->Release();
}
@@ -213,7 +213,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX if (dwFontStyles & FX_FONTSTYLE_ExactMatch) {
dwFlags |= FXFONT_EXACTMATCH;
}
- FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
+ int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage);
if (wCharSet == 0xFFFF) {
wCharSet = FXSYS_GetACP();
@@ -235,7 +235,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX Unlock();
return bRet;
}
-FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length)
+FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, int32_t length)
{
if (m_pFont != NULL) {
return FALSE;
@@ -355,11 +355,11 @@ IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage ) }
return FX_NEW CFX_GEFont(*this, dwFontStyles);
}
-FX_BYTE CFX_GEFont::GetCharSet() const
+uint8_t CFX_GEFont::GetCharSet() const
{
FXSYS_assert(m_pFont != NULL);
if (m_wCharSet != 0xFFFF) {
- return (FX_BYTE)m_wCharSet;
+ return (uint8_t)m_wCharSet;
}
if (m_pFont->m_pSubstFont == NULL) {
return FX_CHARSET_Default;
@@ -405,18 +405,18 @@ FX_DWORD CFX_GEFont::GetFontStyles() const }
return dwStyles;
}
-FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode)
+FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode)
{
return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode);
}
-FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
+FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
{
FXSYS_assert (m_pCharWidthMap != NULL);
iWidth = m_pCharWidthMap->GetAt(wUnicode, 0);
if (iWidth < 1) {
if (!m_pProvider || !m_pProvider->GetCharWidth(this, wUnicode, iWidth, bCharCode)) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
iWidth = m_pFont->GetGlyphWidth(iGlyph);
@@ -431,7 +431,7 @@ FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bR }
}
Lock();
- m_pCharWidthMap->SetAtGrow(wUnicode, (FX_SHORT)iWidth);
+ m_pCharWidthMap->SetAtGrow(wUnicode, (int16_t)iWidth);
Unlock();
} else if (iWidth == 65535) {
iWidth = -1;
@@ -447,9 +447,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu FXSYS_assert(m_pRectArray != NULL);
FXSYS_assert(m_pBBoxMap != NULL);
FX_LPVOID pRect = NULL;
- if (!m_pBBoxMap->Lookup((void*)(FX_UINTPTR)wUnicode, pRect)) {
+ if (!m_pBBoxMap->Lookup((void*)(uintptr_t)wUnicode, pRect)) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
FX_RECT rtBBox;
@@ -457,9 +457,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu Lock();
CFX_Rect rt;
rt.Set(rtBBox.left, rtBBox.top, rtBBox.Width(), rtBBox.Height());
- FX_INT32 index = m_pRectArray->Add(rt);
+ int32_t index = m_pRectArray->Add(rt);
pRect = m_pRectArray->GetPtrAt(index);
- m_pBBoxMap->SetAt((void*)(FX_UINTPTR)wUnicode, pRect);
+ m_pBBoxMap->SetAt((void*)(uintptr_t)wUnicode, pRect);
Unlock();
}
} else if (((CFX_GEFont*)pFont)->GetCharBBox(wUnicode, bbox, FALSE, bCharCode)) {
@@ -485,21 +485,21 @@ FX_BOOL CFX_GEFont::GetBBox(CFX_Rect &bbox) }
return bRet;
}
-FX_INT32 CFX_GEFont::GetItalicAngle() const
+int32_t CFX_GEFont::GetItalicAngle() const
{
if (m_pFont->m_pSubstFont == NULL) {
return 0;
}
return m_pFont->m_pSubstFont->m_ItalicAngle;
}
-FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
+int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
{
return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode);
}
-FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
+int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
{
FXSYS_assert (m_pFontEncoding != NULL);
- FX_INT32 iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode);
+ int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode);
if (iGlyphIndex > 0) {
if (ppFont != NULL) {
*ppFont = (IFX_Font*)this;
@@ -515,11 +515,11 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo return 0xFFFF;
}
IFX_Font *pFont = NULL;
- m_FontMapper.Lookup((void*)(FX_UINTPTR)wUnicode, (void*&)pFont);
+ m_FontMapper.Lookup((void*)(uintptr_t)wUnicode, (void*&)pFont);
if (pFont != NULL && pFont != (IFX_Font*)this) {
iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyphIndex != 0xFFFF) {
- FX_INT32 i = m_SubstFonts.Find(pFont);
+ int32_t i = m_SubstFonts.Find(pFont);
if (i > -1) {
iGlyphIndex |= ((i + 1) << 24);
if (ppFont != NULL) {
@@ -545,8 +545,8 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo pFont->Release();
return 0xFFFF;
}
- m_FontMapper.SetAt((void*)(FX_UINTPTR)wUnicode, (void*)pFont);
- FX_INT32 i = m_SubstFonts.GetSize();
+ m_FontMapper.SetAt((void*)(uintptr_t)wUnicode, (void*)pFont);
+ int32_t i = m_SubstFonts.GetSize();
m_SubstFonts.Add(pFont);
iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyphIndex != 0xFFFF) {
@@ -560,19 +560,19 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo }
return 0xFFFF;
}
-FX_INT32 CFX_GEFont::GetAscent() const
+int32_t CFX_GEFont::GetAscent() const
{
return m_pFont->GetAscent();
}
-FX_INT32 CFX_GEFont::GetDescent() const
+int32_t CFX_GEFont::GetDescent() const
{
return m_pFont->GetDescent();
}
void CFX_GEFont::Reset()
{
Lock();
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
((CFX_GEFont*)pFont)->Reset();
}
@@ -587,7 +587,7 @@ void CFX_GEFont::Reset() }
Unlock();
}
-IFX_Font* CFX_GEFont::GetSubstFont(FX_INT32 iGlyphIndex) const
+IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const
{
iGlyphIndex = ((FX_DWORD)iGlyphIndex) >> 24;
return iGlyphIndex == 0 ? (IFX_Font*)this : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1];
diff --git a/xfa/src/fgas/src/font/fx_gefont.h b/xfa/src/fgas/src/font/fx_gefont.h index 585a04c638..e03fd8844e 100644 --- a/xfa/src/fgas/src/font/fx_gefont.h +++ b/xfa/src/fgas/src/font/fx_gefont.h @@ -20,7 +20,7 @@ public: virtual void Release();
virtual IFX_Font* Retain();
FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage);
- FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length);
+ FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t length);
FX_BOOL LoadFont(FX_LPCWSTR pszFileName);
FX_BOOL LoadFont(IFX_Stream *pFontStream, FX_BOOL bSaveStream);
FX_BOOL LoadFont(CFX_Font *pExtFont, FX_BOOL bTakeOver = FALSE);
@@ -28,16 +28,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const;
virtual void GetPsName(CFX_WideString &wsName) const;
virtual FX_DWORD GetFontStyles() const;
- virtual FX_BYTE GetCharSet() const;
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetAscent() const;
- virtual FX_INT32 GetDescent() const;
+ virtual uint8_t GetCharSet() const;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetAscent() const;
+ virtual int32_t GetDescent() const;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE);
virtual FX_BOOL GetBBox(CFX_Rect &bbox);
- virtual FX_INT32 GetItalicAngle() const;
+ virtual int32_t GetItalicAngle() const;
virtual void Reset();
- virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const;
+ virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const;
virtual void* GetDevFont()const
{
return (void*)m_pFont;
@@ -60,7 +60,7 @@ protected: #endif
CFX_Font *m_pFont;
IFX_FontMgr *m_pFontMgr;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
FX_BOOL m_bExtFont;
IFX_Stream *m_pStream;
IFX_FileRead *m_pFileRead;
@@ -74,8 +74,8 @@ protected: CFX_MapPtrToPtr m_FontMapper;
void InitFont();
FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
+ FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
+ int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
};
#endif
#endif
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp index 7f153b16d3..2f4ef2038f 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp @@ -44,7 +44,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() m_FileFonts.RemoveAll();
m_StreamFonts.RemoveAll();
m_DeriveFonts.RemoveAll();
- for (FX_INT32 i = m_Fonts.GetUpperBound(); i >= 0; i--) {
+ for (int32_t i = m_Fonts.GetUpperBound(); i >= 0; i--) {
IFX_Font *pFont = (IFX_Font*)m_Fonts[i];
if (pFont != NULL) {
pFont->Release();
@@ -56,7 +56,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw {
FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
IFX_Font *pFont = NULL;
- if (m_CPFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD;
@@ -69,14 +69,14 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontFamilyHash(pFD->wsFontFace, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
}
-IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily)
+IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily)
{
return GetDefFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily);
}
@@ -89,7 +89,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF }
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, pRet->wBitField);
IFX_Font *pFont = NULL;
- if (m_UnicodeFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_UnicodeFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, pRet->wCodePage) : NULL;
}
#ifdef _FX_USEGASFONTMGR_
@@ -109,7 +109,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF if (pBuiltinMapper == NULL) {
return NULL;
}
- FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
+ int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
int italic_angle = 0;
FXFT_Face ftFace = pBuiltinMapper->FindSubstFontByUnicode(wUnicode, dwFontStyles, iWeight, italic_angle);
if (ftFace == NULL) {
@@ -129,11 +129,11 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF #endif
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_UnicodeFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_UnicodeFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontFamilyHash(pFontFace, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
@@ -146,7 +146,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage);
IFX_Font *pFont = NULL;
- if (m_FamilyFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD = NULL;
@@ -161,14 +161,14 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
}
-IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength)
+IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
IFX_Font *pFont = NULL;
@@ -190,7 +190,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) FXSYS_assert(pszFileName != NULL);
FX_DWORD dwHash = FX_HashCode_String_GetW(pszFileName, -1);
IFX_Font *pFont = NULL;
- if (m_FileFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_FileFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
if (pFont != NULL) {
return pFont->Retain();
}
@@ -198,7 +198,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) pFont = IFX_Font::LoadFont(pszFileName, NULL);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_FileFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FileFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return pFont->Retain();
}
return NULL;
@@ -211,7 +211,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon if (pFont != NULL) {
if (pszFontAlias != NULL) {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
}
return LoadFont(pFont, dwFontStyles, wCodePage);
}
@@ -222,7 +222,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon m_StreamFonts.SetAt((void*)pFontStream, (void*)pFont);
if (pszFontAlias != NULL) {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
}
return LoadFont(pFont, dwFontStyles, wCodePage);
}
@@ -234,19 +234,19 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, if (pSrcFont->GetFontStyles() == dwFontStyles) {
return pSrcFont->Retain();
}
- void* buffer[3] = {pSrcFont, (void*)(FX_UINTPTR)dwFontStyles, (void*)(FX_UINTPTR)wCodePage};
+ void* buffer[3] = {pSrcFont, (void*)(uintptr_t)dwFontStyles, (void*)(uintptr_t)wCodePage};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)buffer, 3 * sizeof(void*));
IFX_Font *pFont = NULL;
if (m_DeriveFonts.GetCount() > 0) {
- m_DeriveFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont);
+ m_DeriveFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont);
if (pFont != NULL) {
return pFont->Retain();
}
}
pFont = pSrcFont->Derive(dwFontStyles, wCodePage);
if (pFont != NULL) {
- m_DeriveFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
- FX_INT32 index = m_Fonts.Find(pFont);
+ m_DeriveFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
+ int32_t index = m_Fonts.Find(pFont);
if (index < 0) {
m_Fonts.Add(pFont);
pFont->Retain();
@@ -257,8 +257,8 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, }
void CFX_StdFontMgrImp::ClearFontCache()
{
- FX_INT32 iCount = m_Fonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_Fonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_Fonts[i];
if (pFont != NULL) {
pFont->Reset();
@@ -289,7 +289,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font *pFont) RemoveFont(m_FileFonts, pFont);
RemoveFont(m_StreamFonts, pFont);
RemoveFont(m_DeriveFonts, pFont);
- FX_INT32 iFind = m_Fonts.Find(pFont);
+ int32_t iFind = m_Fonts.Find(pFont);
if (iFind > -1) {
m_Fonts.RemoveAt(iFind, 1);
}
@@ -319,7 +319,7 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW if (pDesc == NULL) {
return NULL;
}
- for (FX_INT32 i = m_FontFaces.GetSize() - 1; i >= 0; i--) {
+ for (int32_t i = m_FontFaces.GetSize() - 1; i >= 0; i--) {
FX_LPCFONTDESCRIPTOR pMatch = m_FontFaces.GetPtrAt(i);
if (*pMatch == *pDesc) {
return pMatch;
@@ -333,10 +333,10 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData)
{
FX_LPCFONTDESCRIPTOR pBestFont = NULL;
- FX_INT32 iBestSimilar = 0;
+ int32_t iBestSimilar = 0;
FX_BOOL bMatchStyle = (pParams->dwMatchFlags & FX_FONTMATCHPARA_MacthStyle) > 0;
- FX_INT32 iCount = fonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; ++i) {
+ int32_t iCount = fonts.GetSize();
+ for (int32_t i = 0; i < iCount; ++i) {
FX_LPCFONTDESCRIPTOR pFont = fonts.GetPtrAt(i);
if ((pFont->dwFontStyles & FX_FONTSTYLE_BoldItalic) == FX_FONTSTYLE_BoldItalic) {
continue;
@@ -377,7 +377,7 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F return pFont;
}
}
- FX_INT32 iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles);
+ int32_t iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles);
if (iBestSimilar < iSimilarValue) {
iBestSimilar = iSimilarValue;
pBestFont = pFont;
@@ -385,9 +385,9 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F }
return iBestSimilar < 1 ? NULL : pBestFont;
}
-FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles)
+int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles)
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
if ((dwFontStyles & FX_FONTSTYLE_Symbolic) == (pFont->dwFontStyles & FX_FONTSTYLE_Symbolic)) {
iValue += 64;
}
@@ -412,7 +412,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH) {
dwStyles |= FX_FONTSTYLE_FixedPitch;
}
- FX_BYTE nFamilies = lf.lfPitchAndFamily & 0xF0;
+ uint8_t nFamilies = lf.lfPitchAndFamily & 0xF0;
if (nFamilies == FF_ROMAN) {
dwStyles |= FX_FONTSTYLE_Serif;
}
@@ -424,7 +424,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) }
return dwStyles;
}
-static FX_INT32 CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
+static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
{
if (dwFontType != TRUETYPE_FONTTYPE) {
return 1;
@@ -481,7 +481,7 @@ FX_LPCSTR g_FontFolders[] = { };
CFX_FontSourceEnum_File::CFX_FontSourceEnum_File()
{
- for (FX_INT32 i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) {
+ for (int32_t i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) {
m_FolderPaths.Add(g_FontFolders[i]);
}
}
@@ -601,13 +601,13 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() pFontSource->Release();
continue;
}
- FX_INT32 nFaceCount = pFace->num_faces;
+ int32_t nFaceCount = pFace->num_faces;
ReportFace(pFace, m_InstalledFonts, pFontSource);
if (FXFT_Get_Face_External_Stream(pFace)) {
FXFT_Clear_Face_External_Stream(pFace);
}
FXFT_Done_Face(pFace);
- for (FX_INT32 i = 1; i < nFaceCount; i++) {
+ for (int32_t i = 1; i < nFaceCount; i++) {
if (NULL == (pFace = LoadFace(pFontStream, i))) {
continue;
}
@@ -624,7 +624,7 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() }
void CFX_FontMgrImp::Release()
{
- for (FX_INT32 i = 0; i < m_InstalledFonts.GetSize(); i++) {
+ for (int32_t i = 0; i < m_InstalledFonts.GetSize(); i++) {
delete m_InstalledFonts[i];
}
FX_POSITION pos = m_Hash2CandidateList.GetStartPosition();
@@ -677,7 +677,7 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFo {
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage(this, wCodePage, dwFontStyles, pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
+IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
{
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCharset(this, nCharset, dwFontStyles, pszFontFamily);
}
@@ -729,7 +729,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFontS pFonts->Add(pFont);
return pFont;
}
-IFX_Font* CFX_FontMgrImp::GetFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
+IFX_Font* CFX_FontMgrImp::GetFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
{
return GetFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily);
}
@@ -756,7 +756,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt return NULL;
}
if (0 != pFonts->GetSize()) {
- for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < pFonts->GetSize(); i++) {
if (VerifyUnicode(pFonts->GetAt(i), wUnicode)) {
return pFonts->GetAt(i)->Retain();
}
@@ -776,7 +776,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt MatchFonts(*sortedFonts, wCodePage, dwFontStyles, CFX_WideString(pszFontFamily), wUnicode);
m_Hash2CandidateList.SetAt(dwHash, sortedFonts);
}
- for (FX_INT32 i = 0; i < sortedFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < sortedFonts->GetSize(); i++) {
CFX_FontDescriptor* pDesc = sortedFonts->GetAt(i).pFont;
if (VerifyUnicode(pDesc, wUnicode)) {
pFont = LoadFont(pDesc->m_pFileAccess, pDesc->m_nFaceIndex, NULL);
@@ -846,9 +846,9 @@ IFX_Font* CFX_FontMgrImp::GetFontByLanguage( FX_WORD wLanguage, FX_DWORD dwFontS {
return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount )
+IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount )
{
- FX_LPVOID Hash[2] = {(FX_LPVOID)(FX_UINTPTR)pBuffer, (FX_LPVOID)(FX_UINTPTR)iLength};
+ FX_LPVOID Hash[2] = {(FX_LPVOID)(uintptr_t)pBuffer, (FX_LPVOID)(uintptr_t)iLength};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 2 * sizeof (FX_LPVOID));
IFX_FileAccess* pFontAccess = NULL;
if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) {
@@ -859,7 +859,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount )
+IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount )
{
CFX_ByteString bsHash;
bsHash += CFX_WideString(pszFileName).UTF8Encode();
@@ -875,9 +875,9 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream )
+IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream )
{
- FX_LPVOID Hash[1] = {(FX_LPVOID)(FX_UINTPTR)pFontStream};
+ FX_LPVOID Hash[1] = {(FX_LPVOID)(uintptr_t)pFontStream};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 1 * sizeof (FX_LPVOID));
IFX_FileAccess* pFontAccess = NULL;
if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) {
@@ -888,13 +888,13 @@ IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache )
+IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache )
{
FX_DWORD dwHash = 0;
IFX_Font* pFont = NULL;
if (bWantCache) {
CFX_ByteString bsHash;
- bsHash.Format("%d, %d", (FX_UINTPTR)pFontAccess, iFaceIndex);
+ bsHash.Format("%d, %d", (uintptr_t)pFontAccess, iFaceIndex);
dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength());
if (m_FileAccess2IFXFont.Lookup(dwHash, pFont)) {
if (NULL != pFont) {
@@ -952,7 +952,7 @@ extern "C" {
}
};
-FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, FX_INT32 iFaceIndex )
+FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, int32_t iFaceIndex )
{
FXFT_Library& library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
FXFT_Open_Args ftArgs;
@@ -991,17 +991,17 @@ BadRet: }
return NULL;
}
-FX_INT32 CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
+int32_t CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
{
MatchedFonts.RemoveAll();
CFX_WideString wsNormalizedFontName = FontName;
NormalizeFontName(wsNormalizedFontName);
- static const FX_INT32 nMax = 0xffff;
+ static const int32_t nMax = 0xffff;
CFX_FontDescriptor* pFont = NULL;
- FX_INT32 nCount = m_InstalledFonts.GetSize();
- for (FX_INT32 i = 0; i < nCount; i++) {
+ int32_t nCount = m_InstalledFonts.GetSize();
+ for (int32_t i = 0; i < nCount; i++) {
pFont = m_InstalledFonts[i];
- FX_INT32 nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode);
+ int32_t nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode);
if (nPenalty >= 0xFFFF) {
continue;
}
@@ -1092,7 +1092,7 @@ static const FX_BitCodePage g_Bit2CodePage[] = { };
FX_WORD FX_GetCodePageBit(FX_WORD wCodePage)
{
- for (FX_INT32 i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) {
+ for (int32_t i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) {
if (g_Bit2CodePage[i].wCodePage == wCodePage) {
return g_Bit2CodePage[i].wBit;
}
@@ -1107,12 +1107,12 @@ FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) }
return x->wBitField;
}
-FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
+int32_t CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
{
- FX_INT32 nPenalty = 30000;
+ int32_t nPenalty = 30000;
if (0 != FontName.GetLength()) {
if (FontName != pInstalled->m_wsFaceName) {
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) {
if (pInstalled->m_wsFamilyNames[i] == FontName) {
break;
@@ -1127,7 +1127,7 @@ FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wC nPenalty -= 30000;
}
if (30000 == nPenalty && 0 == IsPartName(pInstalled->m_wsFaceName, FontName)) {
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) {
if (0 != IsPartName(pInstalled->m_wsFamilyNames[i], FontName)) {
break;
@@ -1236,7 +1236,7 @@ void CFX_FontMgrImp::RemoveFont( IFX_Font* pEFont ) CFX_ArrayTemplate<IFX_Font*>* pFonts;
m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts);
if (NULL != pFonts) {
- for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < pFonts->GetSize(); i++) {
if (pFonts->GetAt(i) == pEFont) {
pFonts->SetAt(i, NULL);
}
@@ -1267,7 +1267,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF FT_ENC_TAG(dwTag, 'n', 'a', 'm', 'e');
unsigned int error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, NULL, &nLength);
if (0 == error && 0 != nLength) {
- pTable = FX_Alloc(FX_BYTE, nLength);
+ pTable = FX_Alloc(uint8_t, nLength);
if (NULL != pTable) {
error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, pTable, NULL);
if (0 != error) {
@@ -1285,7 +1285,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF pFont->m_nFaceIndex = pFace->face_index;
pFont->m_pFileAccess = pFontAccess->Retain();
NormalizeFontName(pFont->m_wsFaceName);
- for (FX_INT32 i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) {
+ for (int32_t i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) {
NormalizeFontName(pFont->m_wsFamilyNames[i]);
}
Fonts.Add(pFont);
@@ -1304,16 +1304,16 @@ FX_DWORD CFX_FontMgrImp::GetFlags(FXFT_Face pFace) flag |= FX_FONTSTYLE_Symbolic;
}
if (pOS2->panose[0] == 2) {
- FX_BYTE uSerif = pOS2->panose[1];
+ uint8_t uSerif = pOS2->panose[1];
if ((uSerif > 1 && uSerif < 10) || uSerif > 13) {
flag |= FX_FONTSTYLE_Serif;
}
}
return flag;
}
-#define GetUInt8(p) ((FX_UINT8)((p)[0]))
-#define GetUInt16(p) ((FX_UINT16)((p)[0] << 8 | (p)[1]))
-#define GetUInt32(p) ((FX_UINT32)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]))
+#define GetUInt8(p) ((uint8_t)((p)[0]))
+#define GetUInt16(p) ((uint16_t)((p)[0] << 8 | (p)[1]))
+#define GetUInt32(p) ((uint32_t)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]))
void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names)
{
if (NULL == name_table) {
@@ -1323,25 +1323,25 @@ void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names) CFX_WideString wsFamily;
FX_LPBYTE sp = lpTable + 2;
FX_LPBYTE lpNameRecord = lpTable + 6;
- FX_UINT16 nNameCount = GetUInt16(sp);
+ uint16_t nNameCount = GetUInt16(sp);
FX_LPBYTE lpStr = lpTable + GetUInt16(sp + 2);
- for (FX_UINT16 j = 0; j < nNameCount; j++) {
- FX_UINT16 nNameID = GetUInt16(lpNameRecord + j * 12 + 6);
+ for (uint16_t j = 0; j < nNameCount; j++) {
+ uint16_t nNameID = GetUInt16(lpNameRecord + j * 12 + 6);
if (nNameID != 1) {
continue;
}
- FX_UINT16 nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0);
- FX_UINT16 nNameLength = GetUInt16(lpNameRecord + j * 12 + 8);
- FX_UINT16 nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10);
+ uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0);
+ uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8);
+ uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10);
wsFamily.Empty();
if (nPlatformID != 1) {
- for (FX_UINT16 k = 0; k < nNameLength / 2; k++) {
+ for (uint16_t k = 0; k < nNameLength / 2; k++) {
FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2);
wsFamily += wcTemp;
}
Names.Add(wsFamily);
} else {
- for (FX_UINT16 k = 0; k < nNameLength; k++) {
+ for (uint16_t k = 0; k < nNameLength; k++) {
FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k);
wsFamily += wcTemp;
}
@@ -1429,7 +1429,7 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = { {1 << 15 , FX_CHARSET_US },
};
#define CODEPAGERANGE_IMPLEMENT(n) \
- for (FX_INT32 i = 0; i < 16; i++)\
+ for (int32_t i = 0; i < 16; i++)\
{\
if ((a##n & g_FX_Bit2Charset##n[i].wBit) != 0)\
{\
@@ -1480,7 +1480,7 @@ void CFX_FontMgrImp::NormalizeFontName( CFX_WideString& FontName ) FontName.Remove(' ');
FontName.Remove('-');
}
-FX_INT32 CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 )
+int32_t CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 )
{
if (Name1.Find((FX_LPCWSTR)Name2) != -1) {
return 1;
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/src/font/fx_stdfontmgr.h index ba44233ad0..37b0b63da0 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.h +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.h @@ -7,7 +7,7 @@ #ifndef _FX_FONTMGR_IMP
#define _FX_FONTMGR_IMP
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles);
+int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles);
FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData);
class CFX_StdFontMgrImp : public IFX_FontMgr
{
@@ -19,11 +19,11 @@ public: delete this;
}
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength);
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength);
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName);
virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE);
virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
@@ -66,7 +66,7 @@ public: }
}
IFX_FileAccess* m_pFileAccess;
- FX_INT32 m_nFaceIndex;
+ int32_t m_nFaceIndex;
CFX_WideString m_wsFaceName;
CFX_WideStringArray m_wsFamilyNames;
FX_DWORD m_dwFontStyles;
@@ -77,7 +77,7 @@ typedef CFX_ArrayTemplate<CFX_FontDescriptor*> CFX_FontDescriptors; struct FX_FontDescriptorInfo {
public:
CFX_FontDescriptor* pFont;
- FX_INT32 nPenalty;
+ int32_t nPenalty;
FX_BOOL operator > (const FX_FontDescriptorInfo& x)
{
return this->nPenalty > x.nPenalty;
@@ -133,16 +133,16 @@ public: CFX_FontMgrImp(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL);
virtual void Release();
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount);
- virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount);
- virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream = FALSE);
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount);
+ virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount);
+ virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream = FALSE);
virtual void ClearFontCache();
virtual void RemoveFont(IFX_Font* pFont);
FX_BOOL EnumFonts();
@@ -156,11 +156,11 @@ protected: FX_BOOL VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode);
FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode);
void NormalizeFontName( CFX_WideString& FontName );
- FX_INT32 IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
- FX_INT32 MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
- FX_INT32 CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
- IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache = FALSE);
- FXFT_Face LoadFace(IFX_FileRead* pFontStream, FX_INT32 iFaceIndex);
+ int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
+ int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
+ int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
+ IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache = FALSE);
+ FXFT_Face LoadFace(IFX_FileRead* pFontStream, int32_t iFaceIndex);
CFX_HashFontDescsMap m_Hash2CandidateList;
CFX_HashFontsMap m_Hash2Fonts;
CFX_HashFileMap m_Hash2FileAccess;
diff --git a/xfa/src/fgas/src/layout/fx_linebreak.cpp b/xfa/src/fgas/src/layout/fx_linebreak.cpp index 4662e1c122..dde8b8cc61 100644 --- a/xfa/src/fgas/src/layout/fx_linebreak.cpp +++ b/xfa/src/fgas/src/layout/fx_linebreak.cpp @@ -72,7 +72,7 @@ extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = { {FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN},
{FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN},
};
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength)
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength)
{
if (iLength < 2) {
return;
@@ -82,7 +82,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX wch = *pwsText ++;
dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
iLength --;
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pwsText ++;
dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
if (dwNext == FX_CBP_SP) {
@@ -94,7 +94,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX }
pBrkType[iLength] = FX_LBT_INDIRECT_BRK;
}
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp)
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp)
{
if (iLength < 2) {
return;
@@ -105,7 +105,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32Mas wch = *pwsText ++;
dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
iLength --;
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pwsText ++;
dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
if (dwNext == FX_CBP_SP) {
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp index 24c64c453b..95c9118f90 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp @@ -76,7 +76,7 @@ void CFX_RTFBreak::SetLineWidth(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) }
void CFX_RTFBreak::SetLinePos(FX_FLOAT fLinePos)
{
- FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f);
+ int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f);
if (iLinePos > m_iLineEnd) {
iLinePos = m_iLineEnd;
}
@@ -118,7 +118,7 @@ void CFX_RTFBreak::SetFont(IFX_Font *pFont) }
void CFX_RTFBreak::SetFontSize(FX_FLOAT fFontSize)
{
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
if (m_iFontSize == iFontSize) {
return;
}
@@ -139,16 +139,16 @@ void CFX_RTFBreak::SetTabWidth(FX_FLOAT fTabWidth) }
void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos)
{
- FX_INT32 iLineEnd = m_iLineEnd;
- FX_INT32 iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart;
+ int32_t iLineEnd = m_iLineEnd;
+ int32_t iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart;
if (iTabPos > iLineEnd) {
iTabPos = iLineEnd;
}
if (m_PositionedTabs.Find(iTabPos, 0) > -1) {
return;
}
- FX_INT32 iCount = m_PositionedTabs.GetSize();
- FX_INT32 iFind = 0;
+ int32_t iCount = m_PositionedTabs.GetSize();
+ int32_t iFind = 0;
for (; iFind < iCount; iFind ++) {
if (m_PositionedTabs[iFind] > iTabPos) {
break;
@@ -164,11 +164,11 @@ void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos) void CFX_RTFBreak::SetPositionedTabs(const CFX_FloatArray &tabs)
{
m_PositionedTabs.RemoveAll();
- FX_INT32 iCount = tabs.GetSize();
+ int32_t iCount = tabs.GetSize();
m_PositionedTabs.SetSize(iCount);
- FX_INT32 iLineEnd = m_iLineEnd;
- FX_INT32 iTabPos;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iLineEnd = m_iLineEnd;
+ int32_t iTabPos;
+ for (int32_t i = 0; i < iCount; i ++) {
iTabPos = FXSYS_round(tabs[i] * 20000.0f) + m_iLineStart;
if (iTabPos > iLineEnd) {
iTabPos = iLineEnd;
@@ -210,7 +210,7 @@ void CFX_RTFBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) {
m_iTolerance = FXSYS_round(fTolerance * 20000.0f);
}
-void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale)
+void CFX_RTFBreak::SetHorizontalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -221,7 +221,7 @@ void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus();
m_iHorizontalScale = iScale;
}
-void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale)
+void CFX_RTFBreak::SetVerticalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -232,7 +232,7 @@ void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale) SetBreakStatus();
m_iVerticalScale = iScale;
}
-void CFX_RTFBreak::SetCharRotation(FX_INT32 iCharRotation)
+void CFX_RTFBreak::SetCharRotation(int32_t iCharRotation)
{
if (iCharRotation < 0) {
iCharRotation += (-iCharRotation / 4 + 1) * 4;
@@ -260,7 +260,7 @@ void CFX_RTFBreak::SetReadingOrder(FX_BOOL bRTL) {
m_bRTL = bRTL;
}
-void CFX_RTFBreak::SetAlignment(FX_INT32 iAlignment)
+void CFX_RTFBreak::SetAlignment(int32_t iAlignment)
{
FXSYS_assert(iAlignment >= FX_RTFLINEALIGNMENT_Left && iAlignment <= FX_RTFLINEALIGNMENT_Distributed);
m_iAlignment = iAlignment;
@@ -279,15 +279,15 @@ void CFX_RTFBreak::SetUserData(IFX_Unknown *pUserData) m_pUserData->AddRef();
}
}
-static const FX_INT32 gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
-FX_INT32 CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const
+static const int32_t gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
+int32_t CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const
{
return gs_FX_RTFLineRotations[(dwStyles & 0x0E) >> 1];
}
void CFX_RTFBreak::SetBreakStatus()
{
m_dwIdentity ++;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 1) {
return;
}
@@ -296,15 +296,15 @@ void CFX_RTFBreak::SetBreakStatus() tc.m_dwStatus = FX_RTFBREAK_PieceBreak;
}
}
-CFX_RTFChar* CFX_RTFBreak::GetLastChar(FX_INT32 index) const
+CFX_RTFChar* CFX_RTFBreak::GetLastChar(int32_t index) const
{
CFX_RTFCharArray &tca = m_pCurLine->m_LineChars;
- FX_INT32 iCount = tca.GetSize();
+ int32_t iCount = tca.GetSize();
if (index < 0 || index >= iCount) {
return NULL;
}
CFX_RTFChar *pTC;
- FX_INT32 iStart = iCount - 1;
+ int32_t iStart = iCount - 1;
while (iStart > -1) {
pTC = tca.GetDataPtr(iStart --);
if (pTC->m_iCharWidth >= 0 || pTC->GetCharType() != FX_CHARTYPE_Combination) {
@@ -341,18 +341,18 @@ inline FX_DWORD CFX_RTFBreak::GetUnifiedCharType(FX_DWORD dwType) const {
return dwType >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : dwType;
}
-FX_INT32 CFX_RTFBreak::GetLastPositionedTab() const
+int32_t CFX_RTFBreak::GetLastPositionedTab() const
{
- FX_INT32 iCount = m_PositionedTabs.GetSize();
+ int32_t iCount = m_PositionedTabs.GetSize();
if (iCount < 1) {
return m_iLineStart;
}
return m_PositionedTabs[iCount - 1];
}
-FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const
+FX_BOOL CFX_RTFBreak::GetPositionedTab(int32_t &iTabPos) const
{
- FX_INT32 iCount = m_PositionedTabs.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_PositionedTabs.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
if (m_PositionedTabs[i] > iTabPos) {
iTabPos = m_PositionedTabs[i];
return TRUE;
@@ -360,7 +360,7 @@ FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const }
return FALSE;
}
-typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
+typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, int32_t iRotation);
static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = {
&CFX_RTFBreak::AppendChar_Others,
&CFX_RTFBreak::AppendChar_Tab,
@@ -410,14 +410,14 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) if (!m_bSingleLine && !m_bOrphanLine && m_dwCharType > 0 && m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance) {
if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) {
dwRet1 = EndBreak(FX_RTFBREAK_LineBreak);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount > 0) {
pCurChar = m_pCurLine->m_LineChars.GetDataPtr(iCount - 1);
}
}
}
}
- FX_INT32 iRotation = m_iRotation;
+ int32_t iRotation = m_iRotation;
if (m_bVertical && (dwProps & 0x8000) != 0) {
iRotation = (iRotation + 1) % 4;
}
@@ -448,7 +448,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) m_pUserData->AddRef();
}
pCurChar->m_pUserData = m_pUserData;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(m_iRotation)) {
iCharWidth = 1000;
} else {
@@ -467,9 +467,9 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation)
{
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else {
@@ -491,15 +491,15 @@ FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iR }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation)
{
if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ExpandTab) {
FX_BOOL bBreak = FALSE;
if ((m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0) {
bBreak = (m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance);
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = iLineWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = iLineWidth;
if (GetPositionedTab(iCharWidth)) {
iCharWidth -= iLineWidth;
} else {
@@ -513,7 +513,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation) }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation)
{
FX_DWORD dwRet2 = FX_RTFBREAK_None;
if (!m_bSingleLine) {
@@ -540,11 +540,11 @@ FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotat }
return dwRet2;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation)
{
CFX_RTFChar *pLastChar = NULL;
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = 0;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = 0;
FX_WCHAR wForm;
FX_BOOL bAlef = FALSE;
if (m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) {
@@ -554,7 +554,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati CFX_RTFChar *pPrevChar = GetLastChar(2);
wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
- FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
+ int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) {
iLastRotation ++;
}
@@ -592,7 +592,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation)
{
FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK);
FX_WCHAR wForm;
@@ -607,7 +607,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotati } else {
wForm = pCurChar->m_wCharCode;
}
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else {
@@ -634,7 +634,7 @@ FX_DWORD CFX_RTFBreak::EndBreak(FX_DWORD dwStatus) FXSYS_assert(dwStatus >= FX_RTFBREAK_PieceBreak && dwStatus <= FX_RTFBREAK_PageBreak);
m_dwIdentity ++;
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iCount = pCurPieces->GetSize();
if (iCount > 0) {
CFX_RTFPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount);
if (dwStatus > FX_RTFBREAK_PieceBreak) {
@@ -723,8 +723,8 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha tp.m_pChars = &m_pCurLine->m_LineChars;
FX_BOOL bNew = TRUE;
FX_DWORD dwIdentity = (FX_DWORD) - 1;
- FX_INT32 iLast = m_pCurLine->CountChars() - 1, j = 0;
- for (FX_INT32 i = 0; i <= iLast;) {
+ int32_t iLast = m_pCurLine->CountChars() - 1, j = 0;
+ for (int32_t i = 0; i <= iLast;) {
pTC = pCurChars + i;
if (bNew) {
tp.m_iStartChar = i;
@@ -760,7 +760,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha return TRUE;
}
if (bAllChars && !bDone) {
- FX_INT32 iEndPos = m_pCurLine->GetLineEnd();
+ int32_t iEndPos = m_pCurLine->GetLineEnd();
GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, TRUE);
}
return FALSE;
@@ -770,12 +770,12 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) FX_TPO tpo;
CFX_RTFPiece tp;
CFX_RTFChar *pTC;
- FX_INT32 i, j;
+ int32_t i, j;
CFX_RTFCharArray &chars = m_pCurLine->m_LineChars;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = (!m_bPagination && !m_bCharCode && (m_pCurLine->m_iArabicChars > 0 || m_bRTL));
if (bDone) {
- FX_INT32 iBidiNum = 0;
+ int32_t iBidiNum = 0;
for (i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
pTC->m_iBidiPos = i;
@@ -799,7 +799,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_iStartPos = m_pCurLine->m_iStart;
tp.m_pChars = &chars;
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iBidiLevel = -1, iCharWidth;
+ int32_t iBidiLevel = -1, iCharWidth;
FX_DWORD dwIdentity = (FX_DWORD) - 1;
i = j = 0;
while (i < iCount) {
@@ -851,7 +851,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (!m_bCharCode) {
j = tpos.GetSize() - 1;
FX_TEXTLAYOUT_PieceSort(tpos, 0, j);
- FX_INT32 iStartPos = m_pCurLine->m_iStart;
+ int32_t iStartPos = m_pCurLine->m_iStart;
for (i = 0; i <= j; i ++) {
tpo = tpos.GetAt(i);
CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -863,11 +863,11 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
+ int32_t iCount = pCurPieces->GetSize();
FX_BOOL bFind = FALSE;
FX_DWORD dwCharType;
- FX_INT32 i, j;
+ int32_t i, j;
FX_TPO tpo;
for (i = iCount - 1; i > -1; i --) {
tpo = tpos.GetAt(i);
@@ -904,11 +904,11 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break;
}
}
- FX_INT32 iOffset = m_iLineEnd - iNetWidth;
- FX_INT32 iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask);
- FX_INT32 iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask);
+ int32_t iOffset = m_iLineEnd - iNetWidth;
+ int32_t iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask);
+ int32_t iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask);
if (iGapChars > 0 && (iHigherAlignment == FX_RTFLINEALIGNMENT_Distributed || (iHigherAlignment == FX_RTFLINEALIGNMENT_Justified && dwStatus != FX_RTFBREAK_ParagraphBreak))) {
- FX_INT32 iStart = -1;
+ int32_t iStart = -1;
for (i = 0; i < iCount; i ++) {
tpo = tpos.GetAt(i);
CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -917,7 +917,7 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else {
ttp.m_iStartPos = iStart;
}
- FX_INT32 k;
+ int32_t k;
for (j = 0; j < ttp.m_iChars; j ++) {
CFX_RTFChar &tc = ttp.GetChar(j);
if (tc.m_nBreakType != FX_LBT_DIRECT_BRK || tc.m_iCharWidth < 0) {
@@ -946,13 +946,13 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ }
}
}
-FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
+int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
{
- FX_INT32 iLength = tca.GetSize() - 1;
+ int32_t iLength = tca.GetSize() - 1;
if (iLength < 1) {
return iLength;
}
- FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
+ int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
if (m_bSingleLine || m_bOrphanLine || iEndPos <= m_iLineEnd) {
if (!bAllChars || m_bCharCode) {
return iLength;
@@ -963,7 +963,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ CFX_RTFChar *pCharArray = tca.GetData();
if (m_bCharCode) {
const CFX_RTFChar *pChar;
- FX_INT32 iCharWidth;
+ int32_t iCharWidth;
while (iLength > 0) {
if (iEndPos <= m_iLineEnd) {
break;
@@ -988,7 +988,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ }
nCodeProp = pCur->m_dwCharProps;
nNext = nCodeProp & 0x003F;
- FX_INT32 iCharWidth = pCur->m_iCharWidth;
+ int32_t iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0) {
iEndPos -= iCharWidth;
}
@@ -1076,13 +1076,13 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, FX_BOOL bAllChars)
{
FXSYS_assert(pCurLine != NULL && pNextLine != NULL);
- FX_INT32 iCount = pCurLine->CountChars();
+ int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 iEndPos = pCurLine->GetLineEnd();
+ int32_t iEndPos = pCurLine->GetLineEnd();
CFX_RTFCharArray &curChars = pCurLine->m_LineChars;
- FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
if (iCharPos < 0) {
iCharPos = 0;
}
@@ -1107,7 +1107,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_nBreakType = FX_LBT_UNKNOWN;
iCount = nextChars.GetSize();
CFX_RTFChar *pNextChars = nextChars.GetData();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
CFX_RTFChar* tc = pNextChars + i;
if (tc->GetCharType() >= FX_CHARTYPE_ArabicAlef) {
pCurLine->m_iArabicChars --;
@@ -1120,7 +1120,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_dwStatus = 0;
}
}
-FX_INT32 CFX_RTFBreak::CountBreakPieces() const
+int32_t CFX_RTFBreak::CountBreakPieces() const
{
CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE);
if (pRTFPieces == NULL) {
@@ -1128,7 +1128,7 @@ FX_INT32 CFX_RTFBreak::CountBreakPieces() const }
return pRTFPieces->GetSize();
}
-const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(FX_INT32 index) const
+const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const
{
CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE);
if (pRTFPieces == NULL) {
@@ -1151,16 +1151,16 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF &rect) const rect.left = ((FX_FLOAT)pRTFLine->m_iStart) / 20000.0f;
rect.width = ((FX_FLOAT)pRTFLine->m_iWidth) / 20000.0f;
CFX_RTFPieceArray &rtfPieces = pRTFLine->m_LinePieces;
- FX_INT32 iCount = rtfPieces.GetSize();
+ int32_t iCount = rtfPieces.GetSize();
if (iCount < 1) {
rect.width = 0;
return;
}
CFX_RTFPiece *pBreakPiece;
- FX_INT32 iLineHeight = 0, iMax;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iLineHeight = 0, iMax;
+ for (int32_t i = 0; i < iCount; i ++) {
pBreakPiece = rtfPieces.GetPtrAt(i);
- FX_INT32 iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f);
+ int32_t iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f);
iMax = FX_MAX(pBreakPiece->m_iFontSize, iFontHeight);
if (i == 0) {
iLineHeight = iMax;
@@ -1184,24 +1184,24 @@ void CFX_RTFBreak::Reset() m_RTFLine1.RemoveAll(TRUE);
m_RTFLine2.RemoveAll(TRUE);
}
-FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
+int32_t CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
{
if (pText == NULL || pText->iLength < 1) {
return 0;
}
FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL);
FX_LPCWSTR pStr = pText->pStr;
- FX_INT32 *pWidths = pText->pWidths;
- FX_INT32 iLength = pText->iLength - 1;
+ int32_t *pWidths = pText->pWidths;
+ int32_t iLength = pText->iLength - 1;
IFX_Font *pFont = pText->pFont;
FX_DWORD dwStyles = pText->dwLayoutStyles;
CFX_RectF rtText(*pText->pRect);
FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
- FX_INT32 iAscent = pFont->GetAscent();
- FX_INT32 iDescent = pFont->GetDescent();
- FX_INT32 iMaxHeight = iAscent - iDescent;
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iAscent = pFont->GetAscent();
+ int32_t iDescent = pFont->GetDescent();
+ int32_t iMaxHeight = iAscent - iDescent;
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
@@ -1209,13 +1209,13 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh FX_BOOL bVerticalChar = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalChars) != 0;
FX_BOOL bArabicNumber = (dwStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) != 0;
FX_BOOL bMBCSCode = (dwStyles & FX_RTFLAYOUTSTYLE_MBCSCode) != 0;
- FX_INT32 iRotation = GetLineRotation(dwStyles) + pText->iCharRotation;
- FX_INT32 iCharRotation;
+ int32_t iRotation = GetLineRotation(dwStyles) + pText->iCharRotation;
+ int32_t iCharRotation;
FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm;
- FX_INT32 iWidth, iCharWidth, iCharHeight;
+ int32_t iWidth, iCharWidth, iCharHeight;
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
- FX_INT32 iHorScale = pText->iHorizontalScale;
- FX_INT32 iVerScale = pText->iVerticalScale;
+ int32_t iHorScale = pText->iHorizontalScale;
+ int32_t iVerScale = pText->iVerticalScale;
FX_BOOL bEmptyChar;
FX_DWORD dwProps, dwCharType;
fX = rtText.left;
@@ -1231,8 +1231,8 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh }
fY += fAscent;
}
- FX_INT32 iCount = 0;
- for (FX_INT32 i = 0; i <= iLength; i ++) {
+ int32_t iCount = 0;
+ for (int32_t i = 0; i <= iLength; i ++) {
wch = *pStr ++;
iWidth = *pWidths ++;
if (!bMBCSCode) {
@@ -1417,19 +1417,19 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh }
return iCount;
}
-FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
+int32_t CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
{
if (pText == NULL || pText->iLength < 1) {
return 0;
}
FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL);
FX_LPCWSTR pStr = pText->pStr;
- FX_INT32 *pWidths = pText->pWidths;
- FX_INT32 iLength = pText->iLength;
+ int32_t *pWidths = pText->pWidths;
+ int32_t iLength = pText->iLength;
CFX_RectF rect(*pText->pRect);
FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
IFX_Font *pFont = pText->pFont;
if (pFont == NULL) {
@@ -1450,14 +1450,14 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr FX_BOOL bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0;
FX_BOOL bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pText->wLineBreakChar;
- FX_INT32 iCharSize;
+ int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
if (bVertical) {
fStart = bRTLPiece ? rect.bottom() : rect.top;
} else {
fStart = bRTLPiece ? rect.right() : rect.left;
}
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pStr ++;
iCharSize = *pWidths ++;
fCharSize = (FX_FLOAT)iCharSize / 20000.0f;
@@ -1489,7 +1489,7 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr rect.width = fCharSize;
}
if (bCharBBox && !bRet) {
- FX_INT32 iCharWidth = 1000;
+ int32_t iCharWidth = 1000;
pFont->GetCharWidth(wch, iCharWidth);
FX_FLOAT fRTLeft = 0, fCharWidth = 0;
if (iCharWidth > 0) {
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.h b/xfa/src/fgas/src/layout/fx_rtfbreak.h index c8f69277da..394d433412 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.h +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.h @@ -22,35 +22,35 @@ public: {
RemoveAll();
}
- FX_INT32 CountChars() const
+ int32_t CountChars() const
{
return m_LineChars.GetSize();
}
- CFX_RTFChar& GetChar(FX_INT32 index)
+ CFX_RTFChar& GetChar(int32_t index)
{
FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
return *m_LineChars.GetDataPtr(index);
}
- CFX_RTFChar* GetCharPtr(FX_INT32 index)
+ CFX_RTFChar* GetCharPtr(int32_t index)
{
FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
return m_LineChars.GetDataPtr(index);
}
- FX_INT32 CountPieces() const
+ int32_t CountPieces() const
{
return m_LinePieces.GetSize();
}
- CFX_RTFPiece& GetPiece(FX_INT32 index) const
+ CFX_RTFPiece& GetPiece(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
return m_LinePieces.GetAt(index);
}
- CFX_RTFPiece* GetPiecePtr(FX_INT32 index) const
+ CFX_RTFPiece* GetPiecePtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
return m_LinePieces.GetPtrAt(index);
}
- FX_INT32 GetLineEnd() const
+ int32_t GetLineEnd() const
{
return m_iStart + m_iWidth;
}
@@ -58,8 +58,8 @@ public: {
CFX_RTFChar *pChar;
IFX_Unknown *pUnknown;
- FX_INT32 iCount = m_LineChars.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_LineChars.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
pChar = m_LineChars.GetDataPtr(i);
if ((pUnknown = pChar->m_pUserData) != NULL) {
pUnknown->Release();
@@ -73,10 +73,10 @@ public: }
CFX_RTFCharArray m_LineChars;
CFX_RTFPieceArray m_LinePieces;
- FX_INT32 m_iStart;
- FX_INT32 m_iWidth;
- FX_INT32 m_iArabicChars;
- FX_INT32 m_iMBCSChars;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
+ int32_t m_iMBCSChars;
};
class CFX_RTFBreak : public IFX_RTFBreak
{
@@ -103,75 +103,75 @@ public: virtual void SetDefaultChar(FX_WCHAR wch);
virtual void SetLineBreakChar(FX_WCHAR wch);
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void SetHorizontalScale(FX_INT32 iScale);
- virtual void SetVerticalScale(FX_INT32 iScale);
- virtual void SetCharRotation(FX_INT32 iCharRotation);
+ virtual void SetHorizontalScale(int32_t iScale);
+ virtual void SetVerticalScale(int32_t iScale);
+ virtual void SetCharRotation(int32_t iCharRotation);
virtual void SetCharSpace(FX_FLOAT fCharSpace);
virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace);
virtual void SetReadingOrder(FX_BOOL bRTL = FALSE);
- virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left);
+ virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left);
virtual void SetUserData(IFX_Unknown *pUserData);
virtual FX_DWORD AppendChar(FX_WCHAR wch);
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak);
- virtual FX_INT32 CountBreakPieces() const;
- virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const;
+ virtual int32_t CountBreakPieces() const;
+ virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const;
virtual void GetLineRect(CFX_RectF &rect) const;
virtual void ClearBreakPieces();
virtual void Reset();
- virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
- virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
+ virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
FX_DWORD AppendChar_CharCode(FX_WCHAR wch);
- FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
+ FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation);
protected:
FX_DWORD m_dwPolicies;
IFX_ArabicChar *m_pArabicChar;
- FX_INT32 m_iLineStart;
- FX_INT32 m_iLineEnd;
+ int32_t m_iLineStart;
+ int32_t m_iLineEnd;
FX_DWORD m_dwLayoutStyles;
FX_BOOL m_bPagination;
FX_BOOL m_bVertical;
FX_BOOL m_bSingleLine;
FX_BOOL m_bCharCode;
IFX_Font *m_pFont;
- FX_INT32 m_iFontHeight;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iTabWidth;
+ int32_t m_iFontHeight;
+ int32_t m_iFontSize;
+ int32_t m_iTabWidth;
CFX_Int32Array m_PositionedTabs;
FX_BOOL m_bOrphanLine;
FX_WCHAR m_wDefChar;
- FX_INT32 m_iDefChar;
+ int32_t m_iDefChar;
FX_WCHAR m_wLineBreakChar;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
- FX_INT32 m_iLineRotation;
- FX_INT32 m_iCharRotation;
- FX_INT32 m_iRotation;
- FX_INT32 m_iCharSpace;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iCharSpace;
FX_BOOL m_bWordSpace;
- FX_INT32 m_iWordSpace;
+ int32_t m_iWordSpace;
FX_BOOL m_bRTL;
- FX_INT32 m_iAlignment;
+ int32_t m_iAlignment;
IFX_Unknown *m_pUserData;
FX_DWORD m_dwCharType;
FX_DWORD m_dwIdentity;
CFX_RTFLine m_RTFLine1;
CFX_RTFLine m_RTFLine2;
CFX_RTFLine *m_pCurLine;
- FX_INT32 m_iReady;
- FX_INT32 m_iTolerance;
- FX_INT32 GetLineRotation(FX_DWORD dwStyles) const;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
void SetBreakStatus();
- CFX_RTFChar* GetLastChar(FX_INT32 index) const;
+ CFX_RTFChar* GetLastChar(int32_t index) const;
CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const;
CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const;
FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
- FX_INT32 GetLastPositionedTab() const;
- FX_BOOL GetPositionedTab(FX_INT32 &iTabPos) const;
- FX_INT32 GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
+ int32_t GetLastPositionedTab() const;
+ FX_BOOL GetPositionedTab(int32_t &iTabPos) const;
+ int32_t GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
void SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, FX_BOOL bAllChars = FALSE);
FX_BOOL EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus);
void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus);
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.cpp b/xfa/src/fgas/src/layout/fx_textbreak.cpp index 0bb7b69585..80d56c7191 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_textbreak.cpp @@ -78,7 +78,7 @@ void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) }
void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos)
{
- FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f);
+ int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f);
if (iLinePos < 0) {
iLinePos = 0;
}
@@ -120,7 +120,7 @@ void CFX_TxtBreak::SetFont(IFX_Font *pFont) }
void CFX_TxtBreak::SetFontSize(FX_FLOAT fFontSize)
{
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
if (m_iFontSize == iFontSize) {
return;
}
@@ -164,7 +164,7 @@ void CFX_TxtBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) {
m_iTolerance = FXSYS_round(fTolerance * 20000.0f);
}
-void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation)
+void CFX_TxtBreak::SetCharRotation(int32_t iCharRotation)
{
if (iCharRotation < 0) {
iCharRotation += (-iCharRotation / 4 + 1) * 4;
@@ -179,7 +179,7 @@ void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation) m_iRotation = m_iLineRotation + m_iCharRotation;
m_iRotation %= 4;
}
-void CFX_TxtBreak::SetAlignment(FX_INT32 iAlignment)
+void CFX_TxtBreak::SetAlignment(int32_t iAlignment)
{
FXSYS_assert(iAlignment >= FX_TXTLINEALIGNMENT_Left && iAlignment <= FX_TXTLINEALIGNMENT_Distributed);
m_iAlignment = iAlignment;
@@ -229,7 +229,7 @@ void CFX_TxtBreak::SetBreakStatus() if (m_bPagination) {
return;
}
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 1) {
return;
}
@@ -238,7 +238,7 @@ void CFX_TxtBreak::SetBreakStatus() pTC->m_dwStatus = FX_TXTBREAK_PieceBreak;
}
}
-void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale)
+void CFX_TxtBreak::SetHorizontalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -249,7 +249,7 @@ void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus();
m_iHorScale = iScale;
}
-void CFX_TxtBreak::SetVerticalScale(FX_INT32 iScale)
+void CFX_TxtBreak::SetVerticalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -264,20 +264,20 @@ void CFX_TxtBreak::SetCharSpace(FX_FLOAT fCharSpace) {
m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f);
}
-static const FX_INT32 gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
-FX_INT32 CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const
+static const int32_t gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
+int32_t CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const
{
return gs_FX_TxtLineRotations[(dwStyles & 0x0E) >> 1];
}
-CFX_TxtChar* CFX_TxtBreak::GetLastChar(FX_INT32 index, FX_BOOL bOmitChar) const
+CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const
{
CFX_TxtCharArray &ca = *m_pCurLine->m_pLineChars;
- FX_INT32 iCount = ca.GetSize();
+ int32_t iCount = ca.GetSize();
if (index < 0 || index >= iCount) {
return NULL;
}
CFX_TxtChar *pTC;
- FX_INT32 iStart = iCount - 1;
+ int32_t iStart = iCount - 1;
while (iStart > -1) {
pTC = ca.GetDataPtr(iStart --);
if (bOmitChar && pTC->GetCharType() == FX_CHARTYPE_Combination) {
@@ -346,8 +346,8 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) ((CFX_TxtChar*)pCurChar)->m_pUserData = m_pUserData;
}
if (m_bArabicContext || m_bArabicShapes) {
- FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
- FX_INT32 iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1);
+ int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
+ int32_t iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1);
if (iArabicContext != m_iArabicContext && iArabicContext != 1) {
m_iArabicContext = iArabicContext;
if (m_iCurArabicContext == 1) {
@@ -364,12 +364,12 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) }
pCurChar->m_dwCharStyles = m_dwContextCharStyles;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation)
{
FXSYS_assert(pCurChar != NULL);
FX_WCHAR wch = pCurChar->m_wCharCode;
FX_WCHAR wForm;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
CFX_Char *pLastChar;
pCurChar->m_iCharWidth = -1;
if (m_bCombText) {
@@ -412,14 +412,14 @@ FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRota pCurChar->m_iCharWidth = -iCharWidth;
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation)
{
m_dwCharType = FX_CHARTYPE_Tab;
if ((m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ExpandTab) == 0) {
return FX_TXTBREAK_None;
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth;
if (m_bCombText) {
iCharWidth = m_iCombWidth;
} else {
@@ -440,7 +440,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation)
{
m_dwCharType = FX_CHARTYPE_Control;
FX_DWORD dwRet = FX_TXTBREAK_None;
@@ -469,12 +469,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation }
return dwRet;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation)
{
FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK);
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
FX_WCHAR wForm;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
CFX_Char *pLastChar = NULL;
FX_BOOL bAlef = FALSE;
if (!m_bCombText && m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) {
@@ -487,7 +487,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) CFX_Char *pPrevChar = GetLastChar(2);
wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
- FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
+ int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) {
iLastRotation ++;
}
@@ -530,12 +530,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation)
{
FX_DWORD dwProps = pCurChar->m_dwCharProps;
FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK);
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = 0;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = 0;
m_dwCharType = dwType;
FX_WCHAR wch = pCurChar->m_wCharCode;
FX_WCHAR wForm = wch;
@@ -572,7 +572,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, FX_INT32 iRotation);
+typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, int32_t iRotation);
static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = {
&CFX_TxtBreak::AppendChar_Others,
&CFX_TxtBreak::AppendChar_Tab,
@@ -615,14 +615,14 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) if (m_dwCharType > 0 && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance && !m_bSingleLine) {
if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) {
dwRet1 = EndBreak(FX_TXTBREAK_LineBreak);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount > 0) {
pCurChar = m_pCurLine->m_pLineChars->GetDataPtr(iCount - 1);
}
}
}
}
- FX_INT32 iRotation = m_iRotation;
+ int32_t iRotation = m_iRotation;
if (m_bVertical && (dwProps & 0x8000) != 0) {
iRotation = (iRotation + 1) % 4;
}
@@ -632,18 +632,18 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) void CFX_TxtBreak::EndBreak_UpdateArabicShapes()
{
FXSYS_assert(m_bArabicShapes);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
CFX_Char *pCur, *pNext;
pCur = m_pCurLine->GetCharPtr(0);
FX_BOOL bPrevNum = (pCur->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0;
pCur = m_pCurLine->GetCharPtr(1);
FX_WCHAR wch, wForm;
FX_BOOL bNextNum;
- FX_INT32 i = 1, iCharWidth, iRotation;
+ int32_t i = 1, iCharWidth, iRotation;
do {
i ++;
if (i < iCount) {
@@ -683,7 +683,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() }
FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = FALSE;
CFX_Char *pTC;
if (!m_bSingleLine && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance) {
@@ -725,7 +725,7 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllCha return TRUE;
}
if (bAllChars && !bDone) {
- FX_INT32 iEndPos = m_pCurLine->m_iWidth;
+ int32_t iEndPos = m_pCurLine->m_iWidth;
GetBreakPos(*m_pCurLine->m_pLineChars, iEndPos, bAllChars, TRUE);
}
return FALSE;
@@ -735,12 +735,12 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) CFX_TxtPiece tp;
FX_TPO tpo;
CFX_TxtChar *pTC;
- FX_INT32 i, j;
+ int32_t i, j;
CFX_TxtCharArray &chars = *m_pCurLine->m_pLineChars;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = (m_pCurLine->m_iArabicChars > 0 || m_bCurRTL);
if (!m_bPagination && bDone) {
- FX_INT32 iBidiNum = 0;
+ int32_t iBidiNum = 0;
for (i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
pTC->m_iBidiPos = i;
@@ -758,7 +758,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_dwStatus = FX_TXTBREAK_PieceBreak;
tp.m_iStartPos = m_pCurLine->m_iStart;
tp.m_pChars = m_pCurLine->m_pLineChars;
- FX_INT32 iBidiLevel = -1, iCharWidth;
+ int32_t iBidiLevel = -1, iCharWidth;
i = 0, j = -1;
while (i < iCount) {
pTC = chars.GetDataPtr(i);
@@ -809,7 +809,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (j > -1) {
if (j > 0) {
FX_TEXTLAYOUT_PieceSort(tpos, 0, j);
- FX_INT32 iStartPos = 0;
+ int32_t iStartPos = 0;
for (i = 0; i <= j; i ++) {
tpo = tpos.GetAt(i);
CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -840,9 +840,9 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) }
void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
- FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
+ int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces;
- FX_INT32 i, j, iCount = pCurPieces->GetSize();
+ int32_t i, j, iCount = pCurPieces->GetSize();
FX_BOOL bFind = FALSE;
FX_TPO tpo;
CFX_TxtChar *pTC;
@@ -882,11 +882,11 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break;
}
}
- FX_INT32 iOffset = m_iLineWidth - iNetWidth;
- FX_INT32 iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask);
- FX_INT32 iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask);
+ int32_t iOffset = m_iLineWidth - iNetWidth;
+ int32_t iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask);
+ int32_t iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask);
if (iGapChars > 0 && (iHigherAlignment == FX_TXTLINEALIGNMENT_Distributed || (iHigherAlignment == FX_TXTLINEALIGNMENT_Justified && dwStatus != FX_TXTBREAK_ParagraphBreak))) {
- FX_INT32 iStart = -1;
+ int32_t iStart = -1;
for (i = 0; i < iCount; i ++) {
tpo = tpos.GetAt(i);
CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -895,7 +895,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else {
ttp.m_iStartPos = iStart;
}
- FX_INT32 k;
+ int32_t k;
for (j = 0; j < ttp.m_iChars; j ++) {
pTC = ttp.GetCharPtr(j);
if (pTC->m_nBreakType != FX_LBT_DIRECT_BRK || pTC->m_iCharWidth < 0) {
@@ -928,7 +928,7 @@ FX_DWORD CFX_TxtBreak::EndBreak(FX_DWORD dwStatus) {
FXSYS_assert(dwStatus >= FX_TXTBREAK_PieceBreak && dwStatus <= FX_TXTBREAK_PageBreak);
CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iCount = pCurPieces->GetSize();
if (iCount > 0) {
CFX_TxtPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount);
if (dwStatus > FX_TXTBREAK_PieceBreak) {
@@ -990,13 +990,13 @@ EndBreak_Ret: }
return dwStatus;
}
-FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
+int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
{
- FX_INT32 iLength = ca.GetSize() - 1;
+ int32_t iLength = ca.GetSize() - 1;
if (iLength < 1) {
return iLength;
}
- FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
+ int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
if (m_bSingleLine || iEndPos <= m_iLineWidth) {
if (!bAllChars) {
return iLength;
@@ -1014,7 +1014,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B }
nCodeProp = pCur->m_dwCharProps;
nNext = nCodeProp & 0x003F;
- FX_INT32 iCharWidth = pCur->m_iCharWidth;
+ int32_t iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0) {
iEndPos -= iCharWidth;
}
@@ -1038,7 +1038,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B }
}
if (bAllChars) {
- pCur->m_nBreakType = (FX_BYTE)eType;
+ pCur->m_nBreakType = (uint8_t)eType;
}
if (!bOnlyBrk) {
if (m_bSingleLine || iEndPos <= m_iLineWidth || (nCur == FX_CBP_SP && !bSpaceBreak)) {
@@ -1085,13 +1085,13 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars)
{
FXSYS_assert(pCurLine != NULL && pNextLine != NULL);
- FX_INT32 iCount = pCurLine->CountChars();
+ int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 iEndPos = pCurLine->m_iWidth;
+ int32_t iEndPos = pCurLine->m_iWidth;
CFX_TxtCharArray &curChars = *pCurLine->m_pLineChars;
- FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
if (iCharPos < 0) {
iCharPos = 0;
}
@@ -1113,8 +1113,8 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, CFX_TxtChar *pTC = curChars.GetDataPtr(iCharPos - 1);
pTC->m_nBreakType = FX_LBT_UNKNOWN;
iCount = nextChars.GetSize();
- FX_INT32 iCharWidth, iWidth = 0;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCharWidth, iWidth = 0;
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = nextChars.GetDataPtr(i);
if (pTC->GetCharType() >= FX_CHARTYPE_ArabicAlef) {
pCurLine->m_iArabicChars --;
@@ -1131,12 +1131,12 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, }
pNextLine->m_iWidth = iWidth;
}
-FX_INT32 CFX_TxtBreak::CountBreakChars() const
+int32_t CFX_TxtBreak::CountBreakChars() const
{
CFX_TxtLine *pTxtLine = GetTxtLine(TRUE);
return pTxtLine == NULL ? 0 : pTxtLine->CountChars();
}
-FX_INT32 CFX_TxtBreak::CountBreakPieces() const
+int32_t CFX_TxtBreak::CountBreakPieces() const
{
CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE);
if (pTxtPieces == NULL) {
@@ -1144,7 +1144,7 @@ FX_INT32 CFX_TxtBreak::CountBreakPieces() const }
return pTxtPieces->GetSize();
}
-const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(FX_INT32 index) const
+const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const
{
CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE);
if (pTxtPieces == NULL) {
@@ -1174,10 +1174,10 @@ void CFX_TxtBreak::Reset() typedef struct _FX_FORMCHAR {
FX_WORD wch;
FX_WORD wForm;
- FX_INT32 iWidth;
+ int32_t iWidth;
} FX_FORMCHAR, * FX_LPFORMCHAR;
typedef FX_FORMCHAR const * FX_LPCFORMCHAR;
-FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
+int32_t CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
{
if (pTxtRun == NULL || pTxtRun->iLength < 1) {
return 0;
@@ -1185,8 +1185,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar IFX_TxtAccess *pAccess = pTxtRun->pAccess;
FX_LPVOID pIdentity = pTxtRun->pIdentity;
FX_LPCWSTR pStr = pTxtRun->pStr;
- FX_INT32 *pWidths = pTxtRun->pWidths;
- FX_INT32 iLength = pTxtRun->iLength - 1;
+ int32_t *pWidths = pTxtRun->pWidths;
+ int32_t iLength = pTxtRun->iLength - 1;
IFX_Font *pFont = pTxtRun->pFont;
FX_DWORD dwStyles = pTxtRun->dwStyles;
CFX_RectF rtText(*pTxtRun->pRect);
@@ -1194,22 +1194,22 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar FX_BOOL bArabicNumber = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicNumber) != 0;
FX_BOOL bArabicComma = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicComma) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
- FX_INT32 iAscent = pFont->GetAscent();
- FX_INT32 iDescent = pFont->GetDescent();
- FX_INT32 iMaxHeight = iAscent - iDescent;
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iAscent = pFont->GetAscent();
+ int32_t iDescent = pFont->GetDescent();
+ int32_t iMaxHeight = iAscent - iDescent;
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
FX_BOOL bVerticalDoc = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
FX_BOOL bVerticalChar = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0;
- FX_INT32 iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation;
- FX_INT32 iCharRotation;
+ int32_t iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation;
+ int32_t iCharRotation;
FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm, wLast = 0xFEFF;
- FX_INT32 iWidth, iCharWidth, iCharHeight;
+ int32_t iWidth, iCharWidth, iCharHeight;
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
- FX_INT32 iHorScale = pTxtRun->iHorizontalScale;
- FX_INT32 iVerScale = pTxtRun->iVerticalScale;
+ int32_t iHorScale = pTxtRun->iHorizontalScale;
+ int32_t iVerScale = pTxtRun->iVerticalScale;
FX_BOOL bSkipSpace = pTxtRun->bSkipSpace;
FX_BOOL bEmptyChar, bShadda = FALSE, bLam = FALSE;
FX_DWORD dwProps, dwCharType;
@@ -1227,8 +1227,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar fYBase = rtText.top + (rtText.height - fFontSize) / 2.0f;
fY = fYBase + fAscent;
}
- FX_INT32 iCount = 0, iNext, iForms;
- for (FX_INT32 i = 0; i <= iLength; i ++) {
+ int32_t iCount = 0, iNext, iForms;
+ for (int32_t i = 0; i <= iLength; i ++) {
if (pAccess != NULL) {
wch = pAccess->GetChar(pIdentity, i);
iWidth = pAccess->GetWidth(pIdentity, i);
@@ -1259,7 +1259,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar wNext = 0xFEFF;
}
} else {
- FX_INT32 j = -1;
+ int32_t j = -1;
do {
j ++;
if (i + j >= iLength) {
@@ -1386,7 +1386,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pFont->GetCharWidth(0x0670, iCharWidth, FALSE);
formChars[2].iWidth = iCharWidth;
}
- for (FX_INT32 j = 0; j < iForms; j ++) {
+ for (int32_t j = 0; j < iForms; j ++) {
wForm = (FX_WCHAR)formChars[j].wForm;
iCharWidth = formChars[j].iWidth;
if (j > 0) {
@@ -1421,7 +1421,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pCharPos->m_OriginX = fX;
pCharPos->m_OriginY = fY;
if ((dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0) {
- FX_INT32 iFormWidth = iCharWidth;
+ int32_t iFormWidth = iCharWidth;
pFont->GetCharWidth(wForm, iFormWidth, FALSE);
FX_FLOAT fOffset = fFontSize * (iCharWidth - iFormWidth) / 2000.0f;
if (bVerticalDoc) {
@@ -1544,7 +1544,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar }
return iCount;
}
-FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
+int32_t CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
{
if (pTxtRun == NULL || pTxtRun->iLength < 1) {
return 0;
@@ -1552,12 +1552,12 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra IFX_TxtAccess *pAccess = pTxtRun->pAccess;
FX_LPVOID pIdentity = pTxtRun->pIdentity;
FX_LPCWSTR pStr = pTxtRun->pStr;
- FX_INT32 *pWidths = pTxtRun->pWidths;
- FX_INT32 iLength = pTxtRun->iLength;
+ int32_t *pWidths = pTxtRun->pWidths;
+ int32_t iLength = pTxtRun->iLength;
CFX_RectF rect(*pTxtRun->pRect);
FX_BOOL bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
IFX_Font *pFont = pTxtRun->pFont;
if (pFont == NULL) {
@@ -1576,14 +1576,14 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra FX_BOOL bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0;
FX_BOOL bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pTxtRun->wLineBreakChar;
- FX_INT32 iCharSize;
+ int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
if (bVertical) {
fStart = bRTLPiece ? rect.bottom() : rect.top;
} else {
fStart = bRTLPiece ? rect.right() : rect.left;
}
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
if (pAccess != NULL) {
wch = pAccess->GetChar(pIdentity, i);
iCharSize = pAccess->GetWidth(pIdentity, i);
@@ -1620,7 +1620,7 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra rect.width = fCharSize;
}
if (bCharBBox && !bRet) {
- FX_INT32 iCharWidth = 1000;
+ int32_t iCharWidth = 1000;
pFont->GetCharWidth(wch, iCharWidth);
FX_FLOAT fRTLeft = 0, fCharWidth = 0;
if (iCharWidth > 0) {
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.h b/xfa/src/fgas/src/layout/fx_textbreak.h index a80b16c1b3..c38fc0b1ba 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.h +++ b/xfa/src/fgas/src/layout/fx_textbreak.h @@ -11,7 +11,7 @@ class CFX_Txtbreak; class CFX_TxtLine
{
public:
- CFX_TxtLine(FX_INT32 iBlockSize) : m_iStart(0)
+ CFX_TxtLine(int32_t iBlockSize) : m_iStart(0)
, m_iWidth(0)
, m_iArabicChars(0)
{
@@ -24,30 +24,30 @@ public: delete m_pLineChars;
FXTARGET_Delete m_pLinePieces;
}
- FX_INT32 CountChars() const
+ int32_t CountChars() const
{
return m_pLineChars->GetSize();
}
- CFX_TxtChar* GetCharPtr(FX_INT32 index) const
+ CFX_TxtChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_pLineChars->GetSize());
return m_pLineChars->GetDataPtr(index);
}
- FX_INT32 CountPieces() const
+ int32_t CountPieces() const
{
return m_pLinePieces->GetSize();
}
- CFX_TxtPiece* GetPiecePtr(FX_INT32 index) const
+ CFX_TxtPiece* GetPiecePtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize());
return m_pLinePieces->GetPtrAt(index);
}
void GetString(CFX_WideString &wsStr) const
{
- FX_INT32 iCount = m_pLineChars->GetSize();
+ int32_t iCount = m_pLineChars->GetSize();
FX_LPWSTR pBuf = wsStr.GetBuffer(iCount);
CFX_Char *pChar;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
pChar = m_pLineChars->GetDataPtr(i);
*pBuf ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -62,9 +62,9 @@ public: }
CFX_TxtCharArray *m_pLineChars;
CFX_TxtPieceArray *m_pLinePieces;
- FX_INT32 m_iStart;
- FX_INT32 m_iWidth;
- FX_INT32 m_iArabicChars;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
};
class CFX_TxtBreak : public IFX_TxtBreak
{
@@ -88,35 +88,35 @@ public: virtual void SetDefaultChar(FX_WCHAR wch);
virtual void SetParagraphBreakChar(FX_WCHAR wch);
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void SetHorizontalScale(FX_INT32 iScale);
- virtual void SetVerticalScale(FX_INT32 iScale);
- virtual void SetCharRotation(FX_INT32 iCharRotation);
+ virtual void SetHorizontalScale(int32_t iScale);
+ virtual void SetVerticalScale(int32_t iScale);
+ virtual void SetCharRotation(int32_t iCharRotation);
virtual void SetCharSpace(FX_FLOAT fCharSpace);
- virtual void SetAlignment(FX_INT32 iAlignment);
+ virtual void SetAlignment(int32_t iAlignment);
virtual FX_DWORD GetContextCharStyles() const;
virtual void SetContextCharStyles(FX_DWORD dwCharStyles);
virtual void SetCombWidth(FX_FLOAT fCombWidth);
virtual void SetUserData(FX_LPVOID pUserData);
virtual FX_DWORD AppendChar(FX_WCHAR wch);
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak);
- virtual FX_INT32 CountBreakChars() const;
- virtual FX_INT32 CountBreakPieces() const;
- virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const;
+ virtual int32_t CountBreakChars() const;
+ virtual int32_t CountBreakPieces() const;
+ virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const;
virtual void ClearBreakPieces();
virtual void Reset();
- virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
- virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
+ virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
void AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps);
- FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation);
+ FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation);
protected:
FX_DWORD m_dwPolicies;
FX_BOOL m_bPagination;
IFX_ArabicChar *m_pArabicChar;
- FX_INT32 m_iLineWidth;
+ int32_t m_iLineWidth;
FX_DWORD m_dwLayoutStyles;
FX_BOOL m_bVertical;
FX_BOOL m_bArabicContext;
@@ -124,38 +124,38 @@ protected: FX_BOOL m_bRTL;
FX_BOOL m_bSingleLine;
FX_BOOL m_bCombText;
- FX_INT32 m_iArabicContext;
- FX_INT32 m_iCurArabicContext;
+ int32_t m_iArabicContext;
+ int32_t m_iCurArabicContext;
IFX_Font *m_pFont;
- FX_INT32 m_iFontSize;
+ int32_t m_iFontSize;
FX_BOOL m_bEquidistant;
- FX_INT32 m_iTabWidth;
+ int32_t m_iTabWidth;
FX_WCHAR m_wDefChar;
FX_WCHAR m_wParagBreakChar;
- FX_INT32 m_iDefChar;
- FX_INT32 m_iLineRotation;
- FX_INT32 m_iCharRotation;
- FX_INT32 m_iRotation;
- FX_INT32 m_iAlignment;
+ int32_t m_iDefChar;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iAlignment;
FX_DWORD m_dwContextCharStyles;
- FX_INT32 m_iCombWidth;
+ int32_t m_iCombWidth;
FX_LPVOID m_pUserData;
FX_DWORD m_dwCharType;
FX_BOOL m_bCurRTL;
- FX_INT32 m_iCurAlignment;
+ int32_t m_iCurAlignment;
FX_BOOL m_bArabicNumber;
FX_BOOL m_bArabicComma;
CFX_TxtLine *m_pTxtLine1;
CFX_TxtLine *m_pTxtLine2;
CFX_TxtLine *m_pCurLine;
- FX_INT32 m_iReady;
- FX_INT32 m_iTolerance;
- FX_INT32 m_iHorScale;
- FX_INT32 m_iVerScale;
- FX_INT32 m_iCharSpace;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t m_iHorScale;
+ int32_t m_iVerScale;
+ int32_t m_iCharSpace;
void SetBreakStatus();
- FX_INT32 GetLineRotation(FX_DWORD dwStyles) const;
- CFX_TxtChar* GetLastChar(FX_INT32 index, FX_BOOL bOmitChar = TRUE) const;
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
+ CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const;
CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const;
CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const;
FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
@@ -165,7 +165,7 @@ protected: FX_BOOL EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus);
void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus);
void EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus);
- FX_INT32 GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
+ int32_t GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
void SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars = FALSE);
};
#endif
diff --git a/xfa/src/fgas/src/layout/fx_unicode.cpp b/xfa/src/fgas/src/layout/fx_unicode.cpp index def5d707f5..b93990551c 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.cpp +++ b/xfa/src/fgas/src/layout/fx_unicode.cpp @@ -6,16 +6,16 @@ #include "../fgas_base.h"
#include "fx_unicode.h"
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd)
+void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd)
{
FXSYS_assert(iStart > -1 && iStart < tpos.GetSize());
FXSYS_assert(iEnd > -1 && iEnd < tpos.GetSize());
if (iStart >= iEnd) {
return;
}
- FX_INT32 i = iStart, j = iEnd;
+ int32_t i = iStart, j = iEnd;
FX_TPO *pCur = tpos.GetPtrAt(iStart), *pSort;
- FX_INT32 v = pCur->pos;
+ int32_t v = pCur->pos;
while (i < j) {
while (j > i) {
pSort = tpos.GetPtrAt(j);
@@ -95,10 +95,10 @@ static const FX_JAPCHARPROPERTYEX gs_FX_JapCharPropertysEx[] = { };
FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch)
{
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX);
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX);
while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FX_WCHAR wJapChar = gs_FX_JapCharPropertysEx[iMid].wChar;
if (wch == wJapChar) {
return gs_FX_JapCharPropertysEx + iMid;
diff --git a/xfa/src/fgas/src/layout/fx_unicode.h b/xfa/src/fgas/src/layout/fx_unicode.h index 5eadb5506f..08f9528347 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.h +++ b/xfa/src/fgas/src/layout/fx_unicode.h @@ -7,9 +7,9 @@ #ifndef _FGAS_UNICODE_IMP
#define _FGAS_UNICODE_IMP
typedef struct _FX_TPO {
- FX_INT32 index;
- FX_INT32 pos;
+ int32_t index;
+ int32_t pos;
} FX_TPO;
typedef CFX_MassArrayTemplate<FX_TPO> CFX_TPOArray;
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd);
+void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd);
#endif
diff --git a/xfa/src/fgas/src/localization/fx_datetime.cpp b/xfa/src/fgas/src/localization/fx_datetime.cpp index 7c2b3d3540..9a1da457d9 100644 --- a/xfa/src/fgas/src/localization/fx_datetime.cpp +++ b/xfa/src/fgas/src/localization/fx_datetime.cpp @@ -5,56 +5,56 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../fgas_base.h"
-const FX_BYTE g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-const FX_BYTE g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-const FX_INT32 g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-const FX_INT32 g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
-const FX_INT32 g_FXDaysPerYear = 365;
-const FX_INT32 g_FXDaysPerLeapYear = 366;
-const FX_INT32 g_FXDaysPer4Years = 1461;
-const FX_INT32 g_FXDaysPer100Years = 36524;
-const FX_INT32 g_FXDaysPer400Years = 146097;
-const FX_INT64 g_FXMillisecondsPerSecond = 1000;
-const FX_INT64 g_FXMillisecondsPerMinute = 60000;
-const FX_INT64 g_FXMillisecondsPerHour = 3600000;
-const FX_INT64 g_FXMillisecondsPerDay = 86400000;
+const uint8_t g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+const uint8_t g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+const int32_t g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+const int32_t g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
+const int32_t g_FXDaysPerYear = 365;
+const int32_t g_FXDaysPerLeapYear = 366;
+const int32_t g_FXDaysPer4Years = 1461;
+const int32_t g_FXDaysPer100Years = 36524;
+const int32_t g_FXDaysPer400Years = 146097;
+const int64_t g_FXMillisecondsPerSecond = 1000;
+const int64_t g_FXMillisecondsPerMinute = 60000;
+const int64_t g_FXMillisecondsPerHour = 3600000;
+const int64_t g_FXMillisecondsPerDay = 86400000;
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_
-const FX_INT64 g_FXMillisecondsPerYear = 0x0757B12C00;
-const FX_INT64 g_FXMillisecondsPerLeapYear = 0x075CD78800;
-const FX_INT64 g_FXMillisecondsPer4Years = 0x1D63EB0C00;
-const FX_INT64 g_FXMillisecondsPer100Years = 0x02DEBCCDD000;
-const FX_INT64 g_FXMillisecondsPer400Years = 0x0B7AF85D9C00;
+const int64_t g_FXMillisecondsPerYear = 0x0757B12C00;
+const int64_t g_FXMillisecondsPerLeapYear = 0x075CD78800;
+const int64_t g_FXMillisecondsPer4Years = 0x1D63EB0C00;
+const int64_t g_FXMillisecondsPer100Years = 0x02DEBCCDD000;
+const int64_t g_FXMillisecondsPer400Years = 0x0B7AF85D9C00;
#endif
-FX_BOOL FX_IsLeapYear(FX_INT32 iYear)
+FX_BOOL FX_IsLeapYear(int32_t iYear)
{
FXSYS_assert(iYear != 0);
return ((iYear % 4) == 0 && (iYear % 100) != 0) || (iYear % 400) == 0;
}
-FX_INT32 FX_DaysInYear(FX_INT32 iYear)
+int32_t FX_DaysInYear(int32_t iYear)
{
FXSYS_assert(iYear != 0);
return FX_IsLeapYear(iYear) ? g_FXDaysPerLeapYear : g_FXDaysPerYear;
}
-FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth)
+uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
- const FX_BYTE *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth;
+ const uint8_t *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth;
return p[iMonth - 1];
}
-static FX_INT32 FX_DaysBeforeMonthInYear(FX_INT32 iYear, FX_BYTE iMonth)
+static int32_t FX_DaysBeforeMonthInYear(int32_t iYear, uint8_t iMonth)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
- const FX_INT32 *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth;
+ const int32_t *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth;
return p[iMonth - 1];
}
-static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_BOOL bIncludeThisDay = FALSE)
+static int64_t FX_DateToDays(int32_t iYear, uint8_t iMonth, uint8_t iDay, FX_BOOL bIncludeThisDay = FALSE)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
FXSYS_assert(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth));
- FX_INT64 iDays = FX_DaysBeforeMonthInYear(iYear, iMonth);
+ int64_t iDays = FX_DaysBeforeMonthInYear(iYear, iMonth);
iDays += iDay;
if (!bIncludeThisDay) {
iDays --;
@@ -65,9 +65,9 @@ static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_B iDays -= FX_DaysInYear(iYear);
iYear ++;
}
- return iDays + (FX_INT64)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400;
+ return iDays + (int64_t)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400;
}
-static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_BYTE &iDay)
+static void FX_DaysToDate(int64_t iDays, int32_t &iYear, uint8_t &iMonth, uint8_t &iDay)
{
FX_BOOL bBC = iDays < 0;
if (bBC) {
@@ -77,7 +77,7 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iMonth = 1;
iDay = 1;
if (iDays >= g_FXDaysPer400Years) {
- iYear += (FX_INT32)(iDays / g_FXDaysPer400Years * 400);
+ iYear += (int32_t)(iDays / g_FXDaysPer400Years * 400);
iDays %= g_FXDaysPer400Years;
}
if (iDays >= g_FXDaysPer100Years) {
@@ -85,16 +85,16 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iYear += 300;
iDays -= g_FXDaysPer100Years * 3;
} else {
- iYear += (FX_INT32)(iDays / g_FXDaysPer100Years * 100);
+ iYear += (int32_t)(iDays / g_FXDaysPer100Years * 100);
iDays %= g_FXDaysPer100Years;
}
}
if (iDays >= g_FXDaysPer4Years) {
- iYear += (FX_INT32)(iDays / g_FXDaysPer4Years * 4);
+ iYear += (int32_t)(iDays / g_FXDaysPer4Years * 4);
iDays %= g_FXDaysPer4Years;
}
while (TRUE) {
- FX_INT32 iYearDays = FX_DaysInYear(iYear);
+ int32_t iYearDays = FX_DaysInYear(iYear);
if (iDays < iYearDays) {
if (bBC) {
iYear = -iYear;
@@ -106,14 +106,14 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iDays -= iYearDays;
}
while (TRUE) {
- FX_INT32 iMonthDays = FX_DaysInMonth(iYear, iMonth);
+ int32_t iMonthDays = FX_DaysInMonth(iYear, iMonth);
if (iDays < iMonthDays) {
break;
}
iMonth ++;
iDays -= iMonthDays;
}
- iDay += (FX_BYTE)iDays;
+ iDay += (uint8_t)iDays;
}
#if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
#include <time.h>
@@ -153,8 +153,8 @@ void CFX_Unitime::Now() utLocal.wSecond = st.tm_sec;
utLocal.wMilliseconds = curTime.tv_usec / 1000;
#endif
- Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay,
- (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
+ Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay,
+ (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
}
void CFX_Unitime::SetGMTime()
{
@@ -180,16 +180,16 @@ void CFX_Unitime::SetGMTime() utLocal.wSecond = st.tm_sec;
utLocal.wMilliseconds = curTime.tv_usec / 1000;
#endif
- Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay,
- (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
+ Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay,
+ (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
}
-void CFX_Unitime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond)
+void CFX_Unitime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond)
{
FXSYS_assert(hour <= 23);
FXSYS_assert(minute <= 59);
FXSYS_assert(second <= 59);
FXSYS_assert(millisecond <= 999);
- m_iUnitime = (FX_INT64)hour * g_FXMillisecondsPerHour + (FX_INT64)minute * g_FXMillisecondsPerMinute + (FX_INT64)second * g_FXMillisecondsPerSecond + millisecond;
+ m_iUnitime = (int64_t)hour * g_FXMillisecondsPerHour + (int64_t)minute * g_FXMillisecondsPerMinute + (int64_t)second * g_FXMillisecondsPerSecond + millisecond;
if (year > 0) {
m_iUnitime = m_iUnitime + FX_DateToDays(year, month, day, FALSE) * g_FXMillisecondsPerDay;
}
@@ -198,30 +198,30 @@ void CFX_Unitime::Set(FX_UNITIME t) {
m_iUnitime = t;
}
-FX_INT32 CFX_Unitime::GetYear() const
+int32_t CFX_Unitime::GetYear() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iYear;
}
-FX_BYTE CFX_Unitime::GetMonth() const
+uint8_t CFX_Unitime::GetMonth() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iMonth;
}
-FX_BYTE CFX_Unitime::GetDay() const
+uint8_t CFX_Unitime::GetDay() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iDay;
}
FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const
{
- FX_INT32 v = (FX_INT32)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7);
+ int32_t v = (int32_t)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7);
if (v < 0) {
v += 7;
}
@@ -229,62 +229,62 @@ FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const }
FX_WORD CFX_Unitime::GetDayOfYear() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return FX_DaysBeforeMonthInYear(iYear, iMonth) + iDay;
}
-FX_INT64 CFX_Unitime::GetDayOfAD() const
+int64_t CFX_Unitime::GetDayOfAD() const
{
FX_BOOL bBC = m_iUnitime < 0;
- FX_INT64 iDays = m_iUnitime / g_FXMillisecondsPerDay;
+ int64_t iDays = m_iUnitime / g_FXMillisecondsPerDay;
iDays += bBC ? -1 : 0;
if (bBC && (m_iUnitime % g_FXMillisecondsPerDay) == 0) {
iDays ++;
}
return iDays;
}
-FX_BYTE CFX_Unitime::GetHour() const
+uint8_t CFX_Unitime::GetHour() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerDay);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerDay);
if (v < 0) {
v += g_FXMillisecondsPerDay;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerHour);
+ return (uint8_t)(v / g_FXMillisecondsPerHour);
}
-FX_BYTE CFX_Unitime::GetMinute() const
+uint8_t CFX_Unitime::GetMinute() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerHour);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerHour);
if (v < 0) {
v += g_FXMillisecondsPerHour;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerMinute);
+ return (uint8_t)(v / g_FXMillisecondsPerMinute);
}
-FX_BYTE CFX_Unitime::GetSecond() const
+uint8_t CFX_Unitime::GetSecond() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerMinute);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerMinute);
if (v < 0) {
v += g_FXMillisecondsPerMinute;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerSecond);
+ return (uint8_t)(v / g_FXMillisecondsPerSecond);
}
FX_WORD CFX_Unitime::GetMillisecond() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerSecond);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerSecond);
if (v < 0) {
v += g_FXMillisecondsPerSecond;
}
return (FX_WORD)v;
}
-FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears)
+FX_BOOL CFX_Unitime::AddYears(int32_t iYears)
{
FX_UNITIME ut = m_iUnitime;
if (ut < 0) {
ut = -ut;
}
FX_UNITIME r = ut % g_FXMillisecondsPerDay;
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
iYear += iYears;
if (iYear == 0) {
@@ -294,7 +294,7 @@ FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears) m_iUnitime += (iYear < 0) ? -r : r;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths)
+FX_BOOL CFX_Unitime::AddMonths(int32_t iMonths)
{
FX_BOOL b = iMonths > 0;
FX_UNITIME ut = m_iUnitime;
@@ -302,8 +302,8 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) ut = -ut;
}
FX_UNITIME r = ut % g_FXMillisecondsPerDay;
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
iMonths += iMonth;
while (iMonths < 1) {
@@ -315,36 +315,36 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) if (iYear == 0) {
iYear = b ? 1 : -1;
}
- m_iUnitime = FX_DateToDays(iYear, (FX_BYTE)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay;
+ m_iUnitime = FX_DateToDays(iYear, (uint8_t)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay;
m_iUnitime += (iYear < 0) ? -r : r;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddDays(FX_INT32 iDays)
+FX_BOOL CFX_Unitime::AddDays(int32_t iDays)
{
- m_iUnitime += (FX_INT64)iDays * g_FXMillisecondsPerDay;
+ m_iUnitime += (int64_t)iDays * g_FXMillisecondsPerDay;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddHours(FX_INT32 iHours)
+FX_BOOL CFX_Unitime::AddHours(int32_t iHours)
{
- m_iUnitime += (FX_INT64)iHours * g_FXMillisecondsPerHour;
+ m_iUnitime += (int64_t)iHours * g_FXMillisecondsPerHour;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMinutes(FX_INT32 iMinutes)
+FX_BOOL CFX_Unitime::AddMinutes(int32_t iMinutes)
{
- m_iUnitime += (FX_INT64)iMinutes * g_FXMillisecondsPerMinute;
+ m_iUnitime += (int64_t)iMinutes * g_FXMillisecondsPerMinute;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddSeconds(FX_INT32 iSeconds)
+FX_BOOL CFX_Unitime::AddSeconds(int32_t iSeconds)
{
- m_iUnitime += ((FX_INT64)iSeconds) * g_FXMillisecondsPerSecond;
+ m_iUnitime += ((int64_t)iSeconds) * g_FXMillisecondsPerSecond;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMilliseconds(FX_INT32 iMilliseconds)
+FX_BOOL CFX_Unitime::AddMilliseconds(int32_t iMilliseconds)
{
m_iUnitime += iMilliseconds;
return TRUE;
}
-FX_BOOL CFX_DateTime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond)
+FX_BOOL CFX_DateTime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond)
{
ASSERT(year != 0);
ASSERT(month >= 1 && month <= 12);
@@ -374,25 +374,25 @@ FX_BOOL CFX_DateTime::FromUnitime(FX_UNITIME t) }
FX_UNITIME CFX_DateTime::ToUnitime() const
{
- FX_UNITIME v = (FX_INT64)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (FX_INT64)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (FX_INT64)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond + m_DateTime.Time.sTime.millisecond;
+ FX_UNITIME v = (int64_t)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (int64_t)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (int64_t)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond + m_DateTime.Time.sTime.millisecond;
v += FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, FALSE) * g_FXMillisecondsPerDay;
return v;
}
-FX_INT32 CFX_DateTime::GetYear() const
+int32_t CFX_DateTime::GetYear() const
{
return m_DateTime.Date.sDate.year;
}
-FX_BYTE CFX_DateTime::GetMonth() const
+uint8_t CFX_DateTime::GetMonth() const
{
return m_DateTime.Date.sDate.month;
}
-FX_BYTE CFX_DateTime::GetDay() const
+uint8_t CFX_DateTime::GetDay() const
{
return m_DateTime.Date.sDate.day;
}
FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const
{
- FX_INT32 v = (FX_INT32)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7);
+ int32_t v = (int32_t)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7);
if (v < 0) {
v += 7;
}
@@ -402,19 +402,19 @@ FX_WORD CFX_DateTime::GetDayOfYear() const {
return FX_DaysBeforeMonthInYear(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month) + m_DateTime.Date.sDate.day;
}
-FX_INT64 CFX_DateTime::GetDayOfAD() const
+int64_t CFX_DateTime::GetDayOfAD() const
{
return FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
}
-FX_BYTE CFX_DateTime::GetHour() const
+uint8_t CFX_DateTime::GetHour() const
{
return m_DateTime.Date.sDate.day;
}
-FX_BYTE CFX_DateTime::GetMinute() const
+uint8_t CFX_DateTime::GetMinute() const
{
return m_DateTime.Time.sTime.minute;
}
-FX_BYTE CFX_DateTime::GetSecond() const
+uint8_t CFX_DateTime::GetSecond() const
{
return m_DateTime.Time.sTime.second;
}
@@ -422,12 +422,12 @@ FX_WORD CFX_DateTime::GetMillisecond() const {
return m_DateTime.Time.sTime.millisecond;
}
-FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears)
+FX_BOOL CFX_DateTime::AddYears(int32_t iYears)
{
if (iYears == 0) {
return FALSE;
}
- FX_INT32 v = m_DateTime.Date.sDate.year + iYears;
+ int32_t v = m_DateTime.Date.sDate.year + iYears;
if (v >= 0 && m_DateTime.Date.sDate.year < 0) {
v ++;
} else if (v <= 0 && m_DateTime.Date.sDate.year > 0) {
@@ -436,7 +436,7 @@ FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears) m_DateTime.Date.sDate.year = v;
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths)
+FX_BOOL CFX_DateTime::AddMonths(int32_t iMonths)
{
if (iMonths == 0) {
return FALSE;
@@ -460,16 +460,16 @@ FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths) if (m_DateTime.Date.sDate.year == 0) {
m_DateTime.Date.sDate.year = b ? 1 : -1;
}
- m_DateTime.Date.sDate.month = (FX_BYTE)iMonths;
+ m_DateTime.Date.sDate.month = (uint8_t)iMonths;
return TRUE;
}
-FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays)
+FX_BOOL CFX_DateTime::AddDays(int32_t iDays)
{
if (iDays == 0) {
return FALSE;
}
- FX_INT64 v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
- FX_INT64 v2 = v1 + iDays;
+ int64_t v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
+ int64_t v2 = v1 + iDays;
if (v2 <= 0 && v1 > 0) {
v2 --;
} else if (v2 >= 0 && v1 < 0) {
@@ -478,64 +478,64 @@ FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays) FX_DaysToDate(v2, m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day);
return TRUE;
}
-FX_BOOL CFX_DateTime::AddHours(FX_INT32 iHours)
+FX_BOOL CFX_DateTime::AddHours(int32_t iHours)
{
if (iHours == 0) {
return FALSE;
}
iHours += m_DateTime.Date.sDate.day;
- FX_INT32 iDays = iHours / 24;
+ int32_t iDays = iHours / 24;
iHours %= 24;
if (iHours < 0) {
iDays --, iHours += 24;
}
- m_DateTime.Date.sDate.day = (FX_BYTE)iHours;
+ m_DateTime.Date.sDate.day = (uint8_t)iHours;
if (iDays != 0) {
AddDays(iDays);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMinutes(FX_INT32 iMinutes)
+FX_BOOL CFX_DateTime::AddMinutes(int32_t iMinutes)
{
if (iMinutes == 0) {
return FALSE;
}
iMinutes += m_DateTime.Time.sTime.minute;
- FX_INT32 iHours = iMinutes / 60;
+ int32_t iHours = iMinutes / 60;
iMinutes %= 60;
if (iMinutes < 0) {
iHours --, iMinutes += 60;
}
- m_DateTime.Time.sTime.minute = (FX_BYTE)iMinutes;
+ m_DateTime.Time.sTime.minute = (uint8_t)iMinutes;
if (iHours != 0) {
AddHours(iHours);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddSeconds(FX_INT32 iSeconds)
+FX_BOOL CFX_DateTime::AddSeconds(int32_t iSeconds)
{
if (iSeconds == 0) {
return FALSE;
}
iSeconds += m_DateTime.Time.sTime.second;
- FX_INT32 iMinutes = iSeconds / 60;
+ int32_t iMinutes = iSeconds / 60;
iSeconds %= 60;
if (iSeconds < 0) {
iMinutes --, iSeconds += 60;
}
- m_DateTime.Time.sTime.second = (FX_BYTE)iSeconds;
+ m_DateTime.Time.sTime.second = (uint8_t)iSeconds;
if (iMinutes != 0) {
AddMinutes(iMinutes);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMilliseconds(FX_INT32 iMilliseconds)
+FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds)
{
if (iMilliseconds == 0) {
return FALSE;
}
iMilliseconds += m_DateTime.Time.sTime.millisecond;
- FX_INT32 iSeconds = (FX_INT32)(iMilliseconds / g_FXMillisecondsPerSecond);
+ int32_t iSeconds = (int32_t)(iMilliseconds / g_FXMillisecondsPerSecond);
iMilliseconds %= g_FXMillisecondsPerSecond;
if (iMilliseconds < 0) {
iSeconds --, iMilliseconds += g_FXMillisecondsPerSecond;
diff --git a/xfa/src/fgas/src/localization/fx_locale.cpp b/xfa/src/fgas/src/localization/fx_locale.cpp index 4998201871..4f046df119 100644 --- a/xfa/src/fgas/src/localization/fx_locale.cpp +++ b/xfa/src/fgas/src/localization/fx_locale.cpp @@ -14,9 +14,9 @@ #define FX_LOCALECATEGORY_ZeroHash 0x568cb500
#define FX_LOCALECATEGORY_NullHash 0x052931bb
typedef struct _FX_LOCALESUBCATEGORYINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
- FX_INT32 eSubCategory;
+ int32_t eSubCategory;
} FX_LOCALESUBCATEGORYINFO, * FX_LPLOCALESUBCATEGORYINFO;
typedef FX_LOCALESUBCATEGORYINFO const * FX_LPCLOCALESUBCATEGORYINFO;
const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = {
@@ -26,18 +26,18 @@ const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = { {0xcdce56b3, L"full", FX_LOCALEDATETIMESUBCATEGORY_Full},
{0xf6b4afb0, L"long", FX_LOCALEDATETIMESUBCATEGORY_Long},
};
-const static FX_INT32 g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
+const static int32_t g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
const static FX_LOCALESUBCATEGORYINFO g_FXLocaleNumSubCatData[] = {
{0x46f95531, L"percent", FX_LOCALENUMPATTERN_Percent},
{0x4c4e8acb, L"currency", FX_LOCALENUMPATTERN_Currency},
{0x54034c2f, L"decimal", FX_LOCALENUMPATTERN_Decimal},
{0x7568e6ae, L"integer", FX_LOCALENUMPATTERN_Integer},
};
-const static FX_INT32 g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
+const static int32_t g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
typedef struct _FX_LOCALETIMEZONEINFO {
FX_DWORD uHash;
- FX_INT16 iHour;
- FX_INT16 iMinute;
+ int16_t iHour;
+ int16_t iMinute;
} FX_LOCALETIMEZONEINFO, * FX_LPLOCALETIMEZONEINFO;
typedef FX_LOCALETIMEZONEINFO const * FX_LPCLOCALETIMEZONEINFO;
const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = {
@@ -46,7 +46,7 @@ const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = { {FXBSTR_ID(0, 'M', 'D', 'T'), -6, 0}, {FXBSTR_ID(0, 'M', 'S', 'T'), -7, 0},
{FXBSTR_ID(0, 'P', 'D', 'T'), -7, 0}, {FXBSTR_ID(0, 'P', 'S', 'T'), -8, 0},
};
-const static FX_INT32 g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO);
+const static int32_t g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO);
const static CFX_WideStringC gs_wsTextSymbols = FX_WSTRC(L"AXO09");
const static CFX_WideStringC gs_wsTimeSymbols = FX_WSTRC(L"hHkKMSFAzZ");
const static CFX_WideStringC gs_wsDateSymbols = FX_WSTRC(L"DJMEeGgYwW");
@@ -82,8 +82,8 @@ CFX_WideString CFX_Locale::GetName() static CFX_WideString FX_GetXMLContent(FX_BSTR bsSpace, CXML_Element* pxmlElement, FX_BSTR bsTag, FX_WSTR wsName)
{
CXML_Element* pDatePattern = NULL;
- FX_INT32 nCount = pxmlElement->CountElements(bsSpace, bsTag);
- FX_INT32 i = 0;
+ int32_t nCount = pxmlElement->CountElements(bsSpace, bsTag);
+ int32_t i = 0;
for (; i < nCount; i++) {
pDatePattern = pxmlElement->GetElement(bsSpace, bsTag, i);
if (pDatePattern->GetAttrValue(FX_BSTRC("name")) == wsName) {
@@ -120,7 +120,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const }
wsDtSymbol = pNumberSymbols->GetContent(0);
}
-static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, FX_INT32 index, FX_BOOL bAbbr, CFX_WideString &wsName)
+static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, int32_t index, FX_BOOL bAbbr, CFX_WideString &wsName)
{
CFX_ByteString bsSpace;
CFX_ByteString pstrSymbolNames = symbol_type + FX_BSTRC("Names");
@@ -142,14 +142,14 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString }
}
}
-void CFX_Locale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
+void CFX_Locale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
{
if (!m_pElement) {
return;
}
FX_GetCalendarSymbol(m_pElement, "month", nMonth, bAbbr, wsMonthName);
}
-void CFX_Locale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
+void CFX_Locale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
{
if (!m_pElement) {
return;
@@ -163,15 +163,15 @@ void CFX_Locale::GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM ) c }
FX_GetCalendarSymbol(m_pElement, "meridiem", bAM ? 0 : 1, FALSE, wsMeridiemName);
}
-static FX_INT32 FX_ParseTimeZone(FX_LPCWSTR pStr, FX_INT32 iLen, FX_TIMEZONE& tz)
+static int32_t FX_ParseTimeZone(FX_LPCWSTR pStr, int32_t iLen, FX_TIMEZONE& tz)
{
tz.tzHour = 0;
tz.tzMinute = 0;
if (iLen < 0) {
return 0;
}
- FX_INT32 iStart = 1;
- FX_INT32 iEnd = iStart + 2;
+ int32_t iStart = 1;
+ int32_t iEnd = iStart + 2;
while (iStart < iLen && iStart < iEnd) {
tz.tzHour = tz.tzHour * 10 + pStr[iStart++] - '0';
}
@@ -255,12 +255,12 @@ static FX_BOOL FX_IsSpace(FX_WCHAR c) static const FX_FLOAT gs_fraction_scales[] = {0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f,
0.0000001f, 0.00000001f, 0.000000001f, 0.0000000001f, 0.00000000001f
};
-static const FX_INT32 gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT);
+static const int32_t gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT);
class CFX_LCNumeric
{
public:
CFX_LCNumeric();
- CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional = 0, FX_INT32 exponent = 0);
+ CFX_LCNumeric(int64_t integral, FX_DWORD fractional = 0, int32_t exponent = 0);
CFX_LCNumeric(FX_FLOAT dbRetValue);
CFX_LCNumeric(double dbvalue);
CFX_LCNumeric(CFX_WideString& wsNumeric);
@@ -268,19 +268,19 @@ public: FX_FLOAT GetFloat() const;
double GetDouble() const;
CFX_WideString ToString() const;
- CFX_WideString ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const;
- FX_INT64 m_Integral;
+ CFX_WideString ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const;
+ int64_t m_Integral;
FX_DWORD m_Fractional;
#ifdef FX_NUM_DOUBLE
CFX_WideString m_wsValue;
#endif
- FX_INT32 m_Exponent;
+ int32_t m_Exponent;
};
static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& lcnum)
{
- FX_INT64 *pIntegral = &lcnum.m_Integral;
+ int64_t *pIntegral = &lcnum.m_Integral;
FX_DWORD *pFractional = &lcnum.m_Fractional;
- FX_INT32 *pExponent = &lcnum.m_Exponent;
+ int32_t *pExponent = &lcnum.m_Exponent;
*pIntegral = 0;
*pFractional = 0;
*pExponent = 0;
@@ -290,11 +290,11 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& if (wsValue.IsEmpty()) {
return FALSE;
}
- const FX_INT32 nIntegralMaxLen = 17;
- FX_INT32 cc = 0;
+ const int32_t nIntegralMaxLen = 17;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)wsValue;
- FX_INT32 len = wsValue.GetLength();
+ int32_t len = wsValue.GetLength();
while (cc < len && FX_IsSpace(str[cc])) {
cc++;
}
@@ -307,7 +307,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.') {
break;
@@ -384,7 +384,7 @@ CFX_LCNumeric::CFX_LCNumeric() m_Fractional = 0;
m_Exponent = 0;
}
-CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 exponent )
+CFX_LCNumeric::CFX_LCNumeric(int64_t integral, FX_DWORD fractional , int32_t exponent )
{
m_Integral = integral;
m_Fractional = fractional;
@@ -392,13 +392,13 @@ CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 e }
CFX_LCNumeric::CFX_LCNumeric(FX_FLOAT dbRetValue)
{
- m_Integral = (FX_INT64)dbRetValue;
+ m_Integral = (int64_t)dbRetValue;
m_Fractional = (FX_DWORD)(((dbRetValue > 0) ? (dbRetValue - m_Integral) : (m_Integral - dbRetValue)) * 4294967296);
m_Exponent = 0;
}
CFX_LCNumeric::CFX_LCNumeric(double dbvalue)
{
- m_Integral = (FX_INT64)dbvalue;
+ m_Integral = (int64_t)dbvalue;
m_Fractional = (FX_DWORD)(((dbvalue > 0) ? (dbvalue - m_Integral) : (m_Integral - dbvalue)) * 4294967296);
m_Exponent = 0;
}
@@ -428,16 +428,16 @@ CFX_WideString CFX_LCNumeric::ToString() const {
return ToString(8, TRUE);
}
-CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const
+CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const
{
#ifdef FX_NUM_DOUBLE
CFX_WideString wsResult;
if (!m_wsValue.IsEmpty()) {
- const FX_INT32 nIntegralMaxLen = 17;
- FX_INT32 cc = 0;
+ const int32_t nIntegralMaxLen = 17;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue;
- FX_INT32 len = m_wsValue.GetLength();
+ int32_t len = m_wsValue.GetLength();
while (cc < len && FX_IsSpace(str[cc])) {
cc++;
}
@@ -450,7 +450,7 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.') {
break;
@@ -497,8 +497,8 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero }
}
double dbValeu = GetDouble();
- FX_INT64 iInte = (FX_INT64)dbValeu;
- wsResult.Format(L"%l", (FX_INT64)iInte);
+ int64_t iInte = (int64_t)dbValeu;
+ wsResult.Format(L"%l", (int64_t)iInte);
if (m_Fractional) {
CFX_WideString wsFormat;
wsFormat.Format(L"%%.%dG", nTreading);
@@ -539,7 +539,7 @@ CFX_FormatString::~CFX_FormatString() }
void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns)
{
- FX_INT32 iStrLen = wsFormatString.GetLength();
+ int32_t iStrLen = wsFormatString.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsFormatString;
FX_LPCWSTR pToken = pStr;
FX_LPCWSTR pEnd = pStr + iStrLen;
@@ -559,14 +559,14 @@ void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, C pStr ++;
}
}
-static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern, FX_INT32 iLenPattern)
+static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, int32_t &iPattern, int32_t iLenPattern)
{
CFX_WideString wsOutput;
if (pStrPattern[iPattern] != '\'') {
return wsOutput;
}
iPattern++;
- FX_INT32 iQuote = 1;
+ int32_t iQuote = 1;
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
iQuote++;
@@ -577,9 +577,9 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte }
iPattern++;
} else if (pStrPattern[iPattern] == '\\' && (iPattern + 1 < iLenPattern) && pStrPattern[iPattern + 1] == 'u') {
- FX_INT32 iKeyValue = 0;
+ int32_t iKeyValue = 0;
iPattern += 2;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (iPattern < iLenPattern && i++ < 4) {
FX_WCHAR ch = pStrPattern[iPattern++];
if ((ch >= '0' && ch <= '9')) {
@@ -599,14 +599,14 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte }
return wsOutput;
}
-static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern)
+static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, int32_t &iPattern)
{
CFX_WideString wsOutput;
if (pStrPattern[iPattern] != '\'') {
return wsOutput;
}
iPattern--;
- FX_INT32 iQuote = 1;
+ int32_t iQuote = 1;
while (iPattern >= 0) {
if (pStrPattern[iPattern] == '\'') {
iQuote++;
@@ -618,9 +618,9 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 iPattern--;
} else if (pStrPattern[iPattern] == '\\' && pStrPattern[iPattern + 1] == 'u') {
iPattern--;
- FX_INT32 iKeyValue = 0;
- FX_INT32 iLen = wsOutput.GetLength();
- FX_INT32 i = 1;
+ int32_t iKeyValue = 0;
+ int32_t iLen = wsOutput.GetLength();
+ int32_t i = 1;
for (; i < iLen && i < 5; i++) {
FX_WCHAR ch = wsOutput[i];
if ((ch >= '0' && ch <= '9')) {
@@ -644,8 +644,8 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 FX_LOCALECATEGORY CFX_FormatString::GetCategory(const CFX_WideString& wsPattern)
{
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bBraceOpen = FALSE;
while (ccf < iLenf) {
@@ -711,8 +711,8 @@ FX_WORD CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) }
CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern)
{
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -732,13 +732,13 @@ CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern) IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern)
{
IFX_Locale* pLocale = NULL;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bBrackOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -781,18 +781,18 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_ #define FX_NUMSTYLE_Percent 0x01
#define FX_NUMSTYLE_Exponent 0x02
#define FX_NUMSTYLE_DotVorv 0x04
-IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern)
+IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern)
{
dwStyle = 0;
IFX_Locale* pLocale = NULL;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bFindDot = FALSE;
FX_BOOL bBrackOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -826,7 +826,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, }
FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal;
- for (FX_INT32 i = 0; i < g_iFXLocaleNumSubCatCount; i++) {
+ for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) {
if (g_FXLocaleNumSubCatData[i].uHash == dwSubHash) {
eSubCategory = (FX_LOCALENUMSUBCATEGORY)g_FXLocaleNumSubCatData[i].eSubCategory;
break;
@@ -878,12 +878,12 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, }
return pLocale;
}
-static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, FX_INT32 &iDotIndex)
+static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, int32_t &iDotIndex)
{
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsNum.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsNum.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum;
- FX_INT32 iLenDot = wsDotSymbol.GetLength();
+ int32_t iLenDot = wsDotSymbol.GetLength();
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
FX_GetLiteralText(pStr, ccf, iLenf);
@@ -911,16 +911,16 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText, const CFX_W if (wsTextFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
switch (pStrPattern[iPattern]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
wsValue = wsSrcText;
return FALSE;
@@ -974,23 +974,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwFormatStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iExponent = 0;
+ int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
- FX_INT32 iDotLen = wsDotSymbol.GetLength();
+ int32_t iDotLen = wsDotSymbol.GetLength();
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_INT32 iGroupLen = wsGroupSymbol.GetLength();
+ int32_t iGroupLen = wsGroupSymbol.GetLength();
CFX_WideString wsMinus;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
- FX_INT32 iMinusLen = wsMinus.GetLength();
+ int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum;
int len = wsSrcNum.GetLength();
@@ -1001,7 +1001,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE;
FX_BOOL bNeg = FALSE;
FX_BOOL bReverseParse = FALSE;
- FX_INT32 dot_index = 0;
+ int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
bReverseParse = TRUE;
}
@@ -1013,7 +1013,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1104,7 +1104,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1168,7 +1168,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1235,7 +1235,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1330,7 +1330,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1394,7 +1394,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1455,7 +1455,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -1546,7 +1546,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
}
@@ -1601,7 +1601,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
cc += iSysmbolLen;
}
@@ -1671,12 +1671,12 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid }
void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult)
{
- FX_INT32 iCount = wsNum.GetLength();
+ int32_t iCount = wsNum.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum;
FX_LPWSTR pDst = wsResult.GetBuffer(iCount);
- FX_INT32 nIndex = 0;
+ int32_t nIndex = 0;
FX_BOOL bMinus = FALSE;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < iCount; i++) {
FX_WCHAR wc = pStr[i];
if (wc == '.') {
@@ -1703,7 +1703,7 @@ void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) pDst = wsResult.GetBuffer(iCount + 1);
pDst[nIndex++] = '0';
}
- FX_INT32 j = 0;
+ int32_t j = 0;
for (j = iCount - 1; j > i; j--) {
FX_WCHAR wc = pStr[j];
if (wc != L'0' && wc != L' ') {
@@ -1723,23 +1723,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwFormatStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iExponent = 0;
+ int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
- FX_INT32 iDotLen = wsDotSymbol.GetLength();
+ int32_t iDotLen = wsDotSymbol.GetLength();
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_INT32 iGroupLen = wsGroupSymbol.GetLength();
+ int32_t iGroupLen = wsGroupSymbol.GetLength();
CFX_WideString wsMinus;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
- FX_INT32 iMinusLen = wsMinus.GetLength();
+ int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum;
int len = wsSrcNum.GetLength();
@@ -1748,7 +1748,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE;
FX_BOOL bNeg = FALSE;
FX_BOOL bReverseParse = FALSE;
- FX_INT32 dot_index = 0;
+ int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
bReverseParse = TRUE;
}
@@ -1759,7 +1759,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1851,7 +1851,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1915,7 +1915,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1984,7 +1984,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2072,7 +2072,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
}
@@ -2127,7 +2127,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
cc += iSysmbolLen;
}
@@ -2202,14 +2202,14 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt pLocale = NULL;
CFX_WideString wsTempPattern;
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
- FX_INT32 iFindCategory = 0;
+ int32_t iFindCategory = 0;
FX_BOOL bBraceOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsTempPattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBraceOpen && iFindCategory != 3 && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -2262,7 +2262,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt }
FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
FX_LOCALEDATETIMESUBCATEGORY eSubCategory = FX_LOCALEDATETIMESUBCATEGORY_Medium;
- for (FX_INT32 i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) {
+ for (int32_t i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) {
if (g_FXLocaleDateTimeSubCatData[i].uHash == dwSubHash) {
eSubCategory = (FX_LOCALEDATETIMESUBCATEGORY)g_FXLocaleDateTimeSubCatData[i].eSubCategory;
break;
@@ -2325,20 +2325,20 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt }
return (FX_DATETIMETYPE)iFindCategory;
}
-static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, FX_INT32 &cc)
+static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc)
{
- FX_INT32 year = 1900;
- FX_INT32 month = 1;
- FX_INT32 day = 1;
- FX_INT32 ccf = 0;
+ int32_t year = 1900;
+ int32_t month = 1;
+ int32_t day = 1;
+ int32_t ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsDate;
- FX_INT32 len = wsDate.GetLength();
+ int32_t len = wsDate.GetLength();
FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern;
- FX_INT32 lenf = wsDatePattern.GetLength();
+ int32_t lenf = wsDatePattern.GetLength();
while (cc < len && ccf < lenf) {
if (strf[ccf] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2451,7 +2451,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt }
} else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) {
CFX_WideString wsDayName;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < 7; i++) {
pLocale->GetDayName(i, wsDayName, FALSE);
if (wsDayName == L"") {
@@ -2513,9 +2513,9 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt datetime = datetime + ut;
return cc;
}
-static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale)
+static void FX_ResolveZone(uint8_t& wHour, uint8_t& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale)
{
- FX_INT32 iMinuteDiff = wHour * 60 + wMinute;
+ int32_t iMinuteDiff = wHour * 60 + wMinute;
FX_TIMEZONE tzLocale;
pLocale->GetTimeZone(tzLocale);
iMinuteDiff += tzLocale.tzHour * 60 + (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute);
@@ -2529,13 +2529,13 @@ static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, wHour = iMinuteDiff / 60;
wMinute = iMinuteDiff % 60;
}
-static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideString& wsTimePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, FX_INT32 &cc)
+static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideString& wsTimePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc)
{
- FX_BYTE hour = 0;
- FX_BYTE minute = 0;
- FX_BYTE second = 0;
+ uint8_t hour = 0;
+ uint8_t minute = 0;
+ uint8_t second = 0;
FX_WORD millisecond = 0;
- FX_INT32 ccf = 0;
+ int32_t ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsTime;
int len = wsTime.GetLength();
FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern;
@@ -2545,7 +2545,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt while (cc < len && ccf < lenf) {
if (strf[ccf] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2675,9 +2675,9 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt FX_ResolveZone(hour, minute, tzDiff, pLocale);
} else {
FX_LPCLOCALETIMEZONEINFO pTimeZoneInfo = NULL;
- FX_INT32 iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1;
+ int32_t iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FX_LPCLOCALETIMEZONEINFO pInfo = g_FXLocaleTimeZoneData + iMid;
if (dwHash == pInfo->uHash) {
pTimeZoneInfo = pInfo;
@@ -2739,7 +2739,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE;
}
if (eCategory == FX_DATETIMETYPE_TimeDate) {
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
if (!FX_ParseLocaleTime(wsSrcDateTime, wsTimePattern, pLocale, dtValue, iStart)) {
return FALSE;
}
@@ -2747,7 +2747,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE;
}
} else {
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
if ((eCategory & FX_DATETIMETYPE_Date) && !FX_ParseLocaleDate(wsSrcDateTime, wsDatePattern, pLocale, dtValue, iStart)) {
return FALSE;
}
@@ -2761,15 +2761,15 @@ FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText, const CFX_W {
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2789,15 +2789,15 @@ FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText, const CFX_W {
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2818,16 +2818,16 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ if (wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
if (iLenText == 0) {
return FALSE;
}
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
switch (pStrPattern[iPattern]) {
case '\'': {
@@ -2871,13 +2871,13 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ }
return iText == iLenText;
}
-static FX_INT32 FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros)
+static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros)
{
if (iDotPos < 0) {
return 0;
}
- FX_INT32 iCount = wsFormat.GetLength();
- FX_INT32 iTreading = 0;
+ int32_t iCount = wsFormat.GetLength();
+ int32_t iTreading = 0;
for (iDotPos ++; iDotPos < iCount; iDotPos ++) {
FX_WCHAR wc = wsFormat[iDotPos];
if (wc == L'z' || wc == L'9' || wc == 'Z') {
@@ -2892,14 +2892,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (wsInputNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwNumStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 cc = 0, ccf = 0;
+ int32_t cc = 0, ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat;
int lenf = wsNumFormat.GetLength();
CFX_WideString wsSrcNum = wsInputNum;
@@ -2912,7 +2912,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& decimal = decimal * CFX_Decimal(100);
wsSrcNum = decimal;
}
- FX_INT32 exponent = 0;
+ int32_t exponent = 0;
if (dwNumStyle & FX_NUMSTYLE_Exponent) {
int fixed_count = 0;
while (ccf < dot_index_f) {
@@ -2951,8 +2951,8 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& }
}
FX_BOOL bTrimTailZeros = FALSE;
- FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
- FX_INT32 scale = decimal.GetScale();
+ int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
+ int32_t scale = decimal.GetScale();
if (iTreading < scale) {
decimal.SetScale(iTreading);
wsSrcNum = decimal;
@@ -3135,7 +3135,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (cc >= 0) {
int nPos = dot_index % 3;
wsOutput.Empty();
- for (FX_INT32 i = 0; i < dot_index; i++) {
+ for (int32_t i = 0; i < dot_index; i++) {
if (i % 3 == nPos && i != 0) {
wsOutput += wsGroupSymbol;
}
@@ -3322,14 +3322,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& }
FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput)
{
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwNumStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 cc = 0, ccf = 0;
+ int32_t cc = 0, ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat;
int lenf = wsNumFormat.GetLength();
double dbOrgRaw = lcNum.GetDouble();
@@ -3337,7 +3337,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (dwNumStyle & FX_NUMSTYLE_Percent) {
dbRetValue *= 100;
}
- FX_INT32 exponent = 0;
+ int32_t exponent = 0;
if (dwNumStyle & FX_NUMSTYLE_Exponent) {
int fixed_count = 0;
while (ccf < dot_index_f) {
@@ -3379,7 +3379,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt lcNum = CFX_LCNumeric(dbRetValue);
}
FX_BOOL bTrimTailZeros = FALSE;
- FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
+ int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
CFX_WideString wsNumeric = lcNum.ToString(iTreading, bTrimTailZeros);
if (wsNumeric.IsEmpty()) {
return FALSE;
@@ -3549,7 +3549,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (cc >= 0) {
int nPos = dot_index % 3;
wsOutput.Empty();
- for (FX_INT32 i = 0; i < dot_index; i++) {
+ for (int32_t i = 0; i < dot_index; i++) {
if (i % 3 == nPos && i != 0) {
wsOutput += wsGroupSymbol;
}
@@ -3742,9 +3742,9 @@ FX_BOOL CFX_FormatString::FormatNum(FX_FLOAT fNum, const CFX_WideString& wsPatte }
FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime)
{
- FX_INT32 year = 1900;
- FX_INT32 month = 1;
- FX_INT32 day = 1;
+ int32_t year = 1900;
+ int32_t month = 1;
+ int32_t day = 1;
FX_WORD wYear = 0;
int cc_start = 0, cc = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsDate;
@@ -3767,7 +3767,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime cc++;
}
cc_start = cc;
- FX_BYTE tmpM = 0;
+ uint8_t tmpM = 0;
while (cc < len && cc < cc_start + 2) {
if (!FX_IsDigit(str[cc])) {
return FALSE;
@@ -3782,7 +3782,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime if (str[cc] == '-') {
cc++;
}
- FX_BYTE tmpD = 0;
+ uint8_t tmpD = 0;
cc_start = cc;
while (cc < len && cc < cc_start + 2) {
if (!FX_IsDigit(str[cc])) {
@@ -3821,9 +3821,9 @@ FX_BOOL FX_TimeFromCanonical(FX_WSTR wsTime, CFX_Unitime& datetime, IFX_Locale* if (wsTime.GetLength() == 0) {
return FALSE;
}
- FX_BYTE hour = 0;
- FX_BYTE minute = 0;
- FX_BYTE second = 0;
+ uint8_t hour = 0;
+ uint8_t minute = 0;
+ uint8_t second = 0;
FX_WORD millisecond = 0;
int cc_start = 0, cc = cc_start;
FX_LPCWSTR str = (FX_LPCWSTR)wsTime.GetPtr();
@@ -3945,12 +3945,12 @@ static FX_WORD FX_GetWeekOfYear(FX_WORD year, FX_WORD month, FX_WORD day) static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, IFX_Locale *pLocale, const CFX_Unitime &datetime, CFX_WideString& wsResult)
{
FX_BOOL bRet = TRUE;
- FX_INT32 year = datetime.GetYear();
- FX_BYTE month = datetime.GetMonth();
- FX_BYTE day = datetime.GetDay();
- FX_INT32 ccf = 0;
+ int32_t year = datetime.GetYear();
+ uint8_t month = datetime.GetMonth();
+ uint8_t day = datetime.GetDay();
+ int32_t ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern;
- FX_INT32 lenf = wsDatePattern.GetLength();
+ int32_t lenf = wsDatePattern.GetLength();
while (ccf < lenf) {
if (strf[ccf] == '\'') {
wsResult += FX_GetLiteralText(strf, ccf, lenf);
@@ -4061,13 +4061,13 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, IFX_Locale *pL {
FX_BOOL bGMT = FALSE;
FX_BOOL bRet = TRUE;
- FX_BYTE hour = datetime.GetHour();
- FX_BYTE minute = datetime.GetMinute();
- FX_BYTE second = datetime.GetSecond();
+ uint8_t hour = datetime.GetHour();
+ uint8_t minute = datetime.GetMinute();
+ uint8_t second = datetime.GetSecond();
FX_WORD millisecond = datetime.GetMillisecond();
- FX_INT32 ccf = 0;
+ int32_t ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern;
- FX_INT32 lenf = wsTimePattern.GetLength();
+ int32_t lenf = wsTimePattern.GetLength();
FX_WORD wHour = hour;
FX_BOOL bPM = FALSE;
if (wsTimePattern.Find('A') != -1) {
@@ -4216,7 +4216,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE;
}
CFX_Unitime dt(0);
- FX_INT32 iT = wsSrcDateTime.Find(L"T");
+ int32_t iT = wsSrcDateTime.Find(L"T");
if (iT < 0) {
if (eCategory == FX_DATETIMETYPE_Date) {
FX_DateFromCanonical(wsSrcDateTime, dt);
@@ -4251,7 +4251,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE;
}
CFX_Unitime dt(0);
- FX_INT32 iT = wsSrcDateTime.Find(L"T");
+ int32_t iT = wsSrcDateTime.Find(L"T");
if (iT < 0) {
if (eCategory == FX_DATETIMETYPE_Date && FX_DateFromCanonical(wsSrcDateTime, dt)) {
return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, TRUE, pLocale, wsOutput);
@@ -4290,9 +4290,9 @@ FX_BOOL CFX_FormatString::FormatZero(const CFX_WideString& wsPattern, CFX_WideSt }
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
- FX_INT32 iPattern = 0;
+ int32_t iPattern = 0;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
@@ -4312,9 +4312,9 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern, CFX_WideSt }
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
- FX_INT32 iPattern = 0;
+ int32_t iPattern = 0;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
@@ -4338,12 +4338,12 @@ IFX_Locale* CFX_FormatString::GetPatternLocale(FX_WSTR wsLocale) #define FXMATH_DECIMAL_FORCEBOOL(x) (!(!(x)))
#define FXMATH_DECIMAL_MAKEFLAGS(NEG, SCALE) (((SCALE) << 0x10) | ((NEG) ? FXMATH_DECIMAL_NEGMASK : 0))
#define FXMATH_DECIMAL_FLAGS2NEG(FLAGS) FXMATH_DECIMAL_FORCEBOOL((FLAGS) & FXMATH_DECIMAL_NEGMASK)
-#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((FX_UINT8)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10))
+#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((uint8_t)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10))
#define FXMATH_DECIMAL_RSHIFT32BIT(x) ((x)>>0x10>>0x10)
#define FXMATH_DECIMAL_LSHIFT32BIT(x) ((x)<<0x10<<0x10)
-static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline uint8_t fxmath_decimal_helper_div10(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
- FX_UINT8 retVal;
+ uint8_t retVal;
pmid += FXMATH_DECIMAL_LSHIFT32BIT(phi % 0xA);
phi /= 0xA;
plo += FXMATH_DECIMAL_LSHIFT32BIT(pmid % 0xA);
@@ -4352,9 +4352,9 @@ static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pm plo /= 0xA;
return retVal;
}
-static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT8 numcount)
+static inline uint8_t fxmath_decimal_helper_div10_any(uint64_t nums[], uint8_t numcount)
{
- FX_UINT8 retVal = 0;
+ uint8_t retVal = 0;
for(int i = numcount - 1; i > 0; i --) {
nums[i - 1] += FXMATH_DECIMAL_LSHIFT32BIT(nums[i] % 0xA);
nums[i] /= 0xA;
@@ -4365,49 +4365,49 @@ static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT }
return retVal;
}
-static inline void fxmath_decimal_helper_mul10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline void fxmath_decimal_helper_mul10(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
plo *= 0xA;
pmid = pmid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(plo);
- plo = (FX_UINT32)plo;
+ plo = (uint32_t)plo;
phi = phi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
}
-static inline void fxmath_decimal_helper_mul10_any(FX_UINT64 nums[], FX_UINT8 numcount)
+static inline void fxmath_decimal_helper_mul10_any(uint64_t nums[], uint8_t numcount)
{
nums[0] *= 0xA;
for(int i = 1; i < numcount; i++) {
nums[i] = nums[i] * 0xA + FXMATH_DECIMAL_RSHIFT32BIT (nums[i - 1]);
- nums[i - 1] = (FX_UINT32)nums[i - 1];
+ nums[i - 1] = (uint32_t)nums[i - 1];
}
}
-static inline void fxmath_decimal_helper_normalize(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline void fxmath_decimal_helper_normalize(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
pmid += FXMATH_DECIMAL_RSHIFT32BIT(plo);
- plo = (FX_UINT32)plo;
+ plo = (uint32_t)plo;
phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
}
-static inline void fxmath_decimal_helper_normalize_any(FX_UINT64 nums[], FX_UINT8 len)
+static inline void fxmath_decimal_helper_normalize_any(uint64_t nums[], uint8_t len)
{
{
for(int i = len - 2; i > 0; i --) {
nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]);
- nums[i] = (FX_UINT32)nums[i];
+ nums[i] = (uint32_t)nums[i];
}
}
{
for(int i = 0; i < len - 1; i ++) {
nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]);
- nums[i] = (FX_UINT32)nums[i];
+ nums[i] = (uint32_t)nums[i];
}
}
}
-static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 mid1, FX_UINT32 lo1, FX_UINT32 hi2, FX_UINT32 mid2, FX_UINT32 lo2)
+static inline int8_t fxmath_decimal_helper_raw_compare(uint32_t hi1, uint32_t mid1, uint32_t lo1, uint32_t hi2, uint32_t mid2, uint32_t lo2)
{
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
if (!retVal) {
retVal += (hi1 > hi2 ? 1 : (hi1 < hi2 ? -1 : 0));
}
@@ -4419,11 +4419,11 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 }
return retVal;
}
-static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl)
+static inline int8_t fxmath_decimal_helper_raw_compare_any(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl)
{
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
for(int i = FX_MAX(al - 1, bl - 1); i >= 0; i --) {
- FX_UINT64 l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]);
+ uint64_t l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]);
retVal += (l > r ? 1 : (l < r ? -1 : 0));
if(retVal) {
return retVal;
@@ -4431,7 +4431,7 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UI }
return retVal;
}
-static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al)
+static inline void fxmath_decimal_helper_dec_any(uint64_t a[], uint8_t al)
{
for(int i = 0; i < al; i ++) {
if(a[i]--) {
@@ -4439,17 +4439,17 @@ static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al) }
}
}
-static inline void fxmath_decimal_helper_inc_any(FX_UINT64 a[], FX_UINT8 al)
+static inline void fxmath_decimal_helper_inc_any(uint64_t a[], uint8_t al)
{
for(int i = 0; i < al; i ++) {
a[i]++;
- if((FX_UINT32)a[i] == a[i]) {
+ if((uint32_t)a[i] == a[i]) {
return;
}
a[i] = 0;
}
}
-static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl)
+static inline void fxmath_decimal_helper_raw_mul(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl)
{
assert(al + bl <= cl);
{
@@ -4460,8 +4460,8 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ {
for(int i = 0; i < al; i++) {
for(int j = 0; j < bl; j++) {
- FX_UINT64 m = (FX_UINT64)a[i] * b[j];
- c[i + j] += (FX_UINT32)m;
+ uint64_t m = (uint64_t)a[i] * b[j];
+ c[i + j] += (uint32_t)m;
c[i + j + 1] += FXMATH_DECIMAL_RSHIFT32BIT(m);
}
}
@@ -4469,29 +4469,29 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ {
for(int i = 0; i < cl - 1; i++) {
c[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(c[i]);
- c[i] = (FX_UINT32)c[i];
+ c[i] = (uint32_t)c[i];
}
}
{
for(int i = 0; i < cl; i++) {
- c[i] = (FX_UINT32)c[i];
+ c[i] = (uint32_t)c[i];
}
}
}
-static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl)
+static inline void fxmath_decimal_helper_raw_div(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl)
{
int i;
for(i = 0; i < cl; i++) {
c[i] = 0;
}
- FX_UINT64 left[16] = {0}, right[16] = {0};
+ uint64_t left[16] = {0}, right[16] = {0};
left[0] = 0;
for(i = 0; i < al; i++) {
right[i] = a[i];
}
- FX_UINT64 tmp[16];
+ uint64_t tmp[16];
while(fxmath_decimal_helper_raw_compare_any(left, al, right, al) <= 0) {
- FX_UINT64 cur[16];
+ uint64_t cur[16];
for(i = 0; i < al; i++) {
cur[i] = left[i] + right[i];
}
@@ -4527,7 +4527,7 @@ static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_ c[i] = left[i];
}
}
-static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal)
+static inline FX_BOOL fxmath_decimal_helper_outofrange(uint64_t a[], uint8_t al, uint8_t goal)
{
for(int i = goal; i < al; i++) {
if(a[i]) {
@@ -4536,7 +4536,7 @@ static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 a }
return FALSE;
}
-static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal, FX_UINT8& scale)
+static inline void fxmath_decimal_helper_shrinkintorange(uint64_t a[], uint8_t al, uint8_t goal, uint8_t& scale)
{
FX_BOOL bRoundUp = FALSE;
while(scale != 0 && (scale > FXMATH_DECIMAL_SCALELIMIT || fxmath_decimal_helper_outofrange(a, al, goal))) {
@@ -4548,10 +4548,10 @@ static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 fxmath_decimal_helper_inc_any(a, goal);
}
}
-static inline void fxmath_decimal_helper_truncate(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo, FX_UINT8& scale, FX_UINT8 minscale = 0)
+static inline void fxmath_decimal_helper_truncate(uint64_t& phi, uint64_t& pmid, uint64_t& plo, uint8_t& scale, uint8_t minscale = 0)
{
while(scale > minscale) {
- FX_UINT64 thi = phi, tmid = pmid, tlo = plo;
+ uint64_t thi = phi, tmid = pmid, tlo = plo;
if(fxmath_decimal_helper_div10(thi, tmid, tlo) != 0) {
break;
}
@@ -4563,20 +4563,20 @@ CFX_Decimal::CFX_Decimal() {
m_uLo = m_uMid = m_uHi = m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT64 val)
+CFX_Decimal::CFX_Decimal(uint64_t val)
{
- m_uLo = (FX_UINT32)val;
- m_uMid = (FX_UINT32)FXMATH_DECIMAL_RSHIFT32BIT(val);
+ m_uLo = (uint32_t)val;
+ m_uMid = (uint32_t)FXMATH_DECIMAL_RSHIFT32BIT(val);
m_uHi = 0;
m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT32 val)
+CFX_Decimal::CFX_Decimal(uint32_t val)
{
- m_uLo = (FX_UINT32)val;
+ m_uLo = (uint32_t)val;
m_uMid = m_uHi = 0;
m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, FX_UINT8 scale)
+CFX_Decimal::CFX_Decimal(uint32_t lo, uint32_t mid, uint32_t hi, FX_BOOL neg, uint8_t scale)
{
scale = (scale > FXMATH_DECIMAL_SCALELIMIT ? 0 : scale);
m_uLo = lo;
@@ -4584,43 +4584,43 @@ CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, m_uHi = hi;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(neg && IsNotZero(), scale);
}
-CFX_Decimal::CFX_Decimal(FX_INT32 val)
+CFX_Decimal::CFX_Decimal(int32_t val)
{
if(val >= 0) {
- *this = CFX_Decimal((FX_UINT32)val);
+ *this = CFX_Decimal((uint32_t)val);
} else {
- *this = CFX_Decimal((FX_UINT32) - val);
+ *this = CFX_Decimal((uint32_t) - val);
SetNegate();
}
}
-CFX_Decimal::CFX_Decimal(FX_INT64 val)
+CFX_Decimal::CFX_Decimal(int64_t val)
{
if(val >= 0) {
- *this = CFX_Decimal((FX_UINT64)val);
+ *this = CFX_Decimal((uint64_t)val);
} else {
- *this = CFX_Decimal((FX_UINT64) - val);
+ *this = CFX_Decimal((uint64_t) - val);
SetNegate();
}
}
-CFX_Decimal::CFX_Decimal(FX_FLOAT val, FX_UINT8 scale )
+CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale )
{
FX_FLOAT newval = fabs(val);
- FX_UINT64 phi, pmid, plo;
- plo = (FX_UINT64)newval;
- pmid = (FX_UINT64)(newval / 1e32);
- phi = (FX_UINT64)(newval / 1e64);
+ uint64_t phi, pmid, plo;
+ plo = (uint64_t)newval;
+ pmid = (uint64_t)(newval / 1e32);
+ phi = (uint64_t)(newval / 1e64);
newval = FXSYS_fmod(newval, 1.0f);
- for(FX_UINT8 iter = 0; iter < scale; iter++) {
+ for(uint8_t iter = 0; iter < scale; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
newval *= 10;
- plo += (FX_UINT64)newval;
+ plo += (uint64_t)newval;
newval = FXSYS_fmod(newval, 1.0f);
}
plo += FXSYS_round(newval);
fxmath_decimal_helper_normalize(phi, pmid, plo);
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(val < 0 && IsNotZero(), scale);
}
CFX_Decimal::CFX_Decimal(FX_WSTR strObj)
@@ -4629,7 +4629,7 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) FX_LPCWSTR strBound = str + strObj.GetLength();
FX_BOOL pointmet = 0;
FX_BOOL negmet = 0;
- FX_UINT8 scale = 0;
+ uint8_t scale = 0;
m_uHi = m_uMid = m_uLo = 0;
while (str != strBound && *str == ' ') {
str++;
@@ -4647,8 +4647,8 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) }
pointmet = 1;
} else {
- m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uMid * 0xA);
- m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uLo * 0xA);
+ m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uMid * 0xA);
+ m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uLo * 0xA);
m_uLo = m_uLo * 0xA + (*str - '0');
if(pointmet) {
scale++;
@@ -4669,12 +4669,12 @@ CFX_Decimal::operator CFX_WideString() const {
CFX_WideString retString;
CFX_WideString tmpbuf;
- FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo;
+ uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo;
while(phi || pmid || plo) {
tmpbuf += fxmath_decimal_helper_div10(phi, pmid, plo) + '0';
}
- FX_UINT8 outputlen = (FX_UINT8)tmpbuf.GetLength();
- FX_UINT8 scale = (FX_UINT8)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t outputlen = (uint8_t)tmpbuf.GetLength();
+ uint8_t scale = (uint8_t)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
while (scale >= outputlen) {
tmpbuf += '0';
outputlen++;
@@ -4682,7 +4682,7 @@ CFX_Decimal::operator CFX_WideString() const if (FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero()) {
retString += '-';
}
- for (FX_UINT8 idx = 0; idx < outputlen; idx++) {
+ for (uint8_t idx = 0; idx < outputlen; idx++) {
if (idx == (outputlen - scale) && scale != 0) {
retString += '.';
}
@@ -4694,27 +4694,27 @@ CFX_Decimal::operator double() const {
double pow = (double)(1 << 16) * (1 << 16);
double base = ((double)m_uHi) * pow * pow + ((double)m_uMid) * pow + ((double)m_uLo);
- FX_INT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ int8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
FX_BOOL bNeg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags);
return (bNeg ? -1 : 1) * base * ::pow(10.0, -scale);
}
-void CFX_Decimal::SetScale(FX_UINT8 newscale)
+void CFX_Decimal::SetScale(uint8_t newscale)
{
- FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
if (newscale > oldscale) {
- FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo;
- for (FX_UINT8 iter = 0; iter < newscale - oldscale; iter++) {
+ uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo;
+ for (uint8_t iter = 0; iter < newscale - oldscale; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
}
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale);
} else if (newscale < oldscale) {
- FX_UINT64 phi, pmid, plo;
+ uint64_t phi, pmid, plo;
phi = 0, pmid = 0, plo = 5;
{
- for(FX_UINT8 iter = 0; iter < oldscale - newscale - 1; iter++) {
+ for(uint8_t iter = 0; iter < oldscale - newscale - 1; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
}
}
@@ -4723,19 +4723,19 @@ void CFX_Decimal::SetScale(FX_UINT8 newscale) plo += m_uLo;
fxmath_decimal_helper_normalize(phi, pmid, plo);
{
- for(FX_UINT8 iter = 0; iter < oldscale - newscale; iter++) {
+ for(uint8_t iter = 0; iter < oldscale - newscale; iter++) {
fxmath_decimal_helper_div10(phi, pmid, plo);
}
}
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale);
}
}
-FX_UINT8 CFX_Decimal::GetScale()
+uint8_t CFX_Decimal::GetScale()
{
- FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
return oldscale;
}
void CFX_Decimal::SetAbs()
@@ -4750,7 +4750,7 @@ void CFX_Decimal::SetNegate() }
void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor)
{
- FX_UINT64 nums[3] = {m_uLo, m_uMid, m_uHi};
+ uint64_t nums[3] = {m_uLo, m_uMid, m_uHi};
FX_BOOL bDataLoss = FALSE;
for(int i = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i --) {
bDataLoss = fxmath_decimal_helper_div10_any(nums, 3) || bDataLoss;
@@ -4758,9 +4758,9 @@ void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) if(bDataLoss && (bFloor ? FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) : !FXMATH_DECIMAL_FLAGS2NEG(m_uFlags))) {
fxmath_decimal_helper_inc_any(nums, 3);
}
- m_uHi = (FX_UINT32)nums[2];
- m_uMid = (FX_UINT32)nums[1];
- m_uLo = (FX_UINT32)nums[0];
+ m_uHi = (uint32_t)nums[2];
+ m_uMid = (uint32_t)nums[1];
+ m_uLo = (uint32_t)nums[0];
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), 0);
}
void CFX_Decimal::SetFloor()
@@ -4777,7 +4777,7 @@ void CFX_Decimal::SetTruncate() }
void CFX_Decimal::Swap(CFX_Decimal& val)
{
- FX_UINT32 tmp;
+ uint32_t tmp;
tmp = m_uHi;
m_uHi = val.m_uHi;
val.m_uHi = tmp;
@@ -4791,12 +4791,12 @@ void CFX_Decimal::Swap(CFX_Decimal& val) m_uFlags = val.m_uFlags;
val.m_uFlags = tmp;
}
-FX_INT8 CFX_Decimal::Compare (const CFX_Decimal& val) const
+int8_t CFX_Decimal::Compare (const CFX_Decimal& val) const
{
CFX_Decimal lhs = *this, rhs = val;
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) {
- FX_UINT8 scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
+ uint8_t scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
lhs.SetScale(scale);
rhs.SetScale(scale);
}
@@ -4811,7 +4811,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co {
CFX_Decimal lhs = *this, rhs = val;
if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) {
- FX_UINT8 scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
+ uint8_t scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
lhs.SetScale(scale);
rhs.SetScale(scale);
}
@@ -4820,7 +4820,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co }
FX_BOOL doRawAdd = (FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags) == FXMATH_DECIMAL_FLAGS2NEG(rhs.m_uFlags));
if (doRawAdd) {
- FX_UINT64 phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo;
+ uint64_t phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo;
phi += rhs.m_uHi;
pmid += rhs.m_uMid;
plo += rhs.m_uLo;
@@ -4829,9 +4829,9 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co fxmath_decimal_helper_div10(phi, pmid, plo);
lhs.m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) - 1);
}
- lhs.m_uHi = (FX_UINT32)phi;
- lhs.m_uMid = (FX_UINT32)pmid;
- lhs.m_uLo = (FX_UINT32)plo;
+ lhs.m_uHi = (uint32_t)phi;
+ lhs.m_uMid = (uint32_t)pmid;
+ lhs.m_uLo = (uint32_t)plo;
return lhs;
} else {
if(fxmath_decimal_helper_raw_compare(lhs.m_uHi, lhs.m_uMid, lhs.m_uLo, rhs.m_uHi, rhs.m_uMid, rhs.m_uLo) < 0) {
@@ -4854,13 +4854,13 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co }
CFX_Decimal CFX_Decimal::Multiply(const CFX_Decimal& val) const
{
- FX_UINT64 a[3] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi};
- FX_UINT64 c[6];
+ uint64_t a[3] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi};
+ uint64_t c[6];
fxmath_decimal_helper_raw_mul(a, 3, b, 3, c, 6);
FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
- FX_UINT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) + FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
+ uint8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) + FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale);
- return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale);
+ return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale);
}
CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const
{
@@ -4868,8 +4868,8 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const return CFX_Decimal();
}
FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
- FX_UINT64 a[7] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0};
- FX_UINT8 scale = 0;
+ uint64_t a[7] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0};
+ uint8_t scale = 0;
if(FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) < FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags)) {
for(int i = FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i--) {
fxmath_decimal_helper_mul10_any(a, 7);
@@ -4877,7 +4877,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const } else {
scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
}
- FX_UINT8 minscale = scale;
+ uint8_t minscale = scale;
if(!IsNotZero()) {
return CFX_Decimal(0, 0, 0, 0, minscale);
}
@@ -4890,7 +4890,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const fxmath_decimal_helper_raw_div(a, 6, b, 3, c, 7);
fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale);
fxmath_decimal_helper_truncate(c[2], c[1], c[0], scale, minscale);
- return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale);
+ return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale);
}
CFX_Decimal CFX_Decimal::Modulus(const CFX_Decimal& val) const
{
diff --git a/xfa/src/fgas/src/localization/fx_localeimp.h b/xfa/src/fgas/src/localization/fx_localeimp.h index c7d534d106..8dfec2e862 100644 --- a/xfa/src/fgas/src/localization/fx_localeimp.h +++ b/xfa/src/fgas/src/localization/fx_localeimp.h @@ -20,8 +20,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const;
virtual void GetTimeZone(FX_TIMEZONE& tz) const;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const;
@@ -63,7 +63,7 @@ public: protected:
virtual ~CFX_FormatString();
IFX_Locale* GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern);
- IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern);
+ IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern);
FX_BOOL FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
FX_BOOL FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern, IFX_Locale*& pLocale, CFX_WideString &wsDatePattern, CFX_WideString &wsTimePattern);
diff --git a/xfa/src/fgas/src/localization/fx_localemgr.cpp b/xfa/src/fgas/src/localization/fx_localemgr.cpp index 3b93f101a3..b3f0e80d7a 100644 --- a/xfa/src/fgas/src/localization/fx_localemgr.cpp +++ b/xfa/src/fgas/src/localization/fx_localemgr.cpp @@ -38,10 +38,10 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(FX_LPCWSTR pszLocalPath, FX_WORD wDefaultLCID CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid");
wchar_t* pEnd = NULL;
FX_DWORD dwLCID = wcstol(wsLCID, &pEnd, 16);
- if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)dwLCID)) {
+ if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)dwLCID)) {
delete pXmlLocale;
} else {
- pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(FX_UINTPTR)dwLCID, pXmlLocale);
+ pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(uintptr_t)dwLCID, pXmlLocale);
}
} else {
delete pXmlLocale;
@@ -84,12 +84,12 @@ IFX_Locale* CFX_LocaleMgr::GetDefLocale() }
IFX_Locale* CFX_LocaleMgr::GetLocale(FX_WORD lcid)
{
- IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid);
+ IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(uintptr_t)lcid);
if (!pLocale) {
- CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid);
+ CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)lcid);
if (pxml) {
pLocale = IFX_Locale::Create(pxml);
- m_lcid2locale.SetAt((FX_LPVOID)(FX_UINTPTR)lcid, pLocale);
+ m_lcid2locale.SetAt((FX_LPVOID)(uintptr_t)lcid, pLocale);
}
}
return pLocale;
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp index b41ee3fef4..fedf89f9f9 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp +++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp @@ -34,7 +34,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead *pFile, FX_DWORD dwStart, FX_DWORD d return FALSE;
}
m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE);
- m_pBuf = FX_Alloc(FX_BYTE, m_dwBufSize);
+ m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!m_pBuf) {
return FALSE;
}
@@ -72,7 +72,7 @@ void CFX_SAXFile::Reset() }
#define FX_SAXCHARTYPE_Normal 0
#define FX_SAXCHARTYPE_Space 1
-static FX_BYTE g_SAX_CharType[256] = {
+static uint8_t g_SAX_CharType[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -102,8 +102,8 @@ CFX_SAXReader::CFX_SAXReader() , m_pCommentContext(NULL)
, m_dwParseMode(0)
{
- m_pszData = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iDataSize);
- m_pszName = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iNameSize);
+ m_pszData = (FX_LPBYTE)FX_Alloc(uint8_t, m_iDataSize);
+ m_pszName = (FX_LPBYTE)FX_Alloc(uint8_t, m_iNameSize);
}
CFX_SAXReader::~CFX_SAXReader()
{
@@ -159,12 +159,12 @@ inline void CFX_SAXReader::Pop() delete m_pCurItem;
m_pCurItem = pPrev;
}
-inline void CFX_SAXReader::AppendData(FX_BYTE ch)
+inline void CFX_SAXReader::AppendData(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos++] = ch;
}
-inline void CFX_SAXReader::AppendName(FX_BYTE ch)
+inline void CFX_SAXReader::AppendName(uint8_t ch)
{
ReallocNameBuffer();
m_pszName[m_iDataPos++] = ch;
@@ -179,7 +179,7 @@ void CFX_SAXReader::ReallocDataBuffer() } else {
m_iDataSize += 1024 * 1024;
}
- m_pszData = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszData, m_iDataSize);
+ m_pszData = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszData, m_iDataSize);
}
void CFX_SAXReader::ReallocNameBuffer()
{
@@ -191,13 +191,13 @@ void CFX_SAXReader::ReallocNameBuffer() } else {
m_iNameSize += 1024 * 1024;
}
- m_pszName = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszName, m_iNameSize);
+ m_pszName = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszName, m_iNameSize);
}
-inline FX_BOOL CFX_SAXReader::SkipSpace(FX_BYTE ch)
+inline FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch)
{
return (m_dwParseMode & FX_SAXPARSEMODE_NotSkipSpace) == 0 && ch < 0x21;
}
-FX_INT32 CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
+int32_t CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
{
m_iState = -1;
Reset();
@@ -231,7 +231,7 @@ static const FX_SAXReader_LPFParse g_FX_SAXReader_LPFParse[FX_SAXMODE_MAX] = { &CFX_SAXReader::ParseTagEnd,
&CFX_SAXReader::ParseTargetData,
};
-FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
+int32_t CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
{
if (m_iState < 0 || m_iState > 99) {
return m_iState;
@@ -261,21 +261,21 @@ FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause ) }
return m_iState;
}
-void CFX_SAXReader::ParseChar(FX_BYTE ch)
+void CFX_SAXReader::ParseChar(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos] = ch;
if (m_iEntityStart > -1 && ch == ';') {
- FX_INT32 iSaveEntityStart = m_iEntityStart;
+ int32_t iSaveEntityStart = m_iEntityStart;
CFX_ByteString csEntity(m_pszData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1);
- FX_INT32 iLen = csEntity.GetLength();
+ int32_t iLen = csEntity.GetLength();
if (iLen > 0) {
if (csEntity[0] == '#') {
if ((m_dwParseMode & FX_SAXPARSEMODE_NotConvert_sharp) == 0) {
ch = 0;
- FX_BYTE w;
+ uint8_t w;
if (iLen > 1 && csEntity[1] == 'x') {
- for (FX_INT32 i = 2; i < iLen; i ++) {
+ for (int32_t i = 2; i < iLen; i ++) {
w = csEntity[i];
if (w >= '0' && w <= '9') {
ch = (ch << 4) + w - '0';
@@ -288,7 +288,7 @@ void CFX_SAXReader::ParseChar(FX_BYTE ch) }
}
} else {
- for (FX_INT32 i = 1; i < iLen; i ++) {
+ for (int32_t i = 1; i < iLen; i ++) {
w = csEntity[i];
if (w < '0' || w > '9') {
break;
@@ -592,7 +592,7 @@ void CFX_SAXReader::ParseTargetData() }
void CFX_SAXReader::SkipNode()
{
- FX_INT32 iLen = m_SkipStack.GetSize();
+ int32_t iLen = m_SkipStack.GetSize();
if (m_SkipChar == '\'' || m_SkipChar == '\"') {
if (m_CurByte != m_SkipChar) {
return;
@@ -633,12 +633,12 @@ void CFX_SAXReader::SkipNode() m_iDataLength = m_iDataPos;
m_iDataPos = 0;
if (m_iDataLength >= 9
- && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(FX_BYTE)) == 0
- && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(FX_BYTE)) == 0) {
+ && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(uint8_t)) == 0
+ && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(uint8_t)) == 0) {
Pop();
m_iDataLength -= 9;
m_dwDataOffset += 7;
- FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(FX_BYTE));
+ FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(uint8_t));
m_bCharData = TRUE;
if (m_pHandler) {
NotifyData();
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/src/xml/fx_sax_imp.h index 444bcbdf8e..a2f7259235 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.h +++ b/xfa/src/fgas/src/xml/fx_sax_imp.h @@ -63,8 +63,8 @@ public: , m_iTailCount(0)
{
}
- FX_INT32 m_iHeaderCount;
- FX_INT32 m_iTailCount;
+ int32_t m_iHeaderCount;
+ int32_t m_iTailCount;
};
class CFX_SAXReader : public IFX_SAXReader
{
@@ -75,12 +75,12 @@ public: {
delete this;
}
- virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
- virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL);
+ virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
+ virtual int32_t ContinueParse(IFX_Pause *pPause = NULL);
virtual void SkipCurrentNode();
virtual void SetHandler(IFX_SAXReaderHandler *pHandler);
- void AppendData(FX_BYTE ch);
- void AppendName(FX_BYTE ch);
+ void AppendData(uint8_t ch);
+ void AppendName(uint8_t ch);
void ParseText();
void ParseNodeStart();
void ParseInstruction();
@@ -99,32 +99,32 @@ public: protected:
CFX_SAXFile m_File;
IFX_SAXReaderHandler* m_pHandler;
- FX_INT32 m_iState;
+ int32_t m_iState;
CFX_SAXItem* m_pRoot;
CFX_SAXItem* m_pCurItem;
FX_DWORD m_dwItemID;
FX_SAXMODE m_eMode;
FX_SAXMODE m_ePrevMode;
FX_BOOL m_bCharData;
- FX_BYTE m_CurByte;
+ uint8_t m_CurByte;
FX_DWORD m_dwDataOffset;
CFX_ByteArray m_SkipStack;
- FX_BYTE m_SkipChar;
+ uint8_t m_SkipChar;
FX_DWORD m_dwNodePos;
FX_LPBYTE m_pszData;
- FX_INT32 m_iDataSize;
- FX_INT32 m_iDataLength;
- FX_INT32 m_iEntityStart;
- FX_INT32 m_iDataPos;
+ int32_t m_iDataSize;
+ int32_t m_iDataLength;
+ int32_t m_iEntityStart;
+ int32_t m_iDataPos;
FX_LPBYTE m_pszName;
- FX_INT32 m_iNameSize;
- FX_INT32 m_iNameLength;
+ int32_t m_iNameSize;
+ int32_t m_iNameLength;
FX_DWORD m_dwParseMode;
CFX_SAXCommentContext *m_pCommentContext;
void Reset();
void Push();
void Pop();
- FX_BOOL SkipSpace(FX_BYTE ch);
+ FX_BOOL SkipSpace(uint8_t ch);
void SkipNode();
void NotifyData();
void NotifyEnter();
@@ -135,6 +135,6 @@ protected: void NotifyTargetData();
void ReallocDataBuffer();
void ReallocNameBuffer();
- void ParseChar(FX_BYTE ch);
+ void ParseChar(uint8_t ch);
};
#endif
diff --git a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp index 8ac141a686..cc7ffd9f54 100644 --- a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp @@ -113,7 +113,7 @@ FWL_ERR CFWL_BarcodeImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *p if (pMatrix) {
mt.Concat(*pMatrix);
}
- FX_INT32 errorCode = 0;
+ int32_t errorCode = 0;
_FWL_RETURN_VALUE_IF_FAIL(m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), pMatrix, errorCode), FWL_ERR_Indefinite);
return FWL_ERR_Succeeded;
}
@@ -147,8 +147,8 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() if(pFontColor) {
m_pBarcodeEngine->SetFontColor(*pFontColor);
}
- m_pBarcodeEngine->SetHeight(FX_INT32(m_rtClient.height));
- m_pBarcodeEngine->SetWidth(FX_INT32(m_rtClient.width));
+ m_pBarcodeEngine->SetHeight(int32_t(m_rtClient.height));
+ m_pBarcodeEngine->SetWidth(int32_t(m_rtClient.width));
FX_DWORD dwAttributeMask = pData->GetBarcodeAttributeMask();
if (dwAttributeMask & FWL_BCDATTRIBUTE_CHARENCODING) {
m_pBarcodeEngine->SetCharEncoding (pData->GetCharEncoding());
@@ -189,7 +189,7 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() if (dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED) {
m_pBarcodeEngine->SetTruncated (pData->GetTruncated());
}
- FX_INT32 errorCode = 0;
+ int32_t errorCode = 0;
m_dwStatus = m_pBarcodeEngine->Encode(wsText, TRUE, errorCode) ? XFA_BCS_EncodeSuccess : 0;
}
void CFWL_BarcodeImp::CreateBarcodeEngine()
diff --git a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp index f8c7d09eb2..b0307e883f 100644 --- a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp @@ -165,7 +165,7 @@ CFWL_CaretImp::CFWL_CaretTimer::CFWL_CaretTimer(CFWL_CaretImp *m_pCaret) {
this->m_pCaret = m_pCaret;
}
-FX_INT32 CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer)
+int32_t CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer)
{
if (m_pCaret->GetStates() & FWL_STATE_CAT_HightLight) {
m_pCaret->SetStates(FWL_STATE_CAT_HightLight, FALSE);
@@ -182,7 +182,7 @@ CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
return 1;
}
diff --git a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp index 89311b39f2..1ba0851bb6 100644 --- a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp @@ -38,11 +38,11 @@ FWL_ERR IFWL_CheckBox::Initialize(const CFWL_WidgetImpProperties &properties, IF ((CFWL_CheckBoxImp*)m_pData)->SetInterface(this);
return ((CFWL_CheckBoxImp*)m_pData)->Initialize();
}
-FX_INT32 IFWL_CheckBox::GetCheckState()
+int32_t IFWL_CheckBox::GetCheckState()
{
return ((CFWL_CheckBoxImp*)m_pData)->GetCheckState();
}
-FWL_ERR IFWL_CheckBox::SetCheckState(FX_INT32 iCheck)
+FWL_ERR IFWL_CheckBox::SetCheckState(int32_t iCheck)
{
return ((CFWL_CheckBoxImp*)m_pData)->SetCheckState(iCheck);
}
@@ -174,7 +174,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * if (HasEdge()) {
DrawEdge(pGraphics, FWL_PART_CKB_Edge, pTheme, pMatrix);
}
- FX_INT32 dwStates = GetPartStates();
+ int32_t dwStates = GetPartStates();
{
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
@@ -197,7 +197,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * {
CFX_WideString wsCaption;
m_pProperties->m_pDataProvider->GetCaption(m_pInterface, wsCaption);
- FX_INT32 iLen = wsCaption.GetLength();
+ int32_t iLen = wsCaption.GetLength();
_FWL_RETURN_VALUE_IF_FAIL(iLen > 0, FWL_ERR_Indefinite);
CFWL_ThemeText textParam;
textParam.m_pWidget = m_pInterface;
@@ -215,7 +215,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * }
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_CheckBoxImp::GetCheckState()
+int32_t CFWL_CheckBoxImp::GetCheckState()
{
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_3State)
&& ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Neutral)) {
@@ -226,7 +226,7 @@ FX_INT32 CFWL_CheckBoxImp::GetCheckState() }
return 0;
}
-FWL_ERR CFWL_CheckBoxImp::SetCheckState(FX_INT32 iCheck)
+FWL_ERR CFWL_CheckBoxImp::SetCheckState(int32_t iCheck)
{
m_pProperties->m_dwStates &= ~FWL_STATE_CKB_CheckMask;
switch(iCheck) {
@@ -251,8 +251,8 @@ FWL_ERR CFWL_CheckBoxImp::SetCheckState(FX_INT32 iCheck) }
void CFWL_CheckBoxImp::Layout()
{
- FX_INT32 width = FX_INT32(m_pProperties->m_rtWidget.width + 0.5f);
- FX_INT32 height = FX_INT32(m_pProperties->m_rtWidget.height + 0.5f);
+ int32_t width = int32_t(m_pProperties->m_rtWidget.width + 0.5f);
+ int32_t height = int32_t(m_pProperties->m_rtWidget.height + 0.5f);
m_pProperties->m_rtWidget.width = (FX_FLOAT)width;
m_pProperties->m_rtWidget.height = (FX_FLOAT)height;
GetClientRect(m_rtClient);
@@ -322,7 +322,7 @@ void CFWL_CheckBoxImp::Layout() }
FX_DWORD CFWL_CheckBoxImp::GetPartStates()
{
- FX_INT32 dwStates = FWL_PARTSTATE_CKB_UnChecked;
+ int32_t dwStates = FWL_PARTSTATE_CKB_UnChecked;
if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Neutral) {
dwStates = FWL_PARTSTATE_CKB_Neutral;
} else if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Checked) {
@@ -406,8 +406,8 @@ void CFWL_CheckBoxImp::NextStates() CFX_PtrArray radioarr;
pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr);
IFWL_CheckBox *pCheckBox = NULL;
- FX_INT32 iCount = radioarr.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = radioarr.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
pCheckBox = (IFWL_CheckBox *)radioarr[i];
if (pCheckBox != m_pInterface && pCheckBox->GetStates() & FWL_STATE_CKB_Checked) {
pCheckBox->SetCheckState(0);
@@ -449,11 +449,11 @@ CFWL_CheckBoxImpDelegate::CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_CheckBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_CheckBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_Activate: {
OnActivate(pMessage);
diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp index 0200f92eaa..5658f87e13 100644 --- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp @@ -45,11 +45,11 @@ FWL_ERR IFWL_ComboBox::Initialize(const CFWL_WidgetImpProperties &properties, IF ((CFWL_ComboBoxImp*)m_pData)->SetInterface(this);
return ((CFWL_ComboBoxImp*)m_pData)->Initialize();
}
-FX_INT32 IFWL_ComboBox::GetCurSel()
+int32_t IFWL_ComboBox::GetCurSel()
{
return ((CFWL_ComboBoxImp*)m_pData)->GetCurSel();
}
-FWL_ERR IFWL_ComboBox::SetCurSel(FX_INT32 iSel)
+FWL_ERR IFWL_ComboBox::SetCurSel(int32_t iSel)
{
return ((CFWL_ComboBoxImp*)m_pData)->SetCurSel(iSel);
}
@@ -57,31 +57,31 @@ FWL_ERR IFWL_ComboBox::SetEditText(const CFX_WideString &wsText) {
return ((CFWL_ComboBoxImp*)m_pData)->SetEditText(wsText);
}
-FX_INT32 IFWL_ComboBox::GetEditTextLength() const
+int32_t IFWL_ComboBox::GetEditTextLength() const
{
return ((CFWL_ComboBoxImp*)m_pData)->GetEditTextLength();
}
-FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
return ((CFWL_ComboBoxImp*)m_pData)->GetEditText(wsText, nStart, nCount);
}
-FWL_ERR IFWL_ComboBox::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR IFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount)
{
return ((CFWL_ComboBoxImp*)m_pData)->SetEditSelRange(nStart, nCount);
}
-FX_INT32 IFWL_ComboBox::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t IFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t &nStart)
{
return ((CFWL_ComboBoxImp*)m_pData)->GetEditSelRange(nIndex, nStart);
}
-FX_INT32 IFWL_ComboBox::GetEditLimit()
+int32_t IFWL_ComboBox::GetEditLimit()
{
return ((CFWL_ComboBoxImp*)m_pData)->GetEditLimit();
}
-FWL_ERR IFWL_ComboBox::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR IFWL_ComboBox::SetEditLimit(int32_t nLimit)
{
return ((CFWL_ComboBoxImp*)m_pData)->SetEditLimit(nLimit);
}
-FWL_ERR IFWL_ComboBox::EditDoClipboard(FX_INT32 iCmd)
+FWL_ERR IFWL_ComboBox::EditDoClipboard(int32_t iCmd)
{
return ((CFWL_ComboBoxImp*)m_pData)->EditDoClipboard(iCmd);
}
@@ -185,7 +185,7 @@ CFWL_ComboEditDelegate::CFWL_ComboEditDelegate(CFWL_ComboEdit *pOwner) , m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ComboEditDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ComboEditDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
@@ -276,15 +276,15 @@ FWL_ERR CFWL_ComboList::Finalize() }
return CFWL_ListBoxImp::Finalize();
}
-FX_INT32 CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch)
+int32_t CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch)
{
if (wsMatch.IsEmpty()) {
return -1;
}
_FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, -1);
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
CFX_WideString wsText;
pData->GetItemText(m_pInterface, hItem, wsText);
@@ -295,7 +295,7 @@ FX_INT32 CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch) }
return -1;
}
-void CFWL_ComboList::ChangeSelected(FX_INT32 iSel)
+void CFWL_ComboList::ChangeSelected(int32_t iSel)
{
_FWL_RETURN_IF_FAIL(m_pProperties->m_pDataProvider);
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
@@ -303,7 +303,7 @@ void CFWL_ComboList::ChangeSelected(FX_INT32 iSel) CFX_RectF rtInvalidate;
rtInvalidate.Reset();
FWL_HLISTITEM hOld = GetSelItem(0);
- FX_INT32 iOld = pData->GetItemIndex(m_pInterface, hOld);
+ int32_t iOld = pData->GetItemIndex(m_pInterface, hOld);
if (iOld == iSel) {
return;
} else if (iOld > -1) {
@@ -321,13 +321,13 @@ void CFWL_ComboList::ChangeSelected(FX_INT32 iSel) Repaint(&rtInvalidate);
}
}
-FX_INT32 CFWL_ComboList::CountItems()
+int32_t CFWL_ComboList::CountItems()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, 0);
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
return pData->CountItems(m_pInterface);
}
-void CFWL_ComboList::GetItemRect(FX_INT32 nIndex, CFX_RectF &rtItem)
+void CFWL_ComboList::GetItemRect(int32_t nIndex, CFX_RectF &rtItem)
{
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, nIndex);
@@ -349,7 +349,7 @@ CFWL_ComboListDelegate::CFWL_ComboListDelegate(CFWL_ComboList *pOwner) , m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ComboListDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ComboListDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwHashCode = pMessage->GetClassID();
@@ -407,7 +407,7 @@ void CFWL_ComboListDelegate::OnDropListFocusChanged(CFWL_Message *pMsg, FX_BOOL }
}
}
-FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg)
+int32_t CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg)
{
if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
if (m_pOwner->m_bNotifyOwner) {
@@ -424,7 +424,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) if (hItem) {
_FWL_RETURN_VALUE_IF_FAIL(m_pOwner->m_pProperties->m_pDataProvider, 0);
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pOwner->m_pProperties->m_pDataProvider;
- FX_INT32 iSel = pData->GetItemIndex(m_pOwner->m_pInterface, hItem);
+ int32_t iSel = pData->GetItemIndex(m_pOwner->m_pInterface, hItem);
CFWL_EvtCmbHoverChanged event;
event.m_pSrcTarget = m_pOwner->m_pOuter;
event.m_iCurHover = iSel;
@@ -438,7 +438,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) }
return 1;
}
-FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg)
+int32_t CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg)
{
if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
return 0;
@@ -447,7 +447,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg) pOuter->ShowDropList(FALSE);
return 1;
}
-FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg)
+int32_t CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg)
{
CFWL_ComboBoxImp *pOuter = (CFWL_ComboBoxImp*)((IFWL_TargetData*)m_pOwner->m_pOuter)->GetData();
if (m_pOwner->m_bNotifyOwner) {
@@ -469,7 +469,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg) }
return 1;
}
-FX_INT32 CFWL_ComboListDelegate::OnDropListKey(CFWL_MsgKey *pKey)
+int32_t CFWL_ComboListDelegate::OnDropListKey(CFWL_MsgKey *pKey)
{
CFWL_ComboBoxImp *pOuter = (CFWL_ComboBoxImp*)((IFWL_TargetData*)m_pOwner->m_pOuter)->GetData();
FX_BOOL bPropagate = FALSE;
@@ -783,13 +783,13 @@ FWL_ERR CFWL_ComboBoxImp::SetThemeProvider(IFWL_ThemeProvider *pThemeProvider) }
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ComboBoxImp::GetCurSel()
+int32_t CFWL_ComboBoxImp::GetCurSel()
{
return m_iCurSel;
}
-FWL_ERR CFWL_ComboBoxImp::SetCurSel(FX_INT32 iSel)
+FWL_ERR CFWL_ComboBoxImp::SetCurSel(int32_t iSel)
{
- FX_INT32 iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->CountItems();
+ int32_t iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->CountItems();
FX_BOOL bClearSel = iSel < 0 || iSel >= iCount;
FX_BOOL bDropDown = IsDropDownStyle();
if (bDropDown && m_pEdit) {
@@ -824,12 +824,12 @@ FWL_ERR CFWL_ComboBoxImp::SetEditText(const CFX_WideString &wsText) m_pEdit->SetText(wsText);
return m_pEdit->Update();
}
-FX_INT32 CFWL_ComboBoxImp::GetEditTextLength() const
+int32_t CFWL_ComboBoxImp::GetEditTextLength() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1);
return m_pEdit->GetTextLength();
}
-FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart , FX_INT32 nCount ) const
+FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, int32_t nStart , int32_t nCount ) const
{
if (m_pEdit) {
return m_pEdit->GetText(wsText, nStart, nCount);
@@ -840,29 +840,29 @@ FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart , }
return FWL_ERR_Indefinite;
}
-FWL_ERR CFWL_ComboBoxImp::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount )
+FWL_ERR CFWL_ComboBoxImp::SetEditSelRange(int32_t nStart, int32_t nCount )
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite);
((CFWL_ComboEdit*)((IFWL_TargetData*)m_pEdit)->GetData())->ClearSelected();
m_pEdit->AddSelRange(nStart, nCount);
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ComboBoxImp::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFWL_ComboBoxImp::GetEditSelRange(int32_t nIndex, int32_t &nStart)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1);
return m_pEdit->GetSelRange(nIndex, nStart);
}
-FX_INT32 CFWL_ComboBoxImp::GetEditLimit()
+int32_t CFWL_ComboBoxImp::GetEditLimit()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1);
return m_pEdit->GetLimit();
}
-FWL_ERR CFWL_ComboBoxImp::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_ComboBoxImp::SetEditLimit(int32_t nLimit)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite);
return m_pEdit->SetLimit(nLimit);
}
-FWL_ERR CFWL_ComboBoxImp::EditDoClipboard(FX_INT32 iCmd)
+FWL_ERR CFWL_ComboBoxImp::EditDoClipboard(int32_t iCmd)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite);
return m_pEdit->DoClipboard(iCmd);
@@ -1080,7 +1080,7 @@ void CFWL_ComboBoxImp::MatchEditText() {
CFX_WideString wsText;
m_pEdit->GetText(wsText);
- FX_INT32 iMatch = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->MatchItem(wsText);
+ int32_t iMatch = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->MatchItem(wsText);
if (iMatch != m_iCurSel) {
((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->ChangeSelected(iMatch);
if (iMatch >= 0) {
@@ -1091,7 +1091,7 @@ void CFWL_ComboBoxImp::MatchEditText() }
m_iCurSel = iMatch;
}
-void CFWL_ComboBoxImp::SynchrEditText(FX_INT32 iListItem)
+void CFWL_ComboBoxImp::SynchrEditText(int32_t iListItem)
{
CFX_WideString wsText;
IFWL_ComboBoxDP *pData = (IFWL_ComboBoxDP *)m_pProperties->m_pDataProvider;
@@ -1301,7 +1301,7 @@ void CFWL_ComboBoxImp::DisForm_ShowDropList(FX_BOOL bActivate) preEvent.m_pSrcTarget = m_pInterface;
DispatchEvent(&preEvent);
CFWL_ComboList* pComboList = (CFWL_ComboList*)(((IFWL_TargetData*)m_pListBox)->GetData());
- FX_INT32 iItems = pComboList->CountItems();
+ int32_t iItems = pComboList->CountItems();
if (iItems < 1) {
return;
}
@@ -1482,7 +1482,7 @@ CFWL_ComboBoxImpDelegate::CFWL_ComboBoxImpDelegate(CFWL_ComboBoxImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ComboBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ComboBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
return DisForm_OnProcessMessage(pMessage);
@@ -1620,7 +1620,7 @@ void CFWL_ComboBoxImpDelegate::OnLButtonUp(CFWL_MsgMouse *pMsg) }
void CFWL_ComboBoxImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg)
{
- FX_INT32 iOldState = m_pOwner->m_iBtnState;
+ int32_t iOldState = m_pOwner->m_iBtnState;
if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) {
m_pOwner->m_iBtnState = m_pOwner->m_bLButtonDown ? FWL_PARTSTATE_CMB_Pressed : FWL_PARTSTATE_CMB_Hovered;
} else {
@@ -1657,12 +1657,12 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey *pMsg) FX_BOOL bUp = dwKeyCode == FWL_VKEY_Up;
FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down;
if (bUp || bDown) {
- FX_INT32 iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pOwner->m_pListBox)->GetData())->CountItems();
+ int32_t iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pOwner->m_pListBox)->GetData())->CountItems();
if (iCount < 1) {
return;
}
FX_BOOL bMatchEqual = FALSE;
- FX_INT32 iCurSel = m_pOwner->m_iCurSel;
+ int32_t iCurSel = m_pOwner->m_iCurSel;
FX_BOOL bDropDown = m_pOwner->IsDropDownStyle();
if (bDropDown && m_pOwner->m_pEdit) {
CFX_WideString wsText;
@@ -1702,7 +1702,7 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey *pMsg) pDelegate->OnProcessMessage(pMsg);
}
}
-FX_INT32 CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
@@ -1810,12 +1810,12 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey *pMsg) FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down;
if (bUp || bDown) {
CFWL_ComboList* pComboList = ((CFWL_ComboList*)((IFWL_TargetData*)(m_pOwner->m_pListBox))->GetData());
- FX_INT32 iCount = pComboList->CountItems();
+ int32_t iCount = pComboList->CountItems();
if (iCount < 1) {
return;
}
FX_BOOL bMatchEqual = FALSE;
- FX_INT32 iCurSel = m_pOwner->m_iCurSel;
+ int32_t iCurSel = m_pOwner->m_iCurSel;
if (m_pOwner->m_pEdit) {
CFX_WideString wsText;
m_pOwner->m_pEdit->GetText(wsText);
@@ -1856,7 +1856,7 @@ CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate(IFWL_Form *pForm, CFWL_Co , m_fStartPos(0)
{
}
-FX_INT32 CFWL_ComboProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ComboProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
diff --git a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp index b3e3b45dae..c9f3367114 100644 --- a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp @@ -62,19 +62,19 @@ FWL_ERR IFWL_DateTimePicker::Initialize(const CFWL_WidgetImpProperties &properti ((CFWL_DateTimePickerImp*)m_pData)->SetInterface(this);
return ((CFWL_DateTimePickerImp*)m_pData)->Initialize();
}
-FX_INT32 IFWL_DateTimePicker::CountSelRanges()
+int32_t IFWL_DateTimePicker::CountSelRanges()
{
return ((CFWL_DateTimePickerImp*)m_pData)->GetDataTimeEdit()->CountSelRanges();
}
-FX_INT32 IFWL_DateTimePicker::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t &nStart)
{
return ((CFWL_DateTimePickerImp*)m_pData)->GetDataTimeEdit()->GetSelRange(nIndex, nStart);
}
-FWL_ERR IFWL_DateTimePicker::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FWL_ERR IFWL_DateTimePicker::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
return ((CFWL_DateTimePickerImp*)m_pData)->GetCurSel(iYear, iMonth, iDay);
}
-FWL_ERR IFWL_DateTimePicker::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FWL_ERR IFWL_DateTimePicker::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay)
{
return ((CFWL_DateTimePickerImp*)m_pData)->SetCurSel(iYear, iMonth, iDay);
}
@@ -82,7 +82,7 @@ FWL_ERR IFWL_DateTimePicker::SetEditText(const CFX_WideString &wsText) {
return ((CFWL_DateTimePickerImp*)m_pData)->SetEditText(wsText);
}
-FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
return ((CFWL_DateTimePickerImp*)m_pData)->GetEditText(wsText, nStart, nCount);
}
@@ -142,7 +142,7 @@ FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF &rect) {
return ((CFWL_DateTimePickerImp*)m_pData)->GetBBox(rect);
}
-FWL_ERR IFWL_DateTimePicker::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit)
{
return ((CFWL_DateTimePickerImp*)m_pData)->SetEditLimit(nLimit);
}
@@ -173,7 +173,7 @@ CFWL_DateTimeEditDelegate::CFWL_DateTimeEditDelegate(CFWL_DateTimeEdit *pOwner) , m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
return DisForm_OnProcessMessage(pMessage);
@@ -186,7 +186,7 @@ FX_INT32 CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage) }
return 1;
}
-FX_INT32 CFWL_DateTimeEditDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_DateTimeEditDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
{
FX_DWORD dwHashCode = pMessage->GetClassID();
if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
@@ -238,7 +238,7 @@ CFWL_DateTimeCalendarDelegate::CFWL_DateTimeCalendarDelegate(CFWL_DateTimeCalend {
m_bFlag = FALSE;
}
-FX_INT32 CFWL_DateTimeCalendarDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_DateTimeCalendarDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
FX_DWORD dwCode = pMessage->GetClassID();
if (dwCode == FWL_MSGHASH_SetFocus || dwCode == FWL_MSGHASH_KillFocus) {
@@ -298,11 +298,11 @@ void CFWL_DateTimeCalendarDelegate::OnLButtonUpEx(CFWL_MsgMouse *pMsg) if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) {
return;
}
- FX_INT32 iOldSel = 0;
+ int32_t iOldSel = 0;
if (m_pOwner->m_arrSelDays.GetSize() > 0) {
iOldSel = m_pOwner->m_arrSelDays[0];
}
- FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
CFX_RectF rt;
IFWL_DateTimePicker *pIPicker = (IFWL_DateTimePicker *)m_pOwner->m_pOuter;
CFWL_DateTimePickerImp *pPicker = (CFWL_DateTimePickerImp *)((IFWL_TargetData *)pIPicker)->GetData();
@@ -335,7 +335,7 @@ void CFWL_DateTimeCalendarDelegate::OnMouseMoveEx(CFWL_MsgMouse *pMsg) CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, 0, 0);
if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
- FX_INT32 iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
bRepaint = m_pOwner->m_iHovered != iHover;
if (bRepaint) {
if (m_pOwner->m_iHovered > 0) {
@@ -366,7 +366,7 @@ void CFWL_DateTimeCalendarDelegate::OnMouseMoveEx(CFWL_MsgMouse *pMsg) m_pOwner->Repaint(&rtInvalidate);
}
}
-FX_INT32 CFWL_DateTimeCalendarDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_DateTimeCalendarDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage)
{
if (pMessage->GetClassID() == FWL_MSGHASH_Mouse) {
CFWL_MsgMouse *pMsg = (CFWL_MsgMouse*)pMessage;
@@ -392,11 +392,11 @@ void CFWL_DateTimeCalendarDelegate::DisForm_OnLButtonUpEx(CFWL_MsgMouse *pMsg) if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) {
return;
}
- FX_INT32 iOldSel = 0;
+ int32_t iOldSel = 0;
if (m_pOwner->m_arrSelDays.GetSize() > 0) {
iOldSel = m_pOwner->m_arrSelDays[0];
}
- FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
if (iCurSel > 0) {
LPDATEINFO lpDatesInfo = (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iCurSel - 1);
CFX_RectF rtInvalidate(lpDatesInfo->rect);
@@ -599,14 +599,14 @@ FWL_ERR CFWL_DateTimePickerImp::SetThemeProvider(IFWL_ThemeProvider *pTP) m_pMonthCal->SetThemeProvider(pTP);
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_DateTimePickerImp::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FWL_ERR CFWL_DateTimePickerImp::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
iYear = m_iYear;
iMonth = m_iMonth;
iDay = m_iDay;
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_DateTimePickerImp::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FWL_ERR CFWL_DateTimePickerImp::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay)
{
_FWL_RETURN_VALUE_IF_FAIL(iYear > 0 && iYear < 3000, FWL_ERR_Indefinite);
_FWL_RETURN_VALUE_IF_FAIL(iMonth > 0 && iMonth < 13, FWL_ERR_Indefinite);
@@ -620,14 +620,14 @@ FWL_ERR CFWL_DateTimePickerImp::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_IN FWL_ERR CFWL_DateTimePickerImp::SetEditText(const CFX_WideString &wsText)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite);
- FX_INT32 iRet = m_pEdit->SetText(wsText);
+ int32_t iRet = m_pEdit->SetText(wsText);
Repaint(&m_rtClient);
CFWL_Event_DtpEditChanged ev;
ev.m_wsText = wsText;
DispatchEvent(&ev);
return iRet;
}
-FWL_ERR CFWL_DateTimePickerImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR CFWL_DateTimePickerImp::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
if (m_pEdit) {
return m_pEdit->GetText(wsText, nStart, nCount);
@@ -652,7 +652,7 @@ FX_BOOL CFWL_DateTimePickerImp::Redo() }
FX_BOOL CFWL_DateTimePickerImp::CanCopy()
{
- FX_INT32 nCount = m_pEdit->CountSelRanges();
+ int32_t nCount = m_pEdit->CountSelRanges();
return nCount > 0;
}
FX_BOOL CFWL_DateTimePickerImp::CanCut()
@@ -660,7 +660,7 @@ FX_BOOL CFWL_DateTimePickerImp::CanCut() if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {
return FALSE;
}
- FX_INT32 nCount = m_pEdit->CountSelRanges();
+ int32_t nCount = m_pEdit->CountSelRanges();
return nCount > 0;
}
FX_BOOL CFWL_DateTimePickerImp::CanSelectAll()
@@ -705,7 +705,7 @@ FWL_ERR CFWL_DateTimePickerImp::GetBBox(CFX_RectF &rect) }
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(int32_t nLimit)
{
return m_pEdit->SetLimit(nLimit);
}
@@ -735,7 +735,7 @@ void CFWL_DateTimePickerImp::DrawDropDownButton(CFX_Graphics *pGraphics, IFWL_Th pTheme->DrawBackground(¶m);
}
}
-void CFWL_DateTimePickerImp::FormatDateString(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsText)
+void CFWL_DateTimePickerImp::FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsText)
{
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) == FWL_STYLEEXT_DTP_ShortDateFormat) {
wsText.Format(FX_LPCWSTR(L"%d-%d-%d"), iYear, iMonth, iDay);
@@ -823,7 +823,7 @@ void CFWL_DateTimePickerImp::ReSetEditAlignment() FWL_STYLEEXT_EDT_HAlignModeMask |
FWL_STYLEEXT_EDT_VAlignMask);
}
-void CFWL_DateTimePickerImp::ProcessSelChanged(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+void CFWL_DateTimePickerImp::ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay)
{
m_iYear = iYear;
m_iMonth = iMonth;
@@ -1054,11 +1054,11 @@ CFWL_DateTimePickerImpDelegate::CFWL_DateTimePickerImpDelegate(CFWL_DateTimePick : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
case FWL_MSGHASH_KillFocus: {
diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp index c7bd922fc1..0afa1d5467 100644 --- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp @@ -45,11 +45,11 @@ FWL_ERR IFWL_Edit::SetText(const CFX_WideString &wsText) {
return ((CFWL_EditImp*)m_pData)->SetText(wsText);
}
-FX_INT32 IFWL_Edit::GetTextLength() const
+int32_t IFWL_Edit::GetTextLength() const
{
return ((CFWL_EditImp*)m_pData)->GetTextLength();
}
-FWL_ERR IFWL_Edit::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR IFWL_Edit::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
return ((CFWL_EditImp*)m_pData)->GetText(wsText, nStart, nCount);
}
@@ -57,23 +57,23 @@ FWL_ERR IFWL_Edit::ClearText() {
return ((CFWL_EditImp*)m_pData)->ClearText();
}
-FX_INT32 IFWL_Edit::GetCaretPos() const
+int32_t IFWL_Edit::GetCaretPos() const
{
return ((CFWL_EditImp*)m_pData)->GetCaretPos();
}
-FX_INT32 IFWL_Edit::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore)
+int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore)
{
return ((CFWL_EditImp*)m_pData)->SetCaretPos(nIndex, bBefore);
}
-FWL_ERR IFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR IFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount)
{
return ((CFWL_EditImp*)m_pData)->AddSelRange(nStart, nCount);
}
-FX_INT32 IFWL_Edit::CountSelRanges()
+int32_t IFWL_Edit::CountSelRanges()
{
return ((CFWL_EditImp*)m_pData)->CountSelRanges();
}
-FX_INT32 IFWL_Edit::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t IFWL_Edit::GetSelRange(int32_t nIndex, int32_t &nStart)
{
return ((CFWL_EditImp*)m_pData)->GetSelRange(nIndex, nStart);
}
@@ -81,11 +81,11 @@ FWL_ERR IFWL_Edit::ClearSelections() {
return ((CFWL_EditImp*)m_pData)->ClearSelections();
}
-FX_INT32 IFWL_Edit::GetLimit()
+int32_t IFWL_Edit::GetLimit()
{
return ((CFWL_EditImp*)m_pData)->GetLimit();
}
-FWL_ERR IFWL_Edit::SetLimit(FX_INT32 nLimit)
+FWL_ERR IFWL_Edit::SetLimit(int32_t nLimit)
{
return ((CFWL_EditImp*)m_pData)->SetLimit(nLimit);
}
@@ -97,7 +97,7 @@ FWL_ERR IFWL_Edit::SetFormatString(const CFX_WideString &wsFormat) {
return ((CFWL_EditImp*)m_pData)->SetFormatString(wsFormat);
}
-FWL_ERR IFWL_Edit::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen)
+FWL_ERR IFWL_Edit::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen)
{
return ((CFWL_EditImp*)m_pData)->Insert(nStart, lpText, nLen);
}
@@ -105,7 +105,7 @@ FWL_ERR IFWL_Edit::DeleteSelections() {
return ((CFWL_EditImp*)m_pData)->DeleteSelections();
}
-FWL_ERR IFWL_Edit::DeleteRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR IFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount)
{
return ((CFWL_EditImp*)m_pData)->DeleteRange(nStart, nCount);
}
@@ -113,11 +113,11 @@ FWL_ERR IFWL_Edit::ReplaceSelections(const CFX_WideStringC &wsReplace) {
return ((CFWL_EditImp*)m_pData)->ReplaceSelections(wsReplace);
}
-FWL_ERR IFWL_Edit::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace)
+FWL_ERR IFWL_Edit::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace)
{
return ((CFWL_EditImp*)m_pData)->Replace(nStart, nLen, wsReplace);
}
-FWL_ERR IFWL_Edit::DoClipboard(FX_INT32 iCmd)
+FWL_ERR IFWL_Edit::DoClipboard(int32_t iCmd)
{
return ((CFWL_EditImp*)m_pData)->DoClipboard(iCmd);
}
@@ -169,7 +169,7 @@ FWL_ERR IFWL_Edit::SetOuter(IFWL_Widget *pOuter) {
return ((CFWL_EditImp*)m_pData)->SetOuter(pOuter);
}
-FWL_ERR IFWL_Edit::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax)
+FWL_ERR IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax)
{
return ((CFWL_EditImp*)m_pData)->SetNumberRange(iMin, iMax);
}
@@ -313,7 +313,7 @@ FWL_ERR CFWL_EditImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (m_pEdtEngine) {
- FX_INT32 iTextLen = m_pEdtEngine->GetTextLength();
+ int32_t iTextLen = m_pEdtEngine->GetTextLength();
if (iTextLen > 0) {
CFX_WideString wsText;
m_pEdtEngine->GetText(wsText, 0);
@@ -398,12 +398,12 @@ static void AddSquigglyPath(CFX_Path& PathData, FX_FLOAT fStartX, FX_FLOAT fEndX {
PathData.MoveTo(fStartX, fY);
FX_FLOAT fx;
- FX_INT32 i;
+ int32_t i;
for (i = 1, fx = fStartX + fStep; fx < fEndX; fx += fStep, i++) {
PathData.LineTo(fx, fY + (i & 1)*fStep);
}
}
-void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT32 nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY)
+void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, int32_t nStart, int32_t nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY)
{
FX_FLOAT fStartX = 0.0f;
FX_FLOAT fEndX = 0.0f;
@@ -424,14 +424,14 @@ void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT3 AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep);
}
}
-FX_INT32 CFWL_EditImp::GetWordAtPoint(CFX_PointF pointf, FX_INT32& nCount)
+int32_t CFWL_EditImp::GetWordAtPoint(CFX_PointF pointf, int32_t& nCount)
{
return 0;
}
FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray &sSuggest)
{
- FX_INT32 nWordCount = 0;
- FX_INT32 nWordStart = GetWordAtPoint(pointf, nWordCount);
+ int32_t nWordCount = 0;
+ int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
if (nWordCount < 1) {
return FALSE;
}
@@ -465,8 +465,8 @@ FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray &sS }
FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf, FX_BSTR bsReplace)
{
- FX_INT32 nWordCount = 0;
- FX_INT32 nWordStart = GetWordAtPoint(pointf, nWordCount);
+ int32_t nWordCount = 0;
+ int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
if (nWordCount < 1) {
return FALSE;
}
@@ -478,10 +478,10 @@ FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf, FX_BSTR bsReplace break;
}
}
- FX_INT32 nDestLen = bsReplace.GetLength();
+ int32_t nDestLen = bsReplace.GetLength();
CFX_WideString wsDest;
FX_LPWSTR pBuffer = wsDest.GetBuffer(nDestLen);
- for (FX_INT32 i = 0; i < nDestLen; i++) {
+ for (int32_t i = 0; i < nDestLen; i++) {
pBuffer[i] = bsReplace[i];
}
wsDest.ReleaseBuffer(nDestLen);
@@ -502,12 +502,12 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics *pGraphics, const CFX_Matrix *pMa CFX_ByteString sLatinWord;
CFX_Path pathSpell;
pathSpell.Create();
- FX_INT32 nStart = 0;
+ int32_t nStart = 0;
FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX;
FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset;
CFX_WideString wsSpell;
this->GetText(wsSpell);
- FX_INT32 nContentLen = wsSpell.GetLength();
+ int32_t nContentLen = wsSpell.GetLength();
for (int i = 0; i < nContentLen; i++) {
if (FX_EDIT_ISLATINWORD(wsSpell[i])) {
if (sLatinWord.IsEmpty()) {
@@ -590,12 +590,12 @@ FWL_ERR CFWL_EditImp::SetText(const CFX_WideString &wsText) m_pEdtEngine->SetText(wsText);
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_EditImp::GetTextLength() const
+int32_t CFWL_EditImp::GetTextLength() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1);
return m_pEdtEngine->GetTextLength();
}
-FWL_ERR CFWL_EditImp::GetText(CFX_WideString &wsText, FX_INT32 nStart , FX_INT32 nCount ) const
+FWL_ERR CFWL_EditImp::GetText(CFX_WideString &wsText, int32_t nStart , int32_t nCount ) const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
m_pEdtEngine->GetText(wsText, nStart, nCount);
@@ -607,29 +607,29 @@ FWL_ERR CFWL_EditImp::ClearText() m_pEdtEngine->ClearText();
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_EditImp::GetCaretPos() const
+int32_t CFWL_EditImp::GetCaretPos() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1);
return m_pEdtEngine->GetCaretPos();
}
-FX_INT32 CFWL_EditImp::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore )
+int32_t CFWL_EditImp::SetCaretPos(int32_t nIndex, FX_BOOL bBefore )
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1);
return m_pEdtEngine->SetCaretPos(nIndex, bBefore);
}
-FWL_ERR CFWL_EditImp::AddSelRange(FX_INT32 nStart, FX_INT32 nCount )
+FWL_ERR CFWL_EditImp::AddSelRange(int32_t nStart, int32_t nCount )
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
m_pEdtEngine->AddSelRange(nStart, nCount);
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_EditImp::CountSelRanges()
+int32_t CFWL_EditImp::CountSelRanges()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, 0);
return m_pEdtEngine->CountSelRanges();
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_EditImp::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFWL_EditImp::GetSelRange(int32_t nIndex, int32_t &nStart)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1);
return m_pEdtEngine->GetSelRange(nIndex, nStart);
@@ -640,11 +640,11 @@ FWL_ERR CFWL_EditImp::ClearSelections() m_pEdtEngine->ClearSelection();
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_EditImp::GetLimit()
+int32_t CFWL_EditImp::GetLimit()
{
return m_nLimit;
}
-FWL_ERR CFWL_EditImp::SetLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_EditImp::SetLimit(int32_t nLimit)
{
m_nLimit = nLimit;
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
@@ -663,7 +663,7 @@ FWL_ERR CFWL_EditImp::SetFormatString(const CFX_WideString &wsFormat) m_pEdtEngine->SetFormatBlock(0, wsFormat);
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_EditImp::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen)
+FWL_ERR CFWL_EditImp::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
if ( (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly)
@@ -676,13 +676,13 @@ FWL_ERR CFWL_EditImp::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen) FWL_ERR CFWL_EditImp::DeleteSelections()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
- FX_INT32 iCount = m_pEdtEngine->CountSelRanges();
+ int32_t iCount = m_pEdtEngine->CountSelRanges();
if (iCount > 0) {
m_pEdtEngine->Delete(-1);
}
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_EditImp::DeleteRange(FX_INT32 nStart, FX_INT32 nCount )
+FWL_ERR CFWL_EditImp::DeleteRange(int32_t nStart, int32_t nCount )
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
m_pEdtEngine->DeleteRange(nStart, nCount);
@@ -691,21 +691,21 @@ FWL_ERR CFWL_EditImp::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) FWL_ERR CFWL_EditImp::ReplaceSelections(const CFX_WideStringC &wsReplace)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
- FX_INT32 iCount = m_pEdtEngine->CountSelRanges();
+ int32_t iCount = m_pEdtEngine->CountSelRanges();
for (int i = 0; i < iCount; i ++) {
- FX_INT32 nStart;
- FX_INT32 nCount = m_pEdtEngine->GetSelRange(i, nStart);
+ int32_t nStart;
+ int32_t nCount = m_pEdtEngine->GetSelRange(i, nStart);
m_pEdtEngine->Replace(nStart, nCount, wsReplace);
}
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_EditImp::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace)
+FWL_ERR CFWL_EditImp::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
m_pEdtEngine->Replace(nStart, nLen, wsReplace);
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd)
+FWL_ERR CFWL_EditImp::DoClipboard(int32_t iCmd)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded);
if ( (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly)
@@ -719,8 +719,8 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) CFX_WideString wsText;
switch(iCmd) {
case 1: {
- FX_INT32 nStart;
- FX_INT32 nCount = m_pEdtEngine->GetSelRange(0, nStart);
+ int32_t nStart;
+ int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart);
if (nCount < 1) {
break;
}
@@ -729,8 +729,8 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) break;
}
case 2: {
- FX_INT32 nStart;
- FX_INT32 nCount = m_pEdtEngine->GetSelRange(0, nStart);
+ int32_t nStart;
+ int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart);
if (nCount < 1) {
break;
}
@@ -742,7 +742,7 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) }
case 3: {
pClipBorder->GetStringData(wsText);
- FX_INT32 iLen = wsText.GetLength();
+ int32_t iLen = wsText.GetLength();
if (iLen < 0) {
break;
}
@@ -753,7 +753,7 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) iLen --;
wsText = wsText.Left(iLen);
}
- FX_INT32 nPos = m_pEdtEngine->GetCaretPos();
+ int32_t nPos = m_pEdtEngine->GetCaretPos();
m_pEdtEngine->Insert(nPos, wsText, iLen);
break;
}
@@ -765,14 +765,14 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) FX_BOOL CFWL_EditImp::Copy(CFX_WideString &wsCopy)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE);
- FX_INT32 nCount = m_pEdtEngine->CountSelRanges();
+ int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount == 0) {
return FALSE;
}
wsCopy.Empty();
CFX_WideString wsTemp;
- FX_INT32 nStart, nLength;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nStart, nLength;
+ for (int32_t i = 0; i < nCount; i ++) {
nLength = m_pEdtEngine->GetSelRange(i, nStart);
m_pEdtEngine->GetText(wsTemp, nStart, nLength);
wsCopy += wsTemp;
@@ -783,14 +783,14 @@ FX_BOOL CFWL_EditImp::Copy(CFX_WideString &wsCopy) FX_BOOL CFWL_EditImp::Cut(CFX_WideString &wsCut)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE);
- FX_INT32 nCount = m_pEdtEngine->CountSelRanges();
+ int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount == 0) {
return FALSE;
}
wsCut.Empty();
CFX_WideString wsTemp;
- FX_INT32 nStart, nLength;
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nStart, nLength;
+ for (int32_t i = 0; i < nCount; i ++) {
nLength = m_pEdtEngine->GetSelRange(i, nStart);
m_pEdtEngine->GetText(wsTemp, nStart, nLength);
wsCut += wsTemp;
@@ -802,8 +802,8 @@ FX_BOOL CFWL_EditImp::Cut(CFX_WideString &wsCut) FX_BOOL CFWL_EditImp::Paste(const CFX_WideString &wsPaste)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE);
- FX_INT32 nCaret = m_pEdtEngine->GetCaretPos();
- FX_INT32 iError = m_pEdtEngine->Insert(nCaret, FX_LPCWSTR(wsPaste), wsPaste.GetLength());
+ int32_t nCaret = m_pEdtEngine->GetCaretPos();
+ int32_t iError = m_pEdtEngine->Insert(nCaret, FX_LPCWSTR(wsPaste), wsPaste.GetLength());
if (iError < 0) {
ProcessInsertError(iError);
return FALSE;
@@ -813,7 +813,7 @@ FX_BOOL CFWL_EditImp::Paste(const CFX_WideString &wsPaste) FX_BOOL CFWL_EditImp::Delete()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE);
- FX_INT32 nCount = m_pEdtEngine->CountSelRanges();
+ int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount < 1) {
return FALSE;
}
@@ -873,14 +873,14 @@ FWL_ERR CFWL_EditImp::SetOuter(IFWL_Widget *pOuter) m_pOuter = pOuter;
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_EditImp::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax)
+FWL_ERR CFWL_EditImp::SetNumberRange(int32_t iMin, int32_t iMax)
{
m_iMin = iMin;
m_iMax = iMax;
m_bSetRange = TRUE;
return FWL_ERR_Succeeded;
}
-void CFWL_EditImp::On_CaretChanged(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPage, FX_BOOL bVisible )
+void CFWL_EditImp::On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible )
{
if (m_rtEngine.IsEmpty()) {
return;
@@ -973,7 +973,7 @@ void CFWL_EditImp::On_SelChanged(IFDE_TxtEdtEngine *pEdit) GetClientRect(rtTemp);
Repaint(&rtTemp);
}
-FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose)
+FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose)
{
IFDE_TxtEdtEngine *pEdtEngine = m_pEdtEngine;
IFDE_TxtEdtPage *pPage = pEdtEngine->GetPage(nPageIndex);
@@ -981,7 +981,7 @@ FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, pPage->LoadPage();
return TRUE;
}
-FX_BOOL CFWL_EditImp::On_PageUnload(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose)
+FX_BOOL CFWL_EditImp::On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose)
{
IFDE_TxtEdtEngine *pEdtEngine = m_pEdtEngine;
IFDE_TxtEdtPage *pPage = pEdtEngine->GetPage(nPageIndex);
@@ -1001,16 +1001,16 @@ void CFWL_EditImp::On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, FX_BSTR bsDoRecord) evt.m_wsDoRecord = bsDoRecord;
m_pDelegate->OnProcessEvent(&evt);
}
-FX_BOOL CFWL_EditImp::On_ValidateField(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \
- const CFX_WideString &wsFieldText, FX_INT32 nCharIndex)
+FX_BOOL CFWL_EditImp::On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \
+ const CFX_WideString &wsFieldText, int32_t nCharIndex)
{
return TRUE;
}
-FX_BOOL CFWL_EditImp::On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex)
+FX_BOOL CFWL_EditImp::On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex)
{
return TRUE;
}
-FX_BOOL CFWL_EditImp::On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText)
+FX_BOOL CFWL_EditImp::On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText)
{
return FALSE;
}
@@ -1100,26 +1100,26 @@ void CFWL_EditImp::DrawContent(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe bShowSel = (pForm->GetStates() & FWL_WGTSTATE_Deactivated) != FWL_WGTSTATE_Deactivated;
}
}
- FX_INT32 nSelCount = m_pEdtEngine->CountSelRanges();
+ int32_t nSelCount = m_pEdtEngine->CountSelRanges();
if (bShowSel && nSelCount > 0) {
- FX_INT32 nPageCharStart = pPage->GetCharStart();
- FX_INT32 nPageCharCount = pPage->GetCharCount();
- FX_INT32 nPageCharEnd = nPageCharStart + nPageCharCount - 1;
- FX_INT32 nCharCount;
- FX_INT32 nCharStart;
+ int32_t nPageCharStart = pPage->GetCharStart();
+ int32_t nPageCharCount = pPage->GetCharCount();
+ int32_t nPageCharEnd = nPageCharStart + nPageCharCount - 1;
+ int32_t nCharCount;
+ int32_t nCharStart;
CFX_RectFArray rectArr;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nSelCount; i ++) {
nCharCount = m_pEdtEngine->GetSelRange(i, nCharStart);
- FX_INT32 nCharEnd = nCharStart + nCharCount - 1;
+ int32_t nCharEnd = nCharStart + nCharCount - 1;
if (nCharEnd < nPageCharStart || nCharStart > nPageCharEnd) {
continue;
}
- FX_INT32 nBgn = FX_MAX(nCharStart, nPageCharStart);
- FX_INT32 nEnd = FX_MIN(nCharEnd, nPageCharEnd);
+ int32_t nBgn = FX_MAX(nCharStart, nPageCharStart);
+ int32_t nEnd = FX_MIN(nCharEnd, nPageCharEnd);
pPage->CalcRangeRectArray(nBgn - nPageCharStart, nEnd - nBgn + 1, rectArr);
}
- FX_INT32 nCount = rectArr.GetSize();
+ int32_t nCount = rectArr.GetSize();
CFX_Path path;
path.Create();
for (i = 0; i < nCount; i ++) {
@@ -1154,10 +1154,10 @@ void CFWL_EditImp::DrawContent(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe pGraphics->RestoreGraphState();
CFX_Path path;
path.Create();
- FX_INT32 iLimit = m_nLimit > 0 ? m_nLimit : 1;
+ int32_t iLimit = m_nLimit > 0 ? m_nLimit : 1;
FX_FLOAT fStep = m_rtEngine.width / iLimit;
FX_FLOAT fLeft = m_rtEngine.left + 1;
- for (FX_INT32 i = 1; i < iLimit; i++) {
+ for (int32_t i = 1; i < iLimit; i++) {
fLeft += fStep;
path.AddLine(fLeft, m_rtClient.top, fLeft, m_rtClient.bottom());
}
@@ -1276,7 +1276,7 @@ void CFWL_EditImp::UpdateEditParams() _FWL_RETURN_IF_FAIL(pFont);
params.pFont = pFont;
params.fFontSize = m_fFontSize;
- params.nLineCount = (FX_INT32)(params.fPlateHeight / params.fLineSpace);
+ params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace);
if (params.nLineCount <= 0) {
params.nLineCount = 1;
}
@@ -1533,16 +1533,16 @@ FX_BOOL CFWL_EditImp::IsContentHeightOverflow() _FWL_RETURN_VALUE_IF_FAIL(pPage, FALSE);
return pPage->GetContentsBox().height > m_rtEngine.height + 1.0f;
}
-FX_INT32 CFWL_EditImp::AddDoRecord(FX_BSTR bsDoRecord)
+int32_t CFWL_EditImp::AddDoRecord(FX_BSTR bsDoRecord)
{
- FX_INT32 nCount = m_RecordArr.GetSize();
+ int32_t nCount = m_RecordArr.GetSize();
if (m_iCurRecord == nCount - 1) {
if (nCount == m_iMaxRecord) {
m_RecordArr.RemoveAt(0);
m_iCurRecord --;
}
} else {
- for (FX_INT32 i = nCount - 1; i > m_iCurRecord; i --) {
+ for (int32_t i = nCount - 1; i > m_iCurRecord; i --) {
m_RecordArr.RemoveAt(i);
}
}
@@ -1731,13 +1731,13 @@ FX_BOOL CFWL_EditImp::ValidateNumberChar(FX_WCHAR cNum) }
return TRUE;
}
- FX_INT32 caretPos = m_pEdtEngine->GetCaretPos();
- FX_INT32 iSel = CountSelRanges();
+ int32_t caretPos = m_pEdtEngine->GetCaretPos();
+ int32_t iSel = CountSelRanges();
if (iSel == 0) {
if (cNum == L'0' && caretPos == 0) {
return FALSE;
}
- FX_INT32 nLen = wsText.GetLength();
+ int32_t nLen = wsText.GetLength();
CFX_WideString l = wsText.Mid(0, caretPos);
CFX_WideString r = wsText.Mid(caretPos, nLen - caretPos);
CFX_WideString wsNew = l + cNum + r;
@@ -1770,7 +1770,7 @@ void CFWL_EditImp::ClearRecord() m_iCurRecord = -1;
m_RecordArr.RemoveAll();
}
-void CFWL_EditImp::ProcessInsertError(FX_INT32 iError)
+void CFWL_EditImp::ProcessInsertError(int32_t iError)
{
switch (iError) {
case -2: {
@@ -1787,11 +1787,11 @@ CFWL_EditImpDelegate::CFWL_EditImpDelegate(CFWL_EditImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_Activate: {
DoActivate((CFWL_MsgActivate*)pMessage);
@@ -1895,7 +1895,7 @@ void CFWL_EditImpDelegate::DoButtonDown(CFWL_MsgMouse *pMsg) pt.Set(pMsg->m_fx, pMsg->m_fy);
m_pOwner->DeviceToEngine(pt);
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = pPage->GetCharIndex(pt, bBefore);
+ int32_t nIndex = pPage->GetCharIndex(pt, bBefore);
if (nIndex < 0) {
nIndex = 0;
}
@@ -1917,7 +1917,7 @@ void CFWL_EditImpDelegate::OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet) m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
m_pOwner->ShowCaret(FALSE);
if (m_pOwner->m_pEdtEngine && (dwStyleEx & FWL_STYLEEXT_EDT_NoHideSel) == 0) {
- FX_INT32 nSel = m_pOwner->CountSelRanges();
+ int32_t nSel = m_pOwner->CountSelRanges();
if (nSel > 0) {
m_pOwner->ClearSelections();
bRepaint = TRUE;
@@ -1946,17 +1946,17 @@ void CFWL_EditImpDelegate::OnLButtonDown(CFWL_MsgMouse *pMsg) m_pOwner->m_bLButtonDown = TRUE;
m_pOwner->SetGrab(TRUE);
DoButtonDown(pMsg);
- FX_INT32 nIndex = m_pOwner->m_pEdtEngine->GetCaretPos();
+ int32_t nIndex = m_pOwner->m_pEdtEngine->GetCaretPos();
FX_BOOL bRepaint = FALSE;
- FX_INT32 iCount = m_pOwner->m_pEdtEngine->CountSelRanges();
+ int32_t iCount = m_pOwner->m_pEdtEngine->CountSelRanges();
if (iCount > 0) {
m_pOwner->m_pEdtEngine->ClearSelection();
bRepaint = TRUE;
}
FX_BOOL bShift = pMsg->m_dwFlags & FWL_KEYFLAG_Shift;
if (bShift && m_pOwner->m_nSelStart != nIndex) {
- FX_INT32 iStart = FX_MIN(m_pOwner->m_nSelStart, nIndex);
- FX_INT32 iEnd = FX_MAX(m_pOwner->m_nSelStart, nIndex);
+ int32_t iStart = FX_MIN(m_pOwner->m_nSelStart, nIndex);
+ int32_t iEnd = FX_MAX(m_pOwner->m_nSelStart, nIndex);
m_pOwner->m_pEdtEngine->AddSelRange(iStart, iEnd - iStart);
bRepaint = TRUE;
} else {
@@ -1981,8 +1981,8 @@ void CFWL_EditImpDelegate::OnButtonDblClk(CFWL_MsgMouse *pMsg) CFX_PointF pt;
pt.Set(pMsg->m_fx, pMsg->m_fy);
m_pOwner->DeviceToEngine(pt);
- FX_INT32 nCount = 0;
- FX_INT32 nIndex = pPage->SelectWord(pt, nCount);
+ int32_t nCount = 0;
+ int32_t nIndex = pPage->SelectWord(pt, nCount);
if (nIndex < 0) {
return;
}
@@ -2003,12 +2003,12 @@ void CFWL_EditImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg) pt.Set(pMsg->m_fx, pMsg->m_fy);
m_pOwner->DeviceToEngine(pt);
FX_BOOL bBefore = TRUE;
- FX_INT32 nIndex = pPage->GetCharIndex(pt, bBefore);
+ int32_t nIndex = pPage->GetCharIndex(pt, bBefore);
m_pOwner->m_pEdtEngine->SetCaretPos(nIndex, bBefore);
nIndex = m_pOwner->m_pEdtEngine->GetCaretPos();
m_pOwner->m_pEdtEngine->ClearSelection();
if (nIndex != m_pOwner->m_nSelStart) {
- FX_INT32 nLen = m_pOwner->m_pEdtEngine->GetTextLength();
+ int32_t nLen = m_pOwner->m_pEdtEngine->GetTextLength();
if (m_pOwner->m_nSelStart >= nLen) {
m_pOwner->m_nSelStart = nLen;
}
@@ -2063,7 +2063,7 @@ void CFWL_EditImpDelegate::OnKeyDown(CFWL_MsgKey *pMsg) || (m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) {
break;
}
- FX_INT32 nCaret = m_pOwner->m_pEdtEngine->GetCaretPos();
+ int32_t nCaret = m_pOwner->m_pEdtEngine->GetCaretPos();
#if (_FX_OS_==_FX_MACOSX_)
m_pOwner->m_pEdtEngine->Delete(nCaret, TRUE);
#else
@@ -2111,9 +2111,9 @@ void CFWL_EditImpDelegate::OnChar(CFWL_MsgKey *pMsg) return;
}
_FWL_RETURN_IF_FAIL(m_pOwner->m_pEdtEngine);
- FX_INT32 iError = 0;
+ int32_t iError = 0;
FX_WCHAR c = (FX_WCHAR)pMsg->m_dwKeyCode;
- FX_INT32 nCaret = m_pOwner->m_pEdtEngine->GetCaretPos();
+ int32_t nCaret = m_pOwner->m_pEdtEngine->GetCaretPos();
switch (c) {
case FWL_VKEY_Back: {
m_pOwner->m_pEdtEngine->Delete(nCaret, TRUE);
diff --git a/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp b/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp index ced1fbe6f9..66714fcec7 100644 --- a/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp @@ -64,7 +64,7 @@ CFWL_FormProxyImpDelegate::CFWL_FormProxyImpDelegate(CFWL_FormProxyImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
IFWL_WidgetDelegate *pDelegate = m_pOwner->m_pOuter->SetDelegate(NULL);
return pDelegate->OnProcessMessage(pMessage);
diff --git a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp index bafb964ee6..8453f43f4b 100644 --- a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp @@ -38,15 +38,15 @@ FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties &properties, IFW ((CFWL_ListBoxImp*)m_pData)->SetInterface(this);
return ((CFWL_ListBoxImp*)m_pData)->Initialize();
}
-FX_INT32 IFWL_ListBox::CountSelItems()
+int32_t IFWL_ListBox::CountSelItems()
{
return ((CFWL_ListBoxImp*)m_pData)->CountSelItems();
}
-FWL_HLISTITEM IFWL_ListBox::GetSelItem(FX_INT32 nIndexSel)
+FWL_HLISTITEM IFWL_ListBox::GetSelItem(int32_t nIndexSel)
{
return ((CFWL_ListBoxImp*)m_pData)->GetSelItem(nIndexSel);
}
-FX_INT32 IFWL_ListBox::GetSelIndex(FX_INT32 nIndex)
+int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex)
{
return ((CFWL_ListBoxImp*)m_pData)->GetSelIndex(nIndex);
}
@@ -244,13 +244,13 @@ FWL_ERR CFWL_ListBoxImp::SetThemeProvider(IFWL_ThemeProvider *pThemeProvider) m_pProperties->m_pThemeProvider = pThemeProvider;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ListBoxImp::CountSelItems()
+int32_t CFWL_ListBoxImp::CountSelItems()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, 0);
- FX_INT32 iRet = 0;
+ int32_t iRet = 0;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
continue;
@@ -262,13 +262,13 @@ FX_INT32 CFWL_ListBoxImp::CountSelItems() }
return iRet;
}
-FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(FX_INT32 nIndexSel)
+FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(int32_t nIndexSel)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, NULL);
- FX_INT32 index = 0;
+ int32_t index = 0;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
return NULL;
@@ -284,13 +284,13 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(FX_INT32 nIndexSel) }
return NULL;
}
-FX_INT32 CFWL_ListBoxImp::GetSelIndex(FX_INT32 nIndex)
+int32_t CFWL_ListBoxImp::GetSelIndex(int32_t nIndex)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, -1);
- FX_INT32 index = 0;
+ int32_t index = 0;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
return -1;
@@ -346,9 +346,9 @@ FWL_ERR* CFWL_ListBoxImp::Sort(IFWL_ListBoxCompare *pCom) {
FWL_HLISTITEM hTemp;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 sz = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < sz - 1; i++) {
- for (FX_INT32 j = i + 1; j < sz; j++) {
+ int32_t sz = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < sz - 1; i++) {
+ for (int32_t j = i + 1; j < sz; j++) {
if (pCom->Compare(pData->GetItem(m_pInterface, i), pData->GetItem(m_pInterface, j)) > 0) {
hTemp = pData->GetItem(m_pInterface, i);
pData->SetItemIndex(m_pInterface, pData->GetItem(m_pInterface, j), i);
@@ -371,14 +371,14 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItem(FWL_HLISTITEM hItem, FX_DWORD dwKeyCode) FX_BOOL bHome = dwKeyCode == FWL_VKEY_Home;
FX_BOOL bEnd = dwKeyCode == FWL_VKEY_End;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iDstItem = -1;
+ int32_t iDstItem = -1;
if (bUp || bDown) {
- FX_INT32 index = pData->GetItemIndex(m_pInterface, hItem);
+ int32_t index = pData->GetItemIndex(m_pInterface, hItem);
iDstItem = dwKeyCode == FWL_VKEY_Up ? index - 1 : index + 1;
} else if (bHome) {
iDstItem = 0;
} else {
- FX_INT32 iCount = pData->CountItems(m_pInterface);
+ int32_t iCount = pData->CountItems(m_pInterface);
iDstItem = iCount - 1;
}
hRet = pData->GetItem(m_pInterface, iDstItem);
@@ -392,16 +392,16 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItem(FWL_HLISTITEM hItem, FX_DWORD dwKeyCode) void CFWL_ListBoxImp::SetSelection(FWL_HLISTITEM hStart, FWL_HLISTITEM hEnd, FX_BOOL bSelected)
{
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iStart = pData->GetItemIndex(m_pInterface, hStart);
- FX_INT32 iEnd = pData->GetItemIndex(m_pInterface, hEnd);
+ int32_t iStart = pData->GetItemIndex(m_pInterface, hStart);
+ int32_t iEnd = pData->GetItemIndex(m_pInterface, hEnd);
if (iStart > iEnd) {
- FX_INT32 iTemp = iStart;
+ int32_t iTemp = iStart;
iStart = iEnd;
iEnd = iTemp;
}
if (bSelected) {
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i++ ) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i++ ) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
SetSelectionDirect(hItem, FALSE);
}
@@ -429,8 +429,8 @@ void CFWL_ListBoxImp::ClearSelection() {
FX_BOOL bMulti = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i++ ) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i++ ) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
FX_DWORD dwState = pData->GetItemStyles(m_pInterface, hItem);
FX_BOOL bFindSel = dwState & FWL_ITEMSTATE_LTB_Selected;
@@ -450,7 +450,7 @@ void CFWL_ListBoxImp::SelectAll() return;
}
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
+ int32_t iCount = pData->CountItems(m_pInterface);
if (iCount > 0) {
FWL_HLISTITEM hItemStart = pData->GetItem(m_pInterface, 0);
FWL_HLISTITEM hItemEnd = pData->GetItem(m_pInterface, iCount - 1);
@@ -460,8 +460,8 @@ void CFWL_ListBoxImp::SelectAll() FWL_HLISTITEM CFWL_ListBoxImp::GetFocusedItem()
{
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
_FWL_RETURN_VALUE_IF_FAIL(hItem, NULL);
if (pData->GetItemStyles(m_pInterface, hItem) & FWL_ITEMSTATE_LTB_Focused) {
@@ -499,8 +499,8 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) fPosY = m_pVertScrollBar->GetPos();
}
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 nCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < nCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
continue;
@@ -610,8 +610,8 @@ void CFWL_ListBoxImp::DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTh }
FX_BOOL bMultiCol = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiColumn;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
continue;
@@ -641,7 +641,7 @@ void CFWL_ListBoxImp::DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTh }
}
}
-void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, FX_INT32 Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix )
+void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, int32_t Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix )
{
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
FX_DWORD dwItemStyles = pData->GetItemStyles(m_pInterface, hItem);
@@ -665,7 +665,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe param.m_pGraphics = pGraphics;
param.m_matrix.Concat(*pMatrix);
param.m_rtPart = rtItem;
- param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData);
+ param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData);
CFX_RectF rtFocus(rtItem);
param.m_pData = &rtFocus;
if (m_pVertScrollBar && !m_pHorzScrollBar && (dwPartStates & FWL_PARTSTATE_LTB_Focused)) {
@@ -688,7 +688,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe param.m_pGraphics = pGraphics;
param.m_matrix.Concat(*pMatrix);
param.m_rtPart = rtDIB;
- param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData);
+ param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData);
param.m_pImage = pDib;
pTheme->DrawBackground(¶m);
}
@@ -710,7 +710,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe }
param.m_matrix.Concat(*pMatrix);
param.m_rtPart = rtCheck;
- param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData);
+ param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData);
pTheme->DrawBackground(¶m);
}
CFX_WideString wsText;
@@ -733,7 +733,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe textParam.m_wsText = wsText;
textParam.m_dwTTOStyles = m_dwTTOStyles;
textParam.m_iTTOAlign = m_iTTOAligns;
- textParam.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData);
+ textParam.m_dwData = (FX_DWORD)(uintptr_t)(&itemData);
pTheme->DrawText(&textParam);
}
}
@@ -757,8 +757,8 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize ) IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
if (!bAutoSize) {
}
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
CFWL_ThemePart itemPart;
itemPart.m_pWidget = m_pInterface;
@@ -795,8 +795,8 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize ) if (bHasIcon) {
fWidth += m_fItemHeight;
}
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM htem = pData->GetItem(m_pInterface, i);
GetItemSize(fs, htem, fWidth, m_fItemHeight, bAutoSize);
}
@@ -917,8 +917,8 @@ FX_FLOAT CFWL_ListBoxImp::GetMaxTextWidth() {
FX_FLOAT fRet = 0.0f;
IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider;
- FX_INT32 iCount = pData->CountItems(m_pInterface);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = pData->CountItems(m_pInterface);
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
if (!hItem) {
continue;
@@ -974,8 +974,8 @@ void CFWL_ListBoxImp::ProcessSelChanged() CFWL_EvtLtbSelChanged selEvent;
selEvent.m_pSrcTarget = m_pInterface;
CFX_Int32Array arrSels;
- FX_INT32 iCount = CountSelItems();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = CountSelItems();
+ for (int32_t i = 0; i < iCount; i ++) {
FWL_HLISTITEM item = GetSelItem(i);
if (item == NULL) {
continue;
@@ -988,14 +988,14 @@ CFWL_ListBoxImpDelegate::CFWL_ListBoxImpDelegate(CFWL_ListBoxImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
if (!m_pOwner->IsEnabled()) {
return 1;
}
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
case FWL_MSGHASH_KillFocus: {
diff --git a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp index 39085d6e85..aed47639b2 100644 --- a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp @@ -44,15 +44,15 @@ FWL_ERR IFWL_MonthCalendar::Initialize(const CFWL_WidgetImpProperties &propertie ((CFWL_MonthCalendarImp*)m_pData)->SetInterface(this);
return ((CFWL_MonthCalendarImp*)m_pData)->Initialize();
}
-FX_INT32 IFWL_MonthCalendar::CountSelect()
+int32_t IFWL_MonthCalendar::CountSelect()
{
return ((CFWL_MonthCalendarImp*)m_pData)->CountSelect();
}
-FX_BOOL IFWL_MonthCalendar::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex)
+FX_BOOL IFWL_MonthCalendar::GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex)
{
return ((CFWL_MonthCalendarImp*)m_pData)->GetSelect(iYear, iMonth, iDay, nIndex);
}
-FX_BOOL IFWL_MonthCalendar::SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FX_BOOL IFWL_MonthCalendar::SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay)
{
return ((CFWL_MonthCalendarImp*)m_pData)->SetSelect(iYear, iMonth, iDay);
}
@@ -204,11 +204,11 @@ FWL_ERR CFWL_MonthCalendarImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Mat }
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_MonthCalendarImp::CountSelect()
+int32_t CFWL_MonthCalendarImp::CountSelect()
{
return m_arrSelDays.GetSize();
}
-FX_BOOL CFWL_MonthCalendarImp::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex )
+FX_BOOL CFWL_MonthCalendarImp::GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex )
{
if (nIndex >= m_arrSelDays.GetSize()) {
return FALSE;
@@ -218,7 +218,7 @@ FX_BOOL CFWL_MonthCalendarImp::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_I iDay = m_arrSelDays[nIndex];
return TRUE;
}
-FX_BOOL CFWL_MonthCalendarImp::SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FX_BOOL CFWL_MonthCalendarImp::SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay)
{
ChangeToMonth(iYear, iMonth);
return AddSelDay(iDay);
@@ -282,8 +282,8 @@ void CFWL_MonthCalendarImp::DrawCaption(CFX_Graphics *pGraphics, IFWL_ThemeProvi textParam.m_iPart = FWL_PART_MCD_Caption;
textParam.m_dwStates = FWL_PARTSTATE_MCD_Normal;
textParam.m_pGraphics = pGraphics;
- FX_INT32 iYear;
- FX_INT32 iMonth;
+ int32_t iYear;
+ int32_t iMonth;
iYear = m_iCurYear;
iMonth = m_iCurMonth;
CFX_WideString wsCation;
@@ -321,8 +321,8 @@ void CFWL_MonthCalendarImp::DrawDatesInBK(CFX_Graphics *pGraphics, IFWL_ThemePro if (pMatrix) {
params.m_matrix.Concat(*pMatrix);
}
- FX_INT32 iCount = m_arrDates.GetSize();
- for (FX_INT32 j = 0; j < iCount; j ++) {
+ int32_t iCount = m_arrDates.GetSize();
+ for (int32_t j = 0; j < iCount; j ++) {
LPDATEINFO pDataInfo = (LPDATEINFO)m_arrDates.GetAt(j);
if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Selected) {
params.m_dwStates |= FWL_PARTSTATE_MCD_Selected;
@@ -351,7 +351,7 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics *pGraphics, IFWL_ThemeProvider params.m_pGraphics = pGraphics;
params.m_dwStates = FWL_PARTSTATE_MCD_Normal;
params.m_iTTOAlign = FDE_TTOALIGNMENT_Center;
- FX_INT32 iWeek;
+ int32_t iWeek;
iWeek = m_pDateTime->GetDayOfWeek();
CFX_RectF rtDayOfWeek;
const FX_WCHAR* pWeekDay[] = {
@@ -361,7 +361,7 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics *pGraphics, IFWL_ThemeProvider if (pMatrix) {
params.m_matrix.Concat(*pMatrix);
}
- for (FX_INT32 i = 0; i < 7; i++) {
+ for (int32_t i = 0; i < 7; i++) {
rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2),
m_rtWeek.top,
m_szCell.x,
@@ -388,13 +388,13 @@ void CFWL_MonthCalendarImp::DrawWeekNumber(CFX_Graphics *pGraphics, IFWL_ThemePr if (pMatrix) {
params.m_matrix.Concat(*pMatrix);
}
- FX_INT32 iWeekNum = 0;
- FX_INT32 iMonthNum = m_pDateTime->GetMonth();
- FX_INT32 iDayNum = FX_DaysInMonth(m_iCurYear, iMonthNum);
- FX_INT32 iTemp = 0;
+ int32_t iWeekNum = 0;
+ int32_t iMonthNum = m_pDateTime->GetMonth();
+ int32_t iDayNum = FX_DaysInMonth(m_iCurYear, iMonthNum);
+ int32_t iTemp = 0;
FX_FLOAT fVStartPos = m_rtClient.top + m_fHeadHei + m_fHSepHei;
FX_FLOAT fHStartPos = m_rtClient.left;
- for (FX_INT32 i = 1; i <= iDayNum; i += 7) {
+ for (int32_t i = 1; i <= iDayNum; i += 7) {
iTemp ++;
iWeekNum = CalWeekNumber(m_iCurYear, iMonthNum, i);
m_rtWeekNum.Set(fHStartPos, fVStartPos + m_fDateCellHei * iTemp, m_fWeekNumWid, m_fDateCellHei);
@@ -453,8 +453,8 @@ void CFWL_MonthCalendarImp::DrawDatesIn(CFX_Graphics *pGraphics, IFWL_ThemeProvi if (pMatrix) {
params.m_matrix.Concat(*pMatrix);
}
- FX_INT32 iCount = m_arrDates.GetSize();
- for (FX_INT32 j = 0; j < iCount; j ++) {
+ int32_t iCount = m_arrDates.GetSize();
+ for (int32_t j = 0; j < iCount; j ++) {
LPDATEINFO pDataInfo = (LPDATEINFO)m_arrDates.GetAt(j);
params.m_wsText = pDataInfo->wsDay;
params.m_rtPart = pDataInfo->rect;
@@ -634,11 +634,11 @@ void CFWL_MonthCalendarImp::LayOut() void CFWL_MonthCalendarImp::CalDateItem()
{
FX_BOOL bNewWeek = FALSE;
- FX_INT32 iWeekOfMonth = 0;
+ int32_t iWeekOfMonth = 0;
FX_FLOAT fLeft = m_rtDates.left;
FX_FLOAT fTop = m_rtDates.top;
- FX_INT32 iCount = m_arrDates.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrDates.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(i);
if (bNewWeek) {
iWeekOfMonth ++;
@@ -694,30 +694,30 @@ void CFWL_MonthCalendarImp::GetCapValue() }
m_fMCHei = *(FX_FLOAT*)pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEIGHT);
}
-FX_INT32 CFWL_MonthCalendarImp::CalWeekNumber(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+int32_t CFWL_MonthCalendarImp::CalWeekNumber(int32_t iYear, int32_t iMonth, int32_t iDay)
{
return 0;
}
-FX_BOOL CFWL_MonthCalendarImp::GetMinDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FX_BOOL CFWL_MonthCalendarImp::GetMinDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
iYear = m_dtMin.iYear;
iMonth = m_dtMin.iMonth;
iDay = m_dtMin.iDay;
return TRUE;
}
-FX_BOOL CFWL_MonthCalendarImp::SetMinDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FX_BOOL CFWL_MonthCalendarImp::SetMinDate(int32_t iYear, int32_t iMonth, int32_t iDay)
{
m_dtMin = DATE(iYear, iMonth, iDay);
return TRUE;
}
-FX_BOOL CFWL_MonthCalendarImp::GetMaxDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FX_BOOL CFWL_MonthCalendarImp::GetMaxDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
iYear = m_dtMax.iYear;
iMonth = m_dtMax.iMonth;
iDay = m_dtMax.iDay;
return TRUE;
}
-FX_BOOL CFWL_MonthCalendarImp::SetMaxDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FX_BOOL CFWL_MonthCalendarImp::SetMaxDate(int32_t iYear, int32_t iMonth, int32_t iDay)
{
m_dtMax = DATE(iYear, iMonth, iDay);
return TRUE;
@@ -748,8 +748,8 @@ FX_BOOL CFWL_MonthCalendarImp::InitDate() }
void CFWL_MonthCalendarImp::ClearDateItem()
{
- FX_INT32 iCount = m_arrDates.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrDates.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
LPDATEINFO pData = (LPDATEINFO)m_arrDates.GetAt(i);
delete pData;
}
@@ -758,9 +758,9 @@ void CFWL_MonthCalendarImp::ClearDateItem() void CFWL_MonthCalendarImp::ReSetDateItem()
{
m_pDateTime->Set(m_iCurYear, m_iCurMonth, 1);
- FX_INT32 iDays = FX_DaysInMonth(m_iCurYear, m_iCurMonth);
- FX_INT32 iDayOfWeek = m_pDateTime->GetDayOfWeek();
- for (FX_INT32 i = 0; i < iDays; i ++) {
+ int32_t iDays = FX_DaysInMonth(m_iCurYear, m_iCurMonth);
+ int32_t iDayOfWeek = m_pDateTime->GetDayOfWeek();
+ for (int32_t i = 0; i < iDays; i ++) {
if (iDayOfWeek >= 7) {
iDayOfWeek = 0;
}
@@ -782,7 +782,7 @@ void CFWL_MonthCalendarImp::ReSetDateItem() }
FX_BOOL CFWL_MonthCalendarImp::NextMonth()
{
- FX_INT32 iYear = m_iCurYear, iMonth = m_iCurMonth;
+ int32_t iYear = m_iCurYear, iMonth = m_iCurMonth;
if (iMonth >= 12) {
iMonth = 1;
iYear++;
@@ -799,7 +799,7 @@ FX_BOOL CFWL_MonthCalendarImp::NextMonth() }
FX_BOOL CFWL_MonthCalendarImp::PrevMonth()
{
- FX_INT32 iYear = m_iCurYear, iMonth = m_iCurMonth;
+ int32_t iYear = m_iCurYear, iMonth = m_iCurMonth;
if (iMonth <= 1) {
iMonth = 12;
iYear --;
@@ -814,7 +814,7 @@ FX_BOOL CFWL_MonthCalendarImp::PrevMonth() ChangeToMonth(m_iCurYear, m_iCurMonth);
return TRUE;
}
-void CFWL_MonthCalendarImp::ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth)
+void CFWL_MonthCalendarImp::ChangeToMonth(int32_t iYear, int32_t iMonth)
{
m_iCurYear = iYear;
m_iCurMonth = iMonth;
@@ -824,16 +824,16 @@ void CFWL_MonthCalendarImp::ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth) CalDateItem();
GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead);
}
-FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll)
+FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(int32_t iDay, FX_BOOL bAll)
{
if (iDay == -1 && !bAll) {
return FALSE;
}
if (bAll) {
- FX_INT32 iCount = m_arrSelDays.GetSize();
- FX_INT32 iDatesCount = m_arrDates.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
- FX_INT32 iSelDay = m_arrSelDays.GetAt(i);
+ int32_t iCount = m_arrSelDays.GetSize();
+ int32_t iDatesCount = m_arrDates.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
+ int32_t iSelDay = m_arrSelDays.GetAt(i);
if (iSelDay <= iDatesCount) {
LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(iSelDay - 1);
pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected;
@@ -841,12 +841,12 @@ FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll) }
m_arrSelDays.RemoveAll();
} else {
- FX_INT32 index = m_arrSelDays.Find(iDay);
+ int32_t index = m_arrSelDays.Find(iDay);
if (index == -1) {
return FALSE;
}
- FX_INT32 iSelDay = m_arrSelDays.GetAt(iDay);
- FX_INT32 iDatesCount = m_arrDates.GetSize();
+ int32_t iSelDay = m_arrSelDays.GetAt(iDay);
+ int32_t iDatesCount = m_arrDates.GetSize();
if (iSelDay <= iDatesCount) {
LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(iSelDay - 1);
pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected;
@@ -855,7 +855,7 @@ FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll) }
return TRUE;
}
-FX_BOOL CFWL_MonthCalendarImp::AddSelDay(FX_INT32 iDay)
+FX_BOOL CFWL_MonthCalendarImp::AddSelDay(int32_t iDay)
{
FXSYS_assert(iDay > 0);
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) {
@@ -885,7 +885,7 @@ FX_BOOL CFWL_MonthCalendarImp::JumpToToday() }
return TRUE;
}
-void CFWL_MonthCalendarImp::GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_WideString &wsHead)
+void CFWL_MonthCalendarImp::GetHeadText(int32_t iYear, int32_t iMonth, CFX_WideString &wsHead)
{
FXSYS_assert(iMonth > 0 && iMonth < 13);
static FX_LPWSTR pMonth[] = {
@@ -904,14 +904,14 @@ void CFWL_MonthCalendarImp::GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_Wid };
wsHead.Format(FX_LPCWSTR(L"%s, %d"), pMonth[iMonth - 1], iYear);
}
-void CFWL_MonthCalendarImp::GetTodayText(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsToday)
+void CFWL_MonthCalendarImp::GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsToday)
{
wsToday.Format(FX_LPCWSTR(L", %d/%d/%d"), iDay, iMonth, iYear);
}
-FX_INT32 CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y)
+int32_t CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y)
{
- FX_INT32 iCount = m_arrDates.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_arrDates.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(i);
if (pDateInfo->rect.Contains(x, y)) {
return ++i;
@@ -919,7 +919,7 @@ FX_INT32 CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y) }
return -1;
}
-FX_BOOL CFWL_MonthCalendarImp::GetDayRect(FX_INT32 iDay, CFX_RectF &rtDay)
+FX_BOOL CFWL_MonthCalendarImp::GetDayRect(int32_t iDay, CFX_RectF &rtDay)
{
if (iDay <= 0 || iDay > m_arrDates.GetSize()) {
return FALSE;
@@ -933,11 +933,11 @@ CFWL_MonthCalendarImpDelegate::CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarI : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_MonthCalendarImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_MonthCalendarImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
case FWL_MSGHASH_KillFocus: {
@@ -1016,13 +1016,13 @@ void CFWL_MonthCalendarImpDelegate::OnLButtonDown(CFWL_MsgMouse *pMsg) } else {
if (m_pOwner->m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) {
} else {
- FX_INT32 iOldSel = 0;
+ int32_t iOldSel = 0;
if (m_pOwner->m_arrSelDays.GetSize() > 0) {
iOldSel = m_pOwner->m_arrSelDays[0];
} else {
return;
}
- FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
FX_BOOL bSelChanged = iCurSel > 0 && iCurSel != iOldSel;
if (bSelChanged) {
LPDATEINFO lpDatesInfo = (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iCurSel - 1);
@@ -1056,7 +1056,7 @@ void CFWL_MonthCalendarImpDelegate::OnLButtonUp(CFWL_MsgMouse *pMsg) m_pOwner->m_iRBtnPartStates = 0;
m_pOwner->Repaint(&m_pOwner->m_rtRBtn);
} else if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
- FX_INT32 iDay = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iDay = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
if (iDay != -1) {
m_pOwner->AddSelDay(iDay);
}
@@ -1071,7 +1071,7 @@ void CFWL_MonthCalendarImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg) CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, 0, 0);
if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
- FX_INT32 iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
+ int32_t iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
bRepaint = m_pOwner->m_iHovered != iHover;
if (bRepaint) {
if (m_pOwner->m_iHovered > 0) {
diff --git a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp index b3228e41f2..364e497123 100644 --- a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp @@ -92,7 +92,7 @@ FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (pData) {
pData->GetCaption(m_pInterface, wsCaption);
}
- FX_INT32 iLen = wsCaption.GetLength();
+ int32_t iLen = wsCaption.GetLength();
if (iLen > 0) {
CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider);
rect.Set(0, 0, sz.x, sz.y);
@@ -382,13 +382,13 @@ CFWL_PushButtonImpDelegate::CFWL_PushButtonImpDelegate(CFWL_PushButtonImp *pOwne : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
if (!m_pOwner->IsEnabled()) {
return 1;
}
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
FX_DWORD dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
diff --git a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp index 8162c9d9e8..7b3e43f6e5 100644 --- a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp @@ -302,7 +302,7 @@ FX_BOOL CFWL_ScrollBarImp::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos ) }
return OnScroll(dwCode, fPos);
}
-FX_INT32 CFWL_ScrollBarImp::Run(FWL_HTIMER hTimer)
+int32_t CFWL_ScrollBarImp::Run(FWL_HTIMER hTimer)
{
if (m_hTimer) {
FWL_StopTimer(m_hTimer);
@@ -693,10 +693,10 @@ CFWL_ScrollBarImpDelegate::CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
FX_DWORD dwMsgCode = pMessage->GetClassID();
if (dwMsgCode == FWL_MSGHASH_Mouse) {
CFWL_MsgMouse *pMsg = (CFWL_MsgMouse*)pMessage;
@@ -794,11 +794,11 @@ void CFWL_ScrollBarImpDelegate::OnMouseLeave() }
void CFWL_ScrollBarImpDelegate::OnMouseWheel(FX_FLOAT fx, FX_FLOAT fy, FX_DWORD dwFlags, FX_FLOAT fDeltaX, FX_FLOAT fDeltaY)
{
- m_pOwner->m_iMouseWheel = (FX_INT32)fDeltaX;
+ m_pOwner->m_iMouseWheel = (int32_t)fDeltaX;
m_pOwner->SendEvent();
m_pOwner->m_iMouseWheel = 0;
}
-void CFWL_ScrollBarImpDelegate::DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy)
+void CFWL_ScrollBarImpDelegate::DoMouseDown(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy)
{
if (!rtItem.Contains(fx, fy)) {
return;
@@ -809,9 +809,9 @@ void CFWL_ScrollBarImpDelegate::DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtI iState = FWL_PARTSTATE_SCB_Pressed;
m_pOwner->Repaint(&rtItem);
}
-void CFWL_ScrollBarImpDelegate::DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy)
+void CFWL_ScrollBarImpDelegate::DoMouseUp(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy)
{
- FX_INT32 iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal;
+ int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal;
if (iState == iNewState) {
return;
}
@@ -819,10 +819,10 @@ void CFWL_ScrollBarImpDelegate::DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtIte m_pOwner->Repaint(&rtItem);
m_pOwner->OnScroll(FWL_SCBCODE_EndScroll, m_pOwner->m_fTrackPos);
}
-void CFWL_ScrollBarImpDelegate::DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy)
+void CFWL_ScrollBarImpDelegate::DoMouseMove(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy)
{
if (!m_pOwner->m_bMouseDown) {
- FX_INT32 iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal;
+ int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal;
if (iState == iNewState) {
return;
}
@@ -834,7 +834,7 @@ void CFWL_ScrollBarImpDelegate::DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtI m_pOwner->OnScroll(FWL_SCBCODE_TrackPos, fPos);
}
}
-void CFWL_ScrollBarImpDelegate::DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState)
+void CFWL_ScrollBarImpDelegate::DoMouseLeave(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState)
{
if (iState == FWL_PARTSTATE_SCB_Normal) {
return;
@@ -842,7 +842,7 @@ void CFWL_ScrollBarImpDelegate::DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rt iState = FWL_PARTSTATE_SCB_Normal;
m_pOwner->Repaint(&rtItem);
}
-void CFWL_ScrollBarImpDelegate::DoMouseHover(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState)
+void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState)
{
if (iState == FWL_PARTSTATE_SCB_Hovered) {
return;
diff --git a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp index f5f56955fa..c8be73228b 100644 --- a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp @@ -165,7 +165,7 @@ FWL_ERR CFWL_SpinButtonImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix DrawDownButton(pGraphics, pTheme, pMatrix);
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_SpinButtonImp::Run(FWL_HTIMER hTimer)
+int32_t CFWL_SpinButtonImp::Run(FWL_HTIMER hTimer)
{
if (m_hTimer) {
CFWL_EvtSpbClick wmPosChanged;
@@ -229,10 +229,10 @@ CFWL_SpinButtonImpDelegate::CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp *pOwne : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
FX_DWORD dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
diff --git a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp index 157d2fff73..920bcb73e1 100644 --- a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp @@ -124,7 +124,7 @@ FWL_ERR CFWL_ToolTipImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (pData) {
pData->GetCaption(m_pInterface, wsCaption);
}
- FX_INT32 iLen = wsCaption.GetLength();
+ int32_t iLen = wsCaption.GetLength();
if (iLen > 0) {
CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider);
rect.Set(0, 0, sz.x, sz.y);
@@ -240,7 +240,7 @@ FWL_ERR CFWL_ToolTipImp::SetAnchor(const CFX_RectF &rtAnchor) FWL_ERR CFWL_ToolTipImp::Show()
{
IFWL_ToolTipDP *pData = (IFWL_ToolTipDP*)m_pProperties->m_pDataProvider;
- FX_INT32 nInitDelay = pData->GetInitialDelay(m_pInterface);
+ int32_t nInitDelay = pData->GetInitialDelay(m_pInterface);
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible)) {
m_hTimerShow = FWL_StartTimer( &m_TimerShow, nInitDelay, FALSE);
}
@@ -263,7 +263,7 @@ FWL_ERR CFWL_ToolTipImp::SetStates(FX_DWORD dwStates, FX_BOOL bSet ) {
if ( (dwStates & FWL_WGTSTATE_Invisible) && !bSet) {
IFWL_ToolTipDP *pData = (IFWL_ToolTipDP*)m_pProperties->m_pDataProvider;
- FX_INT32 nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface);
+ int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface);
m_hTimerHide = FWL_StartTimer( &m_TimerHide, nAutoPopDelay, FALSE);
}
return CFWL_WidgetImp::SetStates(dwStates, bSet);
@@ -301,7 +301,7 @@ CFWL_ToolTipImp::CFWL_ToolTipTimer::CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip : m_pToolTip(pToolTip)
{
}
-FX_INT32 CFWL_ToolTipImp::CFWL_ToolTipTimer::Run(FWL_HTIMER hTimer)
+int32_t CFWL_ToolTipImp::CFWL_ToolTipTimer::Run(FWL_HTIMER hTimer)
{
if (m_pToolTip->m_hTimerShow == hTimer && m_pToolTip->m_hTimerShow) {
if (m_pToolTip->GetStates() & FWL_WGTSTATE_Invisible) {
@@ -324,7 +324,7 @@ CFWL_ToolTipImpDelegate::CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage);
}
diff --git a/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp index c56932b4fa..7996a882f5 100644 --- a/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp +++ b/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp @@ -63,19 +63,19 @@ FX_BOOL CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
return m_pBCEngine ? m_pBCEngine->SetCharEncoding(encoding) : FALSE;
}
-FX_BOOL CFX_Barcode::SetModuleHeight(FX_INT32 moduleHeight)
+FX_BOOL CFX_Barcode::SetModuleHeight(int32_t moduleHeight)
{
return m_pBCEngine ? m_pBCEngine->SetModuleHeight(moduleHeight) : FALSE;
}
-FX_BOOL CFX_Barcode::SetModuleWidth(FX_INT32 moduleWidth)
+FX_BOOL CFX_Barcode::SetModuleWidth(int32_t moduleWidth)
{
return m_pBCEngine ? m_pBCEngine->SetModuleWidth(moduleWidth) : FALSE;
}
-FX_BOOL CFX_Barcode::SetHeight(FX_INT32 height)
+FX_BOOL CFX_Barcode::SetHeight(int32_t height)
{
return m_pBCEngine ? m_pBCEngine->SetHeight(height) : FALSE;
}
-FX_BOOL CFX_Barcode::SetWidth(FX_INT32 width)
+FX_BOOL CFX_Barcode::SetWidth(int32_t width)
{
return m_pBCEngine ? m_pBCEngine->SetWidth(width) : FALSE;
}
@@ -113,7 +113,7 @@ FX_BOOL CFX_Barcode::SetPrintChecksum(FX_BOOL checksum) return FALSE;
}
}
-FX_BOOL CFX_Barcode::SetDataLength(FX_INT32 length)
+FX_BOOL CFX_Barcode::SetDataLength(int32_t length)
{
switch(GetType()) {
case BC_CODE39:
@@ -130,7 +130,7 @@ FX_BOOL CFX_Barcode::SetDataLength(FX_INT32 length) return FALSE;
}
}
-FX_BOOL CFX_Barcode::SetCalChecksum(FX_INT32 state)
+FX_BOOL CFX_Barcode::SetCalChecksum(int32_t state)
{
switch(GetType()) {
case BC_CODE39:
@@ -181,7 +181,7 @@ FX_BOOL CFX_Barcode::SetFontSize(FX_FLOAT size) return FALSE;
}
}
-FX_BOOL CFX_Barcode::SetFontStyle(FX_INT32 style)
+FX_BOOL CFX_Barcode::SetFontStyle(int32_t style)
{
switch(GetType()) {
case BC_CODE39:
@@ -237,9 +237,9 @@ FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(location)
: FALSE;
}
-FX_BOOL CFX_Barcode::SetWideNarrowRatio(FX_INT32 ratio)
+FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio)
{
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32);
+ typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = NULL;
switch(GetType()) {
case BC_CODE39:
@@ -282,9 +282,9 @@ FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(end)
: FALSE;
}
-FX_BOOL CFX_Barcode::SetVersion(FX_INT32 version)
+FX_BOOL CFX_Barcode::SetVersion(int32_t version)
{
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32);
+ typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = NULL;
switch(GetType()) {
case BC_QR_CODE:
@@ -296,9 +296,9 @@ FX_BOOL CFX_Barcode::SetVersion(FX_INT32 version) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(version)
: FALSE;
}
-FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(FX_INT32 level)
+FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level)
{
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32);
+ typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = NULL;
switch(GetType()) {
case BC_QR_CODE:
@@ -336,21 +336,21 @@ FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) #ifndef BCExceptionUnSupportedBarcode
#define BCExceptionUnSupportedBarcode 18
#endif
-FX_BOOL CFX_Barcode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CFX_Barcode::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(!m_pBCEngine) {
return FALSE;
}
return m_pBCEngine->Encode(contents, isDevice, e);
}
-FX_BOOL CFX_Barcode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CFX_Barcode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
if (!m_pBCEngine) {
return FALSE;
}
return m_pBCEngine->RenderDevice(device, matirx, e);
}
-FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
if (!m_pBCEngine) {
return FALSE;
@@ -359,9 +359,9 @@ FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) }
#define BC_TYPE_MIN BC_CODE39
#define BC_TYPE_MAX BC_DATAMATRIX
-CFX_WideString CFX_Barcode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height, FX_INT32 &errorCode)
+CFX_WideString CFX_Barcode::Decode(uint8_t* buf, int32_t width, int32_t height, int32_t &errorCode)
{
- for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((FX_INT32)t + 1)) {
+ for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((int32_t)t + 1)) {
CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t);
if(!pTmpEngine) {
continue;
@@ -374,9 +374,9 @@ CFX_WideString CFX_Barcode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height errorCode = BCExceptionUnSupportedBarcode;
return CFX_WideString();
}
-CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &errorCode)
+CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap *pBitmap, int32_t &errorCode)
{
- for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((FX_INT32)t + 1)) {
+ for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((int32_t)t + 1)) {
CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t);
if(!pTmpEngine) {
continue;
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h index 673c720841..f4d090acb4 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h @@ -37,7 +37,7 @@ protected: {
public:
CFWL_CaretTimer(CFWL_CaretImp *m_pCaret);
- virtual FX_INT32 Run(FWL_HTIMER hTimer);
+ virtual int32_t Run(FWL_HTIMER hTimer);
CFWL_CaretImp *m_pCaret;
};
@@ -54,7 +54,7 @@ class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_CaretImpDelegate(CFWL_CaretImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h index 0e538f32d6..490202dc9a 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h @@ -25,8 +25,8 @@ public: virtual FWL_ERR GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE);
virtual FWL_ERR Update();
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
- virtual FX_INT32 GetCheckState();
- virtual FWL_ERR SetCheckState(FX_INT32 iCheck);
+ virtual int32_t GetCheckState();
+ virtual FWL_ERR SetCheckState(int32_t iCheck);
protected:
void Layout();
FX_DWORD GetPartStates();
@@ -37,7 +37,7 @@ protected: CFX_RectF m_rtCaption;
CFX_RectF m_rtFocus;
FX_DWORD m_dwTTOStyles;
- FX_INT32 m_iTTOAlign;
+ int32_t m_iTTOAlign;
FX_BOOL m_bBtnDown;
friend class CFWL_CheckBoxImpDelegate;
};
@@ -45,7 +45,7 @@ class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
void OnActivate(CFWL_Message *pMsg);
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h index 250ef35e79..5046cdf47b 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h @@ -41,7 +41,7 @@ class CFWL_ComboEditDelegate : public CFWL_EditImpDelegate {
public:
CFWL_ComboEditDelegate(CFWL_ComboEdit *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
protected:
CFWL_ComboEdit *m_pOwner;
};
@@ -52,10 +52,10 @@ public: CFWL_ComboList(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter);
virtual FWL_ERR Initialize();
virtual FWL_ERR Finalize();
- FX_INT32 MatchItem(const CFX_WideString &wsMatch);
- void ChangeSelected(FX_INT32 iSel);
- FX_INT32 CountItems();
- void GetItemRect(FX_INT32 nIndex, CFX_RectF &rtItem);
+ int32_t MatchItem(const CFX_WideString &wsMatch);
+ void ChangeSelected(int32_t iSel);
+ int32_t CountItems();
+ void GetItemRect(int32_t nIndex, CFX_RectF &rtItem);
void ClientToOuter(FX_FLOAT &fx, FX_FLOAT &fy);
void SetFocus(FX_BOOL bSet);
FX_BOOL m_bNotifyOwner;
@@ -66,13 +66,13 @@ class CFWL_ComboListDelegate : public CFWL_ListBoxImpDelegate {
public:
CFWL_ComboListDelegate(CFWL_ComboList *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
protected:
void OnDropListFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);
- FX_INT32 OnDropListMouseMove(CFWL_MsgMouse *pMsg);
- FX_INT32 OnDropListLButtonDown(CFWL_MsgMouse *pMsg);
- FX_INT32 OnDropListLButtonUp(CFWL_MsgMouse *pMsg);
- FX_INT32 OnDropListKey(CFWL_MsgKey *pKey);
+ int32_t OnDropListMouseMove(CFWL_MsgMouse *pMsg);
+ int32_t OnDropListLButtonDown(CFWL_MsgMouse *pMsg);
+ int32_t OnDropListLButtonUp(CFWL_MsgMouse *pMsg);
+ int32_t OnDropListKey(CFWL_MsgKey *pKey);
void OnDropListKeyDown(CFWL_MsgKey *pKey);
CFWL_ComboList *m_pOwner;
};
@@ -93,16 +93,16 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider);
- virtual FX_INT32 GetCurSel();
- virtual FWL_ERR SetCurSel(FX_INT32 iSel);
+ virtual int32_t GetCurSel();
+ virtual FWL_ERR SetCurSel(int32_t iSel);
virtual FWL_ERR SetEditText(const CFX_WideString &wsText);
- virtual FX_INT32 GetEditTextLength() const;
- virtual FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
- virtual FWL_ERR SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- virtual FX_INT32 GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
- virtual FX_INT32 GetEditLimit();
- virtual FWL_ERR SetEditLimit(FX_INT32 nLimit);
- virtual FWL_ERR EditDoClipboard(FX_INT32 iCmd);
+ virtual int32_t GetEditTextLength() const;
+ virtual FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
+ virtual FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1);
+ virtual int32_t GetEditSelRange(int32_t nIndex, int32_t &nStart);
+ virtual int32_t GetEditLimit();
+ virtual FWL_ERR SetEditLimit(int32_t nLimit);
+ virtual FWL_ERR EditDoClipboard(int32_t iCmd);
virtual FX_BOOL EditRedo(FX_BSTR bsRecord);
virtual FX_BOOL EditUndo(FX_BSTR bsRecord);
virtual IFWL_ListBox* GetListBoxt();
@@ -130,7 +130,7 @@ protected: FX_BOOL IsDropListShowed();
FX_BOOL IsDropDownStyle() const;
void MatchEditText();
- void SynchrEditText(FX_INT32 iListItem);
+ void SynchrEditText(int32_t iListItem);
void Layout();
void ReSetTheme();
void ReSetEditAlignment();
@@ -161,8 +161,8 @@ protected: IFWL_Form *m_pForm;
FX_BOOL m_bLButtonDown;
FX_BOOL m_bUpFormHandler;
- FX_INT32 m_iCurSel;
- FX_INT32 m_iBtnState;
+ int32_t m_iCurSel;
+ int32_t m_iBtnState;
FX_FLOAT m_fComboFormHandler;
FX_FLOAT m_fItemHeight;
FX_BOOL m_bNeedShowList;
@@ -180,7 +180,7 @@ class CFWL_ComboBoxImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_ComboBoxImpDelegate(CFWL_ComboBoxImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
@@ -193,7 +193,7 @@ protected: void OnKey(CFWL_MsgKey *pMsg);
void DoSubCtrlKey(CFWL_MsgKey *pMsg);
protected:
- FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage);
+ int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage);
void DisForm_OnLButtonDown(CFWL_MsgMouse *pMsg);
void DisForm_OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);
void DisForm_OnKey(CFWL_MsgKey *pMsg);
@@ -206,7 +206,7 @@ class CFWL_ComboProxyImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_ComboProxyImpDelegate(IFWL_Form *pForm, CFWL_ComboBoxImp *pComboBox);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
void Reset()
{
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h b/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h index cc8db6ada1..f07dcb5532 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h @@ -48,9 +48,9 @@ class CFWL_DateTimeEditDelegate : public CFWL_EditImpDelegate {
public:
CFWL_DateTimeEditDelegate(CFWL_DateTimeEdit *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
private:
- FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage);
+ int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage);
protected:
CFWL_DateTimeEdit *m_pOwner;
@@ -68,12 +68,12 @@ class CFWL_DateTimeCalendarDelegate : public CFWL_MonthCalendarImpDelegate {
public:
CFWL_DateTimeCalendarDelegate(CFWL_DateTimeCalendar *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
void OnLButtonDownEx(CFWL_MsgMouse *pMsg);
void OnLButtonUpEx(CFWL_MsgMouse *pMsg);
void OnMouseMoveEx(CFWL_MsgMouse *pMsg);
private:
- FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage);
+ int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage);
void DisForm_OnLButtonUpEx(CFWL_MsgMouse *pMsg);
protected:
CFWL_DateTimeCalendar *m_pOwner;
@@ -94,10 +94,10 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pTP);
- virtual FWL_ERR GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- virtual FWL_ERR SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ virtual FWL_ERR GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ virtual FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
virtual FWL_ERR SetEditText(const CFX_WideString &wsText);
- virtual FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
+ virtual FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
public:
virtual FX_BOOL CanUndo();
virtual FX_BOOL CanRedo();
@@ -113,18 +113,18 @@ public: virtual FX_BOOL Delete();
virtual FX_BOOL DeSelect();
virtual FWL_ERR GetBBox(CFX_RectF &rect);
- virtual FWL_ERR SetEditLimit(FX_INT32 nLimit);
+ virtual FWL_ERR SetEditLimit(int32_t nLimit);
virtual FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved);
public:
IFWL_DateTimeEdit* GetDataTimeEdit();
protected:
void DrawDropDownButton(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);
- void FormatDateString(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsText);
+ void FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsText);
void ShowMonthCalendar(FX_BOOL bActivate);
FX_BOOL IsMonthCalendarShowed();
void ReSetEditAlignment();
void InitProxyForm();
- void ProcessSelChanged(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
private:
FWL_ERR DisForm_Initialize();
void DisForm_InitDateTimeCalendar();
@@ -141,10 +141,10 @@ protected: CFX_RectF m_rtBtn;
CFX_RectF m_rtClient;
- FX_INT32 m_iBtnState;
- FX_INT32 m_iYear;
- FX_INT32 m_iMonth;
- FX_INT32 m_iDay;
+ int32_t m_iBtnState;
+ int32_t m_iYear;
+ int32_t m_iMonth;
+ int32_t m_iDay;
FX_BOOL m_bLBtnDown;
IFWL_DateTimeEdit *m_pEdit;
IFWL_DateTimeCalender *m_pMonthCal;
@@ -163,21 +163,21 @@ protected: {
return FWL_ERR_Succeeded;
}
- virtual FX_INT32 GetCurDay(IFWL_Widget *pWidget)
+ virtual int32_t GetCurDay(IFWL_Widget *pWidget)
{
return m_iCurDay;
}
- virtual FX_INT32 GetCurMonth(IFWL_Widget *pWidget)
+ virtual int32_t GetCurMonth(IFWL_Widget *pWidget)
{
return m_iCurMonth;
}
- virtual FX_INT32 GetCurYear(IFWL_Widget *pWidget)
+ virtual int32_t GetCurYear(IFWL_Widget *pWidget)
{
return m_iCurYear;
}
- FX_INT32 m_iCurDay;
- FX_INT32 m_iCurYear;
- FX_INT32 m_iCurMonth;
+ int32_t m_iCurDay;
+ int32_t m_iCurYear;
+ int32_t m_iCurMonth;
};
CFWL_MonthCalendarImpDP m_MonthCalendarDP;
@@ -190,7 +190,7 @@ class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_DateTimePickerImpDelegate(CFWL_DateTimePickerImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
void OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h index b5671e659c..db9e25fb5c 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h @@ -32,25 +32,25 @@ public: virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider);
virtual FWL_ERR SetText(const CFX_WideString &wsText);
- virtual FX_INT32 GetTextLength() const;
- virtual FWL_ERR GetText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const;
+ virtual int32_t GetTextLength() const;
+ virtual FWL_ERR GetText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const;
virtual FWL_ERR ClearText();
- virtual FX_INT32 GetCaretPos() const;
- virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE);
- virtual FWL_ERR AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1);
- virtual FX_INT32 CountSelRanges();
- virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart);
+ virtual int32_t GetCaretPos() const;
+ virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ virtual FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1);
+ virtual int32_t CountSelRanges();
+ virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart);
virtual FWL_ERR ClearSelections();
- virtual FX_INT32 GetLimit();
- virtual FWL_ERR SetLimit(FX_INT32 nLimit);
+ virtual int32_t GetLimit();
+ virtual FWL_ERR SetLimit(int32_t nLimit);
virtual FWL_ERR SetAliasChar(FX_WCHAR wAlias);
virtual FWL_ERR SetFormatString(const CFX_WideString &wsFormat);
- virtual FWL_ERR Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen);
+ virtual FWL_ERR Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen);
virtual FWL_ERR DeleteSelections();
- virtual FWL_ERR DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1);
+ virtual FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1);
virtual FWL_ERR ReplaceSelections(const CFX_WideStringC &wsReplace);
- virtual FWL_ERR Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace);
- virtual FWL_ERR DoClipboard(FX_INT32 iCmd);
+ virtual FWL_ERR Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace);
+ virtual FWL_ERR DoClipboard(int32_t iCmd);
virtual FX_BOOL Copy(CFX_WideString &wsCopy);
virtual FX_BOOL Cut(CFX_WideString &wsCut);
virtual FX_BOOL Paste(const CFX_WideString &wsPaste);
@@ -63,22 +63,22 @@ public: virtual FX_BOOL CanRedo();
virtual FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
virtual FWL_ERR SetOuter(IFWL_Widget *pOuter);
- virtual FWL_ERR SetNumberRange(FX_INT32 iMin, FX_INT32 iMax);
- virtual void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPage, FX_BOOL bVisible = TRUE);
+ virtual FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
+ virtual void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible = TRUE);
virtual void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo);
virtual void On_PageCountChanged(IFDE_TxtEdtEngine *pEdit) {}
virtual void On_SelChanged(IFDE_TxtEdtEngine *pEdit);
- virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose);
- virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose);
+ virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose);
+ virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose);
virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine *pEdit, FX_BOOL bPageUp = TRUE)
{
return TRUE;
}
virtual void On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, FX_BSTR bsDoRecord);
- virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \
- const CFX_WideString &wsFieldText, FX_INT32 nCharIndex);
- virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex);
- virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText);
+ virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \
+ const CFX_WideString &wsFieldText, int32_t nCharIndex);
+ virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex);
+ virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText);
virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText);
virtual FWL_ERR SetBackgroundColor(FX_DWORD color);
virtual FWL_ERR SetFont(const CFX_WideString &wsFont, FX_FLOAT fSize);
@@ -107,12 +107,12 @@ protected: void ClearRecord();
FX_BOOL IsShowScrollBar(FX_BOOL bVert);
FX_BOOL IsContentHeightOverflow();
- FX_INT32 AddDoRecord(FX_BSTR bsDoRecord);
- void ProcessInsertError(FX_INT32 iError);
+ int32_t AddDoRecord(FX_BSTR bsDoRecord);
+ void ProcessInsertError(int32_t iError);
void DrawSpellCheck(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
- void AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT32 nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY);
- FX_INT32 GetWordAtPoint(CFX_PointF pointf, FX_INT32& nCount);
+ void AddSpellCheckObj(CFX_Path& PathData, int32_t nStart, int32_t nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY);
+ int32_t GetWordAtPoint(CFX_PointF pointf, int32_t& nCount);
CFX_RectF m_rtClient;
CFX_RectF m_rtEngine;
CFX_RectF m_rtStatic;
@@ -121,15 +121,15 @@ protected: FX_FLOAT m_fScrollOffsetY;
IFDE_TxtEdtEngine* m_pEdtEngine;
FX_BOOL m_bLButtonDown;
- FX_INT32 m_nSelStart;
- FX_INT32 m_nLimit;
+ int32_t m_nSelStart;
+ int32_t m_nLimit;
FX_FLOAT m_fSpaceAbove;
FX_FLOAT m_fSpaceBelow;
FX_FLOAT m_fFontSize;
FX_ARGB m_argbSel;
FX_BOOL m_bSetRange;
- FX_INT32 m_iMin;
- FX_INT32 m_iMax;
+ int32_t m_iMin;
+ int32_t m_iMax;
IFWL_ScrollBar* m_pVertScrollBar;
IFWL_ScrollBar* m_pHorzScrollBar;
IFWL_Caret* m_pCaret;
@@ -141,14 +141,14 @@ protected: FX_BOOL m_updateBackColor;
CFX_WideString m_wsFont;
CFX_ByteStringArray m_RecordArr;
- FX_INT32 m_iCurRecord;
- FX_INT32 m_iMaxRecord;
+ int32_t m_iCurRecord;
+ int32_t m_iMaxRecord;
};
class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate
{
public:
CFWL_EditImpDelegate(CFWL_EditImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h b/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h index def7eb9650..e582f8c0e6 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h @@ -32,7 +32,7 @@ class CFWL_FormProxyImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_FormProxyImpDelegate(CFWL_FormProxyImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
protected:
CFWL_FormProxyImp *m_pOwner;
};
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h index 51d605885f..7cbb0b8cfd 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h @@ -28,9 +28,9 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider);
- virtual FX_INT32 CountSelItems();
- virtual FWL_HLISTITEM GetSelItem(FX_INT32 nIndexSel);
- virtual FX_INT32 GetSelIndex(FX_INT32 nIndex);
+ virtual int32_t CountSelItems();
+ virtual FWL_HLISTITEM GetSelItem(int32_t nIndexSel);
+ virtual int32_t GetSelIndex(int32_t nIndex);
virtual FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE);
virtual FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString &wsText);
virtual FWL_ERR GetScrollPos(FX_FLOAT &fPos, FX_BOOL bVert = TRUE);
@@ -51,7 +51,7 @@ protected: FX_BOOL ScrollToVisible(FWL_HLISTITEM hItem);
void DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
void DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
- void DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, FX_INT32 Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix = NULL);
+ void DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, int32_t Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix = NULL);
void DrawStatic(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme);
CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE);
void GetItemSize(CFX_SizeF &size, FWL_HLISTITEM hItem, FX_FLOAT fWidth, FX_FLOAT fHeight, FX_BOOL bAutoSize = FALSE);
@@ -69,7 +69,7 @@ protected: IFWL_ScrollBar* m_pHorzScrollBar;
IFWL_ScrollBar* m_pVertScrollBar;
FX_DWORD m_dwTTOStyles;
- FX_INT32 m_iTTOAligns;
+ int32_t m_iTTOAligns;
FWL_HLISTITEM m_hAnchor;
FX_FLOAT m_fItemHeight;
FX_FLOAT m_fScorllBarWidth;
@@ -81,7 +81,7 @@ class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_ListBoxImpDelegate(CFWL_ListBoxImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h b/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h index fc4da5864f..0cf2ed444a 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h @@ -12,7 +12,7 @@ class CFWL_WidgetImpDelegate; class IFWL_Widget;
class IFDE_DateTime;
class CFDE_DateTime;
-extern FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth);
+extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
class CFWL_MonthCalendarImp;
class CFWL_MonthCalendarImpDelegate;
class CFWL_MonthCalendarImp : public CFWL_WidgetImp
@@ -28,9 +28,9 @@ public: virtual FWL_ERR GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE);
virtual FWL_ERR Update();
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
- virtual FX_INT32 CountSelect();
- virtual FX_BOOL GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex = 0);
- virtual FX_BOOL SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ virtual int32_t CountSelect();
+ virtual FX_BOOL GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex = 0);
+ virtual FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
protected:
void DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);
void DrawHeadBK(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);
@@ -53,25 +53,25 @@ protected: void CalcTodaySize();
void CalDateItem();
void GetCapValue();
- FX_INT32 CalWeekNumber(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ int32_t CalWeekNumber(int32_t iYear, int32_t iMonth, int32_t iDay);
- FX_BOOL GetMinDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- FX_BOOL SetMinDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
- FX_BOOL GetMaxDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- FX_BOOL SetMaxDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ FX_BOOL GetMinDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ FX_BOOL SetMinDate(int32_t iYear, int32_t iMonth, int32_t iDay);
+ FX_BOOL GetMaxDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ FX_BOOL SetMaxDate(int32_t iYear, int32_t iMonth, int32_t iDay);
FX_BOOL InitDate();
void ClearDateItem();
void ReSetDateItem();
FX_BOOL NextMonth();
FX_BOOL PrevMonth();
- void ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth);
- FX_BOOL RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll = FALSE);
- FX_BOOL AddSelDay(FX_INT32 iDay);
+ void ChangeToMonth(int32_t iYear, int32_t iMonth);
+ FX_BOOL RemoveSelDay(int32_t iDay, FX_BOOL bAll = FALSE);
+ FX_BOOL AddSelDay(int32_t iDay);
FX_BOOL JumpToToday();
- void GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_WideString &wsHead);
- void GetTodayText(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsToday);
- FX_INT32 GetDayAtPoint(FX_FLOAT x, FX_FLOAT y);
- FX_BOOL GetDayRect(FX_INT32 iDay, CFX_RectF &rtDay);
+ void GetHeadText(int32_t iYear, int32_t iMonth, CFX_WideString &wsHead);
+ void GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsToday);
+ int32_t GetDayAtPoint(FX_FLOAT x, FX_FLOAT y);
+ FX_BOOL GetDayRect(int32_t iDay, CFX_RectF &rtDay);
typedef struct _DATE {
_DATE()
{
@@ -79,7 +79,7 @@ protected: iMonth = 0;
iDay = 0;
}
- _DATE(FX_INT32 year, FX_INT32 month, FX_INT32 day) : iYear(year), iMonth(month), iDay(day) {}
+ _DATE(int32_t year, int32_t month, int32_t day) : iYear(year), iMonth(month), iDay(day) {}
FX_BOOL operator < (const _DATE &right)
{
if (iYear < right.iYear) {
@@ -106,9 +106,9 @@ protected: }
return FALSE;
}
- FX_INT32 iYear;
- FX_INT32 iMonth;
- FX_INT32 iDay;
+ int32_t iYear;
+ int32_t iMonth;
+ int32_t iDay;
} DATE, *LPDATE;
FX_BOOL m_bInit;
@@ -128,22 +128,22 @@ protected: CFX_WideString m_wsToday;
CFX_DateTime *m_pDateTime;
CFX_PtrArray m_arrDates;
- FX_INT32 m_iCurYear;
- FX_INT32 m_iCurMonth;
- FX_INT32 m_iYear;
- FX_INT32 m_iMonth;
- FX_INT32 m_iDay;
- FX_INT32 m_iHovered;
- FX_INT32 m_iLBtnPartStates;
- FX_INT32 m_iRBtnPartStates;
+ int32_t m_iCurYear;
+ int32_t m_iCurMonth;
+ int32_t m_iYear;
+ int32_t m_iMonth;
+ int32_t m_iDay;
+ int32_t m_iHovered;
+ int32_t m_iLBtnPartStates;
+ int32_t m_iRBtnPartStates;
DATE m_dtMin;
DATE m_dtMax;
CFX_SizeF m_szHead;
CFX_SizeF m_szCell;
CFX_SizeF m_szToday;
- typedef CFX_ArrayTemplate<FX_INT32> CFWL_Int32Array;
+ typedef CFX_ArrayTemplate<int32_t> CFWL_Int32Array;
CFWL_Int32Array m_arrSelDays;
- FX_INT32 m_iMaxSel;
+ int32_t m_iMaxSel;
CFX_RectF m_rtClient;
FX_FLOAT m_fHeadWid;
FX_FLOAT m_fHeadHei;
@@ -178,9 +178,9 @@ protected: friend class CFWL_MonthCalendarImpDelegate;
};
typedef struct _DATEINFO {
- _DATEINFO(FX_INT32 day, FX_INT32 dayofweek, FX_DWORD dwSt, CFX_RectF rc, CFX_WideString &wsday) : iDay(day), iDayOfWeek(dayofweek), dwStates(dwSt), rect(rc), wsDay(wsday) {}
- FX_INT32 iDay;
- FX_INT32 iDayOfWeek;
+ _DATEINFO(int32_t day, int32_t dayofweek, FX_DWORD dwSt, CFX_RectF rc, CFX_WideString &wsday) : iDay(day), iDayOfWeek(dayofweek), dwStates(dwSt), rect(rc), wsDay(wsday) {}
+ int32_t iDay;
+ int32_t iDayOfWeek;
FX_DWORD dwStates;
CFX_RectF rect;
CFX_WideString wsDay;
@@ -189,7 +189,7 @@ class CFWL_MonthCalendarImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
void OnActivate(CFWL_Message *pMsg);
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h b/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h index 1688da887c..5238884979 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h @@ -35,14 +35,14 @@ protected: CFX_RectF m_rtCaption;
FX_BOOL m_bBtnDown;
FX_DWORD m_dwTTOStyles;
- FX_INT32 m_iTTOAlign;
+ int32_t m_iTTOAlign;
friend class CFWL_PushButtonImpDelegate;
};
class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate
{
public:
CFWL_PushButtonImpDelegate(CFWL_PushButtonImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h b/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h index e4073b5fc7..9b8dc19efb 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h @@ -40,7 +40,7 @@ public: virtual FWL_ERR SetTrackPos(FX_FLOAT fTrackPos);
virtual FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f);
virtual FWL_ERR SetOuter(IFWL_Widget *pOuter);
- virtual FX_INT32 Run(FWL_HTIMER hTimer);
+ virtual int32_t Run(FWL_HTIMER hTimer);
protected:
void DrawTrack(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FX_BOOL bLower = TRUE, const CFX_Matrix *pMatrix = NULL);
void DrawArrowBtn(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FX_BOOL bMinBtn = TRUE, const CFX_Matrix *pMatrix = NULL);
@@ -64,15 +64,15 @@ protected: FX_FLOAT m_fStepSize;
FX_FLOAT m_fPos;
FX_FLOAT m_fTrackPos;
- FX_INT32 m_iMinButtonState;
- FX_INT32 m_iMaxButtonState;
- FX_INT32 m_iThumbButtonState;
- FX_INT32 m_iMinTrackState;
- FX_INT32 m_iMaxTrackState;
+ int32_t m_iMinButtonState;
+ int32_t m_iMaxButtonState;
+ int32_t m_iThumbButtonState;
+ int32_t m_iMinTrackState;
+ int32_t m_iMaxTrackState;
FX_FLOAT m_fLastTrackPos;
FX_FLOAT m_cpTrackPointX;
FX_FLOAT m_cpTrackPointY;
- FX_INT32 m_iMouseWheel;
+ int32_t m_iMouseWheel;
FX_BOOL m_bTrackMouseLeave;
FX_BOOL m_bMouseHover;
FX_BOOL m_bMouseDown;
@@ -94,7 +94,7 @@ class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
void OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -102,11 +102,11 @@ protected: void OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
void OnMouseLeave();
void OnMouseWheel(FX_FLOAT fx, FX_FLOAT fy, FX_DWORD dwFlags, FX_FLOAT fDeltaX, FX_FLOAT fDeltaY);
- void DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy);
- void DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy);
- void DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy);
- void DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState);
- void DoMouseHover(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState);
+ void DoMouseDown(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy);
+ void DoMouseUp(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy);
+ void DoMouseMove(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy);
+ void DoMouseLeave(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState);
+ void DoMouseHover(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState);
CFWL_ScrollBarImp *m_pOwner;
};
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h b/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h index 2275a40f90..808903c1d0 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h @@ -27,7 +27,7 @@ public: virtual FWL_ERR Update();
virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
- virtual FX_INT32 Run(FWL_HTIMER hTimer);
+ virtual int32_t Run(FWL_HTIMER hTimer);
FWL_ERR EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE);
FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE);
protected:
@@ -38,7 +38,7 @@ protected: CFX_RectF m_rtDnButton;
FX_DWORD m_dwUpState;
FX_DWORD m_dwDnState;
- FX_INT32 m_iButtonIndex;
+ int32_t m_iButtonIndex;
FX_BOOL m_bLButtonDwn;
FWL_HTIMER m_hTimer;
friend class CFWL_SpinButtonImpDelegate;
@@ -47,7 +47,7 @@ class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h b/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h index 7317f3fe5b..6532ebab53 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h @@ -42,14 +42,14 @@ protected: CFWL_ToolTipTimer() {};
~CFWL_ToolTipTimer() {};
CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip);
- virtual FX_INT32 Run(FWL_HTIMER hTimer);
+ virtual int32_t Run(FWL_HTIMER hTimer);
CFWL_ToolTipImp *m_pToolTip;
};
CFX_RectF m_rtClient;
CFX_RectF m_rtCaption;
FX_BOOL m_bBtnDown;
FX_DWORD m_dwTTOStyles;
- FX_INT32 m_iTTOAlign;
+ int32_t m_iTTOAlign;
CFX_RectF m_rtAnchor;
FWL_HTIMER m_hTimerShow;
FWL_HTIMER m_hTimerHide;
@@ -63,7 +63,7 @@ class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h b/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h index 8fe41b762c..0c4e38dd9e 100644 --- a/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h +++ b/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h @@ -14,30 +14,30 @@ public: FX_BOOL Crreate(BC_TYPE type);
virtual void Release();
virtual BC_TYPE GetType();
- virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e);
- virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e);
- virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e);
- virtual CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height, FX_INT32 &errorCode);
- virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &errorCode);
+ virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e);
+ virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e);
+ virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e);
+ virtual CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t height, int32_t &errorCode);
+ virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &errorCode);
virtual FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding);
- virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight);
- virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth);
- virtual FX_BOOL SetHeight(FX_INT32 height);
- virtual FX_BOOL SetWidth(FX_INT32 width);
+ virtual FX_BOOL SetModuleHeight(int32_t moduleHeight);
+ virtual FX_BOOL SetModuleWidth(int32_t moduleWidth);
+ virtual FX_BOOL SetHeight(int32_t height);
+ virtual FX_BOOL SetWidth(int32_t width);
virtual FX_BOOL CheckContentValidity(FX_WSTR contents);
virtual FX_BOOL SetPrintChecksum(FX_BOOL checksum);
- virtual FX_BOOL SetDataLength(FX_INT32 length);
- virtual FX_BOOL SetCalChecksum(FX_INT32 state);
+ virtual FX_BOOL SetDataLength(int32_t length);
+ virtual FX_BOOL SetCalChecksum(int32_t state);
virtual FX_BOOL SetFont(CFX_Font* pFont);
virtual FX_BOOL SetFontSize(FX_FLOAT size);
- virtual FX_BOOL SetFontStyle(FX_INT32 style);
+ virtual FX_BOOL SetFontStyle(int32_t style);
virtual FX_BOOL SetFontColor(FX_ARGB color);
virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- virtual FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ virtual FX_BOOL SetWideNarrowRatio(int32_t ratio);
virtual FX_BOOL SetStartChar(FX_CHAR start);
virtual FX_BOOL SetEndChar(FX_CHAR end);
- virtual FX_BOOL SetVersion(FX_INT32 version);
- virtual FX_BOOL SetErrorCorrectionLevel(FX_INT32 level);
+ virtual FX_BOOL SetVersion(int32_t version);
+ virtual FX_BOOL SetErrorCorrectionLevel(int32_t level);
virtual FX_BOOL SetTruncated(FX_BOOL truncated);
protected:
CBC_CodeBase* m_pBCEngine;
diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp index e70d3f6a09..33d2fff886 100644 --- a/xfa/src/fwl/src/core/fwl_appimp.cpp +++ b/xfa/src/fwl/src/core/fwl_appimp.cpp @@ -70,7 +70,7 @@ FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) m_pThemeProvider = pThemeProvider;
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_AppImp::Exit(FX_INT32 iExitCode )
+FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode )
{
while (m_pNoteDriver->PopNoteLoop());
return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0);
diff --git a/xfa/src/fwl/src/core/fwl_contentimp.cpp b/xfa/src/fwl/src/core/fwl_contentimp.cpp index 3093aebf74..93c8c3b612 100644 --- a/xfa/src/fwl/src/core/fwl_contentimp.cpp +++ b/xfa/src/fwl/src/core/fwl_contentimp.cpp @@ -21,7 +21,7 @@ FWL_ERR IFWL_Content::Initialize() ((CFWL_ContentImp*)m_pData)->SetInterface(this);
return ((CFWL_ContentImp*)m_pData)->Initialize();
}
-FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex )
+FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget *pChild, int32_t nIndex )
{
return ((CFWL_ContentImp*)m_pData)->InsertWidget(pChild, nIndex);
}
@@ -78,7 +78,7 @@ CFWL_ContentImp::CFWL_ContentImp(const CFWL_WidgetImpProperties &properties) CFWL_ContentImp::~CFWL_ContentImp()
{
}
-FWL_ERR CFWL_ContentImp::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex )
+FWL_ERR CFWL_ContentImp::InsertWidget(IFWL_Widget *pChild, int32_t nIndex )
{
_FWL_RETURN_VALUE_IF_FAIL(pChild, FWL_ERR_Indefinite);
pChild->SetParent(m_pInterface);
diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp index 2491999484..db78afa369 100644 --- a/xfa/src/fwl/src/core/fwl_formimp.cpp +++ b/xfa/src/fwl/src/core/fwl_formimp.cpp @@ -326,7 +326,7 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pThemeProvider, FWL_ERR_Indefinite);
IFWL_ThemeProvider *pTheme = m_pProperties->m_pThemeProvider;
FX_BOOL bInactive = !IsActive();
- FX_INT32 iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_Normal;
+ int32_t iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_Normal;
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) {
DrawBackground(pGraphics, pTheme);
}
@@ -599,7 +599,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByState(FX_DWORD dwState) }
return NULL;
}
-CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(FX_INT32 nIndex)
+CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex)
{
if (nIndex < 0) {
return NULL;
@@ -616,7 +616,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(FX_INT32 nIndex) }
return (CFWL_SysBtn*) arrBtn[nIndex];
}
-FX_INT32 CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn)
+int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn)
{
CFX_PtrArray arrBtn;
if (m_pMinBox) {
@@ -989,12 +989,12 @@ CFWL_FormDelegate::CFWL_FormDelegate(CFWL_FormImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
#ifdef FWL_UseMacSystemBorder
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_Activate: {
m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated;
@@ -1011,7 +1011,7 @@ FX_INT32 CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) #else
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
FX_DWORD dwMsgCode = pMessage->GetClassID();
- FX_INT32 iRet = 1;
+ int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_Activate: {
m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated;
diff --git a/xfa/src/fwl/src/core/fwl_gridimp.cpp b/xfa/src/fwl/src/core/fwl_gridimp.cpp index 18ade073a4..56eb655231 100644 --- a/xfa/src/fwl/src/core/fwl_gridimp.cpp +++ b/xfa/src/fwl/src/core/fwl_gridimp.cpp @@ -27,19 +27,19 @@ FWL_ERR IFWL_Grid::Initialize(CFWL_WidgetImpProperties &properties) ((CFWL_GridImp*)m_pData)->SetInterface(this);
return ((CFWL_GridImp*)m_pData)->Initialize();
}
-FWL_HGRIDCOLROW IFWL_Grid::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex )
+FWL_HGRIDCOLROW IFWL_Grid::InsertColRow(FX_BOOL bColumn, int32_t nIndex )
{
return ((CFWL_GridImp*)m_pData)->InsertColRow(bColumn, nIndex);
}
-FX_INT32 IFWL_Grid::CountColRows(FX_BOOL bColumn)
+int32_t IFWL_Grid::CountColRows(FX_BOOL bColumn)
{
return ((CFWL_GridImp*)m_pData)->CountColRows(bColumn);
}
-FWL_HGRIDCOLROW IFWL_Grid::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex)
+FWL_HGRIDCOLROW IFWL_Grid::GetColRow(FX_BOOL bColumn, int32_t nIndex)
{
return ((CFWL_GridImp*)m_pData)->GetColRow(bColumn, nIndex);
}
-FX_INT32 IFWL_Grid::GetIndex(FWL_HGRIDCOLROW hColRow)
+int32_t IFWL_Grid::GetIndex(FWL_HGRIDCOLROW hColRow)
{
return ((CFWL_GridImp*)m_pData)->GetIndex(hColRow);
}
@@ -75,19 +75,19 @@ FX_BOOL IFWL_Grid::IsColumn(FWL_HGRIDCOLROW hColRow) {
return ((CFWL_GridImp*)m_pData)->IsColumn(hColRow);
}
-FX_INT32 IFWL_Grid::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn)
+int32_t IFWL_Grid::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn)
{
return ((CFWL_GridImp*)m_pData)->GetWidgetPos(pWidget, bColumn);
}
-FWL_ERR IFWL_Grid::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn)
+FWL_ERR IFWL_Grid::SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn)
{
return ((CFWL_GridImp*)m_pData)->SetWidgetPos(pWidget, iPos, bColumn);
}
-FX_INT32 IFWL_Grid::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn)
+int32_t IFWL_Grid::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn)
{
return ((CFWL_GridImp*)m_pData)->GetWidgetSpan(pWidget, bColumn);
}
-FWL_ERR IFWL_Grid::SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn)
+FWL_ERR IFWL_Grid::SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn)
{
return ((CFWL_GridImp*)m_pData)->SetWidgetSpan(pWidget, iSpan , bColumn);
}
@@ -163,13 +163,13 @@ CFWL_GridImp::CFWL_GridImp(const CFWL_WidgetImpProperties &properties) }
CFWL_GridImp::~CFWL_GridImp()
{
- FX_INT32 iCount = m_Columns.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_Columns.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
delete (CFWL_GridColRow *) m_Columns[i];
}
m_Columns.RemoveAll();
iCount = m_Rows.GetSize();
- for (FX_INT32 j = 0; j < iCount; j++) {
+ for (int32_t j = 0; j < iCount; j++) {
delete (CFWL_GridColRow*) m_Rows[j];
}
m_Rows.RemoveAll();
@@ -251,8 +251,8 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat FX_BOOL bDrawLine = FALSE;
CFX_Path path;
path.Create();
- FX_INT32 iColumns = m_Columns.GetSize();
- for (FX_INT32 i = 1; i < iColumns; i++) {
+ int32_t iColumns = m_Columns.GetSize();
+ for (int32_t i = 1; i < iColumns; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i];
if (!pColRow) {
continue;
@@ -265,8 +265,8 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat pColRow->m_fActualPos,
m_pProperties->m_rtWidget.height);
}
- FX_INT32 iRows = m_Rows.GetSize();
- for (FX_INT32 j = 1; j < iRows; j++) {
+ int32_t iRows = m_Rows.GetSize();
+ for (int32_t j = 1; j < iRows; j++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[j];
if (!pColRow) {
continue;
@@ -288,7 +288,7 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat pGraphics->RestoreGraphState();
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_GridImp::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex )
+FWL_ERR CFWL_GridImp::InsertWidget(IFWL_Widget *pChild, int32_t nIndex )
{
_FWL_RETURN_VALUE_IF_FAIL(pChild, FWL_ERR_Indefinite);
CFWL_ContentImp::InsertWidget(pChild, nIndex);
@@ -306,12 +306,12 @@ FWL_ERR CFWL_GridImp::RemoveWidget(IFWL_Widget* pWidget) if (CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)m_mapWidgetInfo.GetValueAt(pWidget)) {
m_mapWidgetInfo.RemoveKey(pWidget);
delete pInfo;
- FX_INT32 nIndex = m_Widgets.Find(pWidget);
+ int32_t nIndex = m_Widgets.Find(pWidget);
m_Widgets.RemoveAt(nIndex, 1);
}
return FWL_ERR_Succeeded;
}
-FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex )
+FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, int32_t nIndex )
{
if (bColumn) {
if (nIndex < 0 || nIndex > m_Columns.GetSize()) {
@@ -328,14 +328,14 @@ FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex ) m_Rows.InsertAt(nIndex, pRow, 1);
return (FWL_HGRIDCOLROW)pRow;
}
-FX_INT32 CFWL_GridImp::CountColRows(FX_BOOL bColumn)
+int32_t CFWL_GridImp::CountColRows(FX_BOOL bColumn)
{
if (bColumn) {
return m_Columns.GetSize();
}
return m_Rows.GetSize();
}
-FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex)
+FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, int32_t nIndex)
{
if (bColumn) {
if (nIndex < 0 || nIndex >= m_Columns.GetSize()) {
@@ -348,7 +348,7 @@ FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex) }
return (FWL_HGRIDCOLROW)m_Rows[nIndex];
}
-FX_INT32 CFWL_GridImp::GetIndex(FWL_HGRIDCOLROW hColRow)
+int32_t CFWL_GridImp::GetIndex(FWL_HGRIDCOLROW hColRow)
{
if (IsColumn(hColRow)) {
return m_Columns.Find(hColRow);
@@ -402,7 +402,7 @@ FWL_ERR CFWL_GridImp::SetMaxSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GR }
FX_BOOL CFWL_GridImp::DeleteColRow(FWL_HGRIDCOLROW hColRow)
{
- FX_INT32 nIndex = m_Columns.Find(hColRow);
+ int32_t nIndex = m_Columns.Find(hColRow);
if (nIndex >= 0) {
m_Columns.RemoveAt(nIndex);
delete (CFWL_GridColRow*)hColRow;
@@ -420,7 +420,7 @@ FX_BOOL CFWL_GridImp::IsColumn(FWL_HGRIDCOLROW hColRow) {
return m_Columns.Find(hColRow) != -1;
}
-FX_INT32 CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn)
+int32_t CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn)
{
CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget);
if (pInfo) {
@@ -428,7 +428,7 @@ FX_INT32 CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) }
return -1;
}
-FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn)
+FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn)
{
CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget);
if (pInfo) {
@@ -436,7 +436,7 @@ FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL }
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn)
+int32_t CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn)
{
CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget);
if (pInfo) {
@@ -444,7 +444,7 @@ FX_INT32 CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) }
return 0;
}
-FWL_ERR CFWL_GridImp::SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn)
+FWL_ERR CFWL_GridImp::SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn)
{
CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget);
if (pInfo) {
@@ -511,7 +511,7 @@ CFWL_GridWidgetInfo* CFWL_GridImp::GetWidgetInfo(IFWL_Widget* pWidget) {
return (CFWL_GridWidgetInfo*)m_mapWidgetInfo.GetValueAt(pWidget);
}
-void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn)
+void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn)
{
pColRow->m_fActualSize = fColRowSize;
FX_POSITION ps = m_mapWidgetInfo.GetStartPosition();
@@ -530,7 +530,7 @@ void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX }
}
}
-void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_BOOL bColumn)
+void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_BOOL bColumn)
{
_FWL_RETURN_IF_FAIL(pColRow);
FX_FLOAT fMaxSize = 0, fWidgetSize = 0;
@@ -562,7 +562,7 @@ void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_ }
SetColRowActualSize(pColRow, fMaxSize);
}
-void CFWL_GridImp::ProcScaledColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn)
+void CFWL_GridImp::ProcScaledColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn)
{
if (fColRowSize > 0) {
ProcFixedColRow(pColRow, nIndex, fColRowSize, bColumn);
@@ -655,7 +655,7 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) if (fWidth <= 0) {
return ProcessUnCertainColumns();
}
- FX_INT32 iColumns = m_Columns.GetSize();
+ int32_t iColumns = m_Columns.GetSize();
if (iColumns < 1) {
return fWidth;
}
@@ -664,7 +664,7 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) CFX_PtrArray autoColumns;
CFX_PtrArray scaledColumns;
FX_FLOAT fScaledColumnNum = 0;
- for (FX_INT32 i = 0; i < iColumns; i++) {
+ for (int32_t i = 0; i < iColumns; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i];
if (!pColRow) {
continue;
@@ -698,9 +698,9 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) }
CFX_PtrArray spanAutoColumns;
FX_FLOAT fSpanSize = 0;
- FX_INT32 iAutoColRows = 0;
- FX_INT32 iScaledColRows = 0;
- for (FX_INT32 i = 0; i < pInfo->m_iColumnSpan; i++) {
+ int32_t iAutoColRows = 0;
+ int32_t iScaledColRows = 0;
+ for (int32_t i = 0; i < pInfo->m_iColumnSpan; i++) {
CFWL_GridColRow *pColumn = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + i);
if (!pColumn) {
break;
@@ -724,8 +724,8 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) }
}
}
- FX_INT32 iAutoCols = autoColumns.GetSize();
- for (FX_INT32 k = 0; k < iAutoCols; k++) {
+ int32_t iAutoCols = autoColumns.GetSize();
+ for (int32_t k = 0; k < iAutoCols; k++) {
fAutoWidth += ((CFWL_GridColRow*)autoColumns[k])->m_fActualSize;
}
FX_FLOAT fScaledWidth = fWidth - fFixedWidth - fAutoWidth;
@@ -739,7 +739,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) if (fHeight <= 0) {
return ProcessUnCertainRows();
}
- FX_INT32 iRows = m_Rows.GetSize();
+ int32_t iRows = m_Rows.GetSize();
if (iRows < 1) {
return fHeight;
}
@@ -748,7 +748,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) CFX_PtrArray autoRows;
CFX_PtrArray scaledRows;
FX_FLOAT fScaledRowNum = 0;
- for (FX_INT32 i = 0; i < iRows; i++) {
+ for (int32_t i = 0; i < iRows; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[i];
if (!pColRow) {
continue;
@@ -783,9 +783,9 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) }
CFX_PtrArray spanAutoRows;
FX_FLOAT fSpanSize = 0;
- FX_INT32 iAutoColRows = 0;
- FX_INT32 iScaledColRows = 0;
- for (FX_INT32 i = 0; i < pInfo->m_iRowSpan; i++) {
+ int32_t iAutoColRows = 0;
+ int32_t iScaledColRows = 0;
+ for (int32_t i = 0; i < pInfo->m_iRowSpan; i++) {
CFWL_GridColRow *pRow = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + i);
if (!pRow) {
break;
@@ -809,8 +809,8 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) }
}
}
- FX_INT32 iAutoRows = autoRows.GetSize();
- for (FX_INT32 k = 0; k < iAutoRows; k++) {
+ int32_t iAutoRows = autoRows.GetSize();
+ for (int32_t k = 0; k < iAutoRows; k++) {
fAutoHeigt += ((CFWL_GridColRow*)autoRows[k])->m_fActualSize;
}
FX_FLOAT fScaledHeight = fHeight - fFixedHeight - fAutoHeigt;
@@ -821,7 +821,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) }
FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns()
{
- FX_INT32 iColumns = m_Columns.GetSize();
+ int32_t iColumns = m_Columns.GetSize();
if (iColumns < 1) {
CFWL_GridColRow *pColRow = new CFWL_GridColRow;
pColRow->m_Size.eUnit = FWL_GRIDUNIT_Auto;
@@ -835,7 +835,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() CFX_PtrArray scaledColumns;
FX_FLOAT fScaledColumnNum = 0;
FX_FLOAT fScaledMaxPerWidth = 0;
- for (FX_INT32 i = 0; i < iColumns; i++) {
+ for (int32_t i = 0; i < iColumns; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i];
if (!pColRow) {
continue;
@@ -867,7 +867,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() }
}
iColumns = scaledColumns.GetSize();
- for (FX_INT32 j = 0; j < iColumns; j++) {
+ for (int32_t j = 0; j < iColumns; j++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)scaledColumns[j];
if (!pColRow) {
continue;
@@ -886,9 +886,9 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() CFX_PtrArray spanScaledColumns;
FX_FLOAT fSpanSize = 0;
FX_FLOAT fScaledSum = 0;
- FX_INT32 iAutoColRows = 0;
- FX_INT32 iScaledColRows = 0;
- for (FX_INT32 i = 0; i < pInfo->m_iColumnSpan; i++) {
+ int32_t iAutoColRows = 0;
+ int32_t iScaledColRows = 0;
+ for (int32_t i = 0; i < pInfo->m_iColumnSpan; i++) {
CFWL_GridColRow *pColumn = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + i);
if (!pColumn) {
break;
@@ -919,20 +919,20 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() }
}
FX_FLOAT fAutoWidth = 0;
- FX_INT32 iAutoCols = autoColumns.GetSize();
- for (FX_INT32 m = 0; m < iAutoCols; m++) {
+ int32_t iAutoCols = autoColumns.GetSize();
+ for (int32_t m = 0; m < iAutoCols; m++) {
fAutoWidth += ((CFWL_GridColRow*)autoColumns[m])->m_fActualSize;
}
FX_FLOAT fScaledWidth = 0;
iColumns = scaledColumns.GetSize();
- for (FX_INT32 n = 0; n < iColumns; n++) {
+ for (int32_t n = 0; n < iColumns; n++) {
fScaledWidth += ((CFWL_GridColRow*)scaledColumns[n])->m_fActualSize;
}
return fFixedWidth + fAutoWidth + fScaledWidth;
}
FX_FLOAT CFWL_GridImp::ProcessUnCertainRows()
{
- FX_INT32 iRows = m_Rows.GetSize();
+ int32_t iRows = m_Rows.GetSize();
if (iRows < 1) {
CFWL_GridColRow *pColRow = new CFWL_GridColRow;
pColRow->m_Size.eUnit = FWL_GRIDUNIT_Auto;
@@ -946,7 +946,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() CFX_PtrArray scaledRows;
FX_FLOAT fScaledRowNum = 0;
FX_FLOAT fScaledMaxPerHeight = 0;
- for (FX_INT32 i = 0; i < iRows; i++) {
+ for (int32_t i = 0; i < iRows; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[i];
if (!pColRow) {
continue;
@@ -978,7 +978,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() }
}
iRows = scaledRows.GetSize();
- for (FX_INT32 j = 0; j < iRows; j++) {
+ for (int32_t j = 0; j < iRows; j++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)scaledRows[j];
if (!pColRow) {
continue;
@@ -997,9 +997,9 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() CFX_PtrArray spanScaledRows;
FX_FLOAT fSpanSize = 0;
FX_FLOAT fScaledSum = 0;
- FX_INT32 iAutoColRows = 0;
- FX_INT32 iScaledColRows = 0;
- for (FX_INT32 i = 0; i < pInfo->m_iRowSpan; i++) {
+ int32_t iAutoColRows = 0;
+ int32_t iScaledColRows = 0;
+ for (int32_t i = 0; i < pInfo->m_iRowSpan; i++) {
CFWL_GridColRow *pRow = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + i);
if (!pRow) {
break;
@@ -1030,13 +1030,13 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() }
}
FX_FLOAT fAutoHeigt = 0;
- FX_INT32 iAutoRows = autoRows.GetSize();
- for (FX_INT32 m = 0; m < iAutoRows; m++) {
+ int32_t iAutoRows = autoRows.GetSize();
+ for (int32_t m = 0; m < iAutoRows; m++) {
fAutoHeigt += ((CFWL_GridColRow*)autoRows[m])->m_fActualSize;
}
FX_FLOAT fScaledHeight = 0;
iRows = scaledRows.GetSize();
- for (FX_INT32 n = 0; n < iRows; n++) {
+ for (int32_t n = 0; n < iRows; n++) {
fScaledHeight += ((CFWL_GridColRow*)scaledRows[n])->m_fActualSize;
}
return fFixedHeight + fAutoHeigt + fScaledHeight;
@@ -1086,8 +1086,8 @@ FX_FLOAT CFWL_GridImp::SetWidgetActualHeight(CFWL_GridWidgetInfo* pInfo, FX_FLOA void CFWL_GridImp::SetAllWidgetsRect()
{
FX_FLOAT fStartLeft = 0;
- FX_INT32 iColumns = m_Columns.GetSize();
- for (FX_INT32 i = 0; i < iColumns; i++) {
+ int32_t iColumns = m_Columns.GetSize();
+ for (int32_t i = 0; i < iColumns; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i];
if (!pColRow) {
continue;
@@ -1096,8 +1096,8 @@ void CFWL_GridImp::SetAllWidgetsRect() fStartLeft += pColRow->m_fActualSize;
}
FX_FLOAT fStartTop = 0;
- FX_INT32 iRows = m_Rows.GetSize();
- for (FX_INT32 j = 0; j < iRows; j++) {
+ int32_t iRows = m_Rows.GetSize();
+ for (int32_t j = 0; j < iRows; j++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[j];
if (!pColRow) {
continue;
@@ -1125,7 +1125,7 @@ void CFWL_GridImp::SetAllWidgetsRect() }
FX_FLOAT fColumnWidth = 0;
if (iColumns > 0) {
- for (FX_INT32 j = 0; j < pInfo->m_iColumnSpan; j++) {
+ for (int32_t j = 0; j < pInfo->m_iColumnSpan; j++) {
CFWL_GridColRow *pCol = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + j);
if (!pCol) {
break;
@@ -1137,7 +1137,7 @@ void CFWL_GridImp::SetAllWidgetsRect() }
FX_FLOAT fRowHeight = 0;
if (iRows > 0) {
- for (FX_INT32 k = 0; k < pInfo->m_iRowSpan; k++) {
+ for (int32_t k = 0; k < pInfo->m_iRowSpan; k++) {
CFWL_GridColRow *pR = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + k);
if (!pR) {
break;
@@ -1220,20 +1220,20 @@ FX_BOOL CFWL_GridImp::IsGrid(IFWL_Widget* pWidget) }
void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT fTotalSize)
{
- FX_INT32 iAutoColRows = spanAutos.GetSize();
+ int32_t iAutoColRows = spanAutos.GetSize();
if (iAutoColRows < 1) {
return;
}
CFX_PtrArray autoNoMinMaxs;
FX_FLOAT fAutoPer = fTotalSize / iAutoColRows;
- for (FX_INT32 j = 0; j < iAutoColRows; j++) {
+ for (int32_t j = 0; j < iAutoColRows; j++) {
CFWL_GridColRow *pColumn = (CFWL_GridColRow*)spanAutos[j];
FX_FLOAT fOrgSize = pColumn->m_fActualSize;
if (SetColRowActualSize(pColumn, pColumn->m_fActualSize + fAutoPer, TRUE)) {
autoNoMinMaxs.Add(pColumn);
} else {
fTotalSize -= pColumn->m_fActualSize - fOrgSize;
- FX_INT32 iNoMinMax = iAutoColRows - (j + 1 - autoNoMinMaxs.GetSize());
+ int32_t iNoMinMax = iAutoColRows - (j + 1 - autoNoMinMaxs.GetSize());
if (iNoMinMax > 0 && fTotalSize > 0) {
fAutoPer = fTotalSize / iNoMinMax;
} else {
@@ -1241,11 +1241,11 @@ void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT }
}
}
- FX_INT32 iNormals = autoNoMinMaxs.GetSize();
+ int32_t iNormals = autoNoMinMaxs.GetSize();
if (fTotalSize > 0) {
if (iNormals == iAutoColRows) {
fAutoPer = fTotalSize / iNormals;
- for (FX_INT32 k = 0; k < iNormals; k++) {
+ for (int32_t k = 0; k < iNormals; k++) {
CFWL_GridColRow *pColumn = (CFWL_GridColRow*)autoNoMinMaxs[k];
pColumn->m_fActualSize += fAutoPer;
}
@@ -1257,20 +1257,20 @@ void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT }
void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_FLOAT fTotalSize, FX_FLOAT fTotalScaledNum)
{
- FX_INT32 iScaledColRows = spanScaleds.GetSize();
+ int32_t iScaledColRows = spanScaleds.GetSize();
if (iScaledColRows < 1) {
return;
}
CFX_PtrArray autoNoMinMaxs;
FX_FLOAT fPerSize = fTotalSize / fTotalScaledNum;
- for (FX_INT32 i = 0; i < iScaledColRows; i++) {
+ for (int32_t i = 0; i < iScaledColRows; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)spanScaleds[i];
if (SetColRowActualSize(pColRow, pColRow->m_fActualSize + fPerSize * pColRow->m_Size.fLength, TRUE)) {
autoNoMinMaxs.Add(pColRow);
} else {
fTotalSize -= pColRow->m_fActualSize;
fTotalScaledNum -= pColRow->m_Size.fLength;
- FX_INT32 iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize());
+ int32_t iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize());
if (iNoMinMax > 0 && fTotalSize > 0) {
fPerSize = fTotalSize / fTotalScaledNum;
} else {
@@ -1278,11 +1278,11 @@ void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_F }
}
}
- FX_INT32 iNormals = autoNoMinMaxs.GetSize();
+ int32_t iNormals = autoNoMinMaxs.GetSize();
if (fTotalSize > 0) {
if (iNormals == iScaledColRows) {
fPerSize = fTotalSize / fTotalScaledNum;
- for (FX_INT32 j = 0; j < iNormals; j++) {
+ for (int32_t j = 0; j < iNormals; j++) {
CFWL_GridColRow *pColumn = (CFWL_GridColRow*)autoNoMinMaxs[j];
pColumn->m_fActualSize += fPerSize * pColumn->m_Size.fLength;
}
@@ -1294,13 +1294,13 @@ void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_F }
void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOAT fTotalSize, FX_FLOAT fTotalScaledNum)
{
- FX_INT32 iScaledColRows = spanScaleds.GetSize();
+ int32_t iScaledColRows = spanScaleds.GetSize();
if (iScaledColRows < 1) {
return;
}
CFX_PtrArray autoNoMinMaxs;
FX_FLOAT fPerSize = fTotalSize / fTotalScaledNum;
- for (FX_INT32 i = 0; i < iScaledColRows; i++) {
+ for (int32_t i = 0; i < iScaledColRows; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)spanScaleds[i];
if (!pColRow) {
continue;
@@ -1312,7 +1312,7 @@ void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOA } else {
fTotalSize -= pColRow->m_fActualSize - fOrgSize;
fTotalScaledNum -= pColRow->m_Size.fLength;
- FX_INT32 iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize());
+ int32_t iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize());
if (iNoMinMax > 0 && fTotalSize > 0) {
fPerSize = fTotalSize / fTotalScaledNum;
} else {
@@ -1320,11 +1320,11 @@ void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOA }
}
}
- FX_INT32 iNormals = autoNoMinMaxs.GetSize();
+ int32_t iNormals = autoNoMinMaxs.GetSize();
if (fTotalSize > 0) {
if (iNormals == iScaledColRows) {
fPerSize = fTotalSize / fTotalScaledNum;
- for (FX_INT32 i = 0; i < iNormals; i++) {
+ for (int32_t i = 0; i < iNormals; i++) {
CFWL_GridColRow *pColRow = (CFWL_GridColRow*)autoNoMinMaxs[i];
if (!pColRow) {
continue;
@@ -1342,7 +1342,7 @@ CFWL_GridDelegate::CFWL_GridDelegate(CFWL_GridImp *pOwner) : m_pOwner(pOwner)
{
}
-FX_INT32 CFWL_GridDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_GridDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
if (pMessage->GetClassID() != FWL_MSGHASH_Mouse) {
return 0;
diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp index 101516fcac..4a9c138d86 100644 --- a/xfa/src/fwl/src/core/fwl_noteimp.cpp +++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp @@ -26,7 +26,7 @@ FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message *pMessage) }
return TranslateAccelerator(pMessage);
}
-FWL_ERR CFWL_NoteLoop::Idle(FX_INT32 count)
+FWL_ERR CFWL_NoteLoop::Idle(int32_t count)
{
#if (_FX_OS_==_FX_WIN32_DESKTOP_)
if (count <= 0)
@@ -123,7 +123,7 @@ CFWL_NoteDriver::~CFWL_NoteDriver() FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note *pNote)
{
if (pNote->IsEvent()) {
- FX_INT32 iCount = m_eventTargets.GetCount();
+ int32_t iCount = m_eventTargets.GetCount();
if (iCount < 1) {
return TRUE;
}
@@ -169,29 +169,29 @@ FX_BOOL CFWL_NoteDriver::PostMessage(CFWL_Message *pMessage) #define FWL_NoteDriver_EventKey 1100
FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget *pListener, IFWL_Widget *pEventSource , FX_DWORD dwFilter )
{
- FX_DWORD dwkey = (FX_DWORD)(FX_UINTPTR)pListener->GetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey);
+ FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey);
if (dwkey == 0) {
FX_LPVOID random = FX_Random_MT_Start(0);
dwkey = rand();
FX_Random_MT_Close(random);
- pListener->SetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey, (FX_LPVOID)(FX_UINTPTR)dwkey, NULL);
+ pListener->SetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey, (FX_LPVOID)(uintptr_t)dwkey, NULL);
}
CFWL_EventTarget *value = NULL;
- if (!m_eventTargets.Lookup((void*)(FX_UINTPTR)dwkey, (FX_LPVOID&)value)) {
+ if (!m_eventTargets.Lookup((void*)(uintptr_t)dwkey, (FX_LPVOID&)value)) {
value = FX_NEW CFWL_EventTarget(this, pListener);
- m_eventTargets.SetAt((void*)(FX_UINTPTR)dwkey, value);
+ m_eventTargets.SetAt((void*)(uintptr_t)dwkey, value);
}
value->SetEventSource(pEventSource, dwFilter);
return FWL_ERR_Succeeded;
}
FWL_ERR CFWL_NoteDriver::UnregisterEventTarget(IFWL_Widget *pListener)
{
- FX_DWORD dwkey = (FX_DWORD)(FX_UINTPTR)pListener->GetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey);
+ FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey);
if (dwkey == 0) {
return FWL_ERR_Indefinite;
}
CFWL_EventTarget *value = NULL;
- if (m_eventTargets.Lookup((void*)(FX_UINTPTR)dwkey, (FX_LPVOID&)value)) {
+ if (m_eventTargets.Lookup((void*)(uintptr_t)dwkey, (FX_LPVOID&)value)) {
value->FlagInvalid();
}
return FWL_ERR_Succeeded;
@@ -200,11 +200,11 @@ void CFWL_NoteDriver::ClearEventTargets(FX_BOOL bRemoveAll) {
ClearInvalidEventTargets(bRemoveAll);
}
-FX_INT32 CFWL_NoteDriver::GetQueueMaxSize() const
+int32_t CFWL_NoteDriver::GetQueueMaxSize() const
{
return m_maxSize;
}
-FWL_ERR CFWL_NoteDriver::SetQueueMaxSize(const FX_INT32 size)
+FWL_ERR CFWL_NoteDriver::SetQueueMaxSize(const int32_t size)
{
m_maxSize = size;
return FWL_ERR_Succeeded;
@@ -220,7 +220,7 @@ FWL_ERR CFWL_NoteDriver::PushNoteLoop(IFWL_NoteLoop *pNoteLoop) }
IFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop()
{
- FX_INT32 pos = m_noteLoopQueue.GetSize();
+ int32_t pos = m_noteLoopQueue.GetSize();
_FWL_RETURN_VALUE_IF_FAIL(pos > 0, NULL);
IFWL_NoteLoop * p = (IFWL_NoteLoop *) m_noteLoopQueue.GetAt(pos - 1);
m_noteLoopQueue.RemoveAt(pos - 1);
@@ -282,7 +282,7 @@ FWL_ERR CFWL_NoteDriver::Run() }
#elif (_FX_OS_==_FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
FX_BOOL bIdle = TRUE;
- FX_INT32 iIdleCount = 0;
+ int32_t iIdleCount = 0;
CFWL_NoteLoop *pTopLoop = NULL;
for (;;) {
pTopLoop = GetTopLoop();
@@ -364,8 +364,8 @@ void CFWL_NoteDriver::NotifyTargetDestroy(IFWL_Widget *pNoteTarget) m_pGrab = NULL;
}
UnregisterEventTarget(pNoteTarget);
- FX_INT32 count = m_forms.GetSize();
- for (FX_INT32 nIndex = 0; nIndex < count; nIndex ++) {
+ int32_t count = m_forms.GetSize();
+ for (int32_t nIndex = 0; nIndex < count; nIndex ++) {
CFWL_FormImp *pForm = (CFWL_FormImp*)m_forms[nIndex];
if (!pForm) {
continue;
@@ -398,7 +398,7 @@ FWL_ERR CFWL_NoteDriver::RegisterForm(CFWL_WidgetImp *pForm) FWL_ERR CFWL_NoteDriver::UnRegisterForm(CFWL_WidgetImp *pForm)
{
_FWL_RETURN_VALUE_IF_FAIL(pForm, FWL_ERR_Indefinite);
- FX_INT32 nIndex = m_forms.Find(pForm);
+ int32_t nIndex = m_forms.Find(pForm);
if (nIndex < 0) {
return FWL_ERR_Indefinite;
}
@@ -434,11 +434,11 @@ FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop *pNoteLoop) }
CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop()
{
- FX_INT32 size = m_noteLoopQueue.GetSize();
+ int32_t size = m_noteLoopQueue.GetSize();
_FWL_RETURN_VALUE_IF_FAIL(size > 0, NULL);
return (CFWL_NoteLoop*)m_noteLoopQueue[size - 1];
}
-FX_INT32 CFWL_NoteDriver::CountLoop()
+int32_t CFWL_NoteDriver::CountLoop()
{
return m_noteLoopQueue.GetSize();
}
@@ -542,7 +542,7 @@ FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate *pMsg, IFWL_Widget *pMe if (m_bFullScreen) {
return FALSE;
}
- FX_INT32 iTrackLoop = m_noteLoopQueue.GetSize();
+ int32_t iTrackLoop = m_noteLoopQueue.GetSize();
_FWL_RETURN_VALUE_IF_FAIL(iTrackLoop > 0, FALSE);
if (iTrackLoop == 1) {
if (pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) {
@@ -760,8 +760,8 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) if (pMessage->GetClassID() == FWL_MSGHASH_Post) {
return TRUE;
}
- FX_INT32 iCount = m_noteLoopQueue.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_noteLoopQueue.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_NoteLoop *pNoteLoop = (CFWL_NoteLoop*)m_noteLoopQueue[i];
CFWL_WidgetImp *pForm = pNoteLoop->GetForm();
if (pForm && (pForm->GetInterface() == pMessage->m_pDstTarget)) {
@@ -769,7 +769,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) }
}
iCount = m_forms.GetSize();
- for (FX_INT32 j = 0; j < iCount; j ++) {
+ for (int32_t j = 0; j < iCount; j ++) {
CFWL_FormImp *pForm = (CFWL_FormImp*)m_forms[j];
if (pForm->GetInterface() == pMessage->m_pDstTarget) {
return TRUE;
@@ -779,7 +779,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) }
IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget *pDstTarget)
{
- FX_INT32 iTrackLoop = m_noteLoopQueue.GetSize();
+ int32_t iTrackLoop = m_noteLoopQueue.GetSize();
_FWL_RETURN_VALUE_IF_FAIL(iTrackLoop > 0, NULL);
IFWL_Widget *pMessageForm = NULL;
if (iTrackLoop > 1) {
@@ -812,16 +812,16 @@ class CFWL_CoreToopTipDP : public IFWL_ToolTipDP {
public:
FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption);
- FX_INT32 GetInitialDelay(IFWL_Widget *pWidget);
- FX_INT32 GetAutoPopDelay(IFWL_Widget *pWidget);
+ int32_t GetInitialDelay(IFWL_Widget *pWidget);
+ int32_t GetAutoPopDelay(IFWL_Widget *pWidget);
CFX_DIBitmap* GetToolTipIcon(IFWL_Widget *pWidget);
CFX_SizeF GetToolTipIconSize(IFWL_Widget *pWidget);
CFX_RectF GetAnchor();
CFWL_CoreToopTipDP();
CFX_WideString m_wsCaption;
- FX_INT32 m_nInitDelayTime;
- FX_INT32 m_nAutoPopDelayTime;
+ int32_t m_nInitDelayTime;
+ int32_t m_nAutoPopDelayTime;
CFX_RectF m_fAnchor;
};
CFWL_CoreToopTipDP::CFWL_CoreToopTipDP()
@@ -835,11 +835,11 @@ FWL_ERR CFWL_CoreToopTipDP::GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsC wsCaption = m_wsCaption;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget *pWidget)
+int32_t CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget *pWidget)
{
return m_nInitDelayTime;
}
-FX_INT32 CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget *pWidget)
+int32_t CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget *pWidget)
{
return m_nAutoPopDelayTime;
}
@@ -861,7 +861,7 @@ CFWL_EventTarget::~CFWL_EventTarget() {
m_eventSources.RemoveAll();
}
-FX_INT32 CFWL_EventTarget::SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter)
+int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter)
{
if (pSource) {
m_eventSources.SetAt(pSource, dwFilter);
@@ -997,8 +997,8 @@ FX_ERR CFWL_ToolTipContainer::RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget) }
FX_BOOL CFWL_ToolTipContainer::HasToolTip(IFWL_Widget *pWedget)
{
- FX_INT32 iCount = m_arrWidget.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_arrWidget.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
IFWL_ToolTipTarget *p = (IFWL_ToolTipTarget *)m_arrWidget[i];
if (p->GetWidget() == pWedget) {
pCurTarget = p;
@@ -1079,12 +1079,12 @@ IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() {
return pCurTarget;
}
-FX_ERR CFWL_ToolTipContainer::SetToolTipInitialDelay(FX_INT32 nDelayTime)
+FX_ERR CFWL_ToolTipContainer::SetToolTipInitialDelay(int32_t nDelayTime)
{
m_ToolTipDp->m_nInitDelayTime = nDelayTime;
return FWL_ERR_Succeeded;
}
-FX_ERR CFWL_ToolTipContainer::SetToolTipAutoPopDelay(FX_INT32 nDelayTime)
+FX_ERR CFWL_ToolTipContainer::SetToolTipAutoPopDelay(int32_t nDelayTime)
{
m_ToolTipDp->m_nAutoPopDelayTime = nDelayTime;
return FWL_ERR_Succeeded;
@@ -1097,11 +1097,11 @@ FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget) {
return CFWL_ToolTipContainer::getInstance()->RemoveToolTipTarget(pTarget);
}
-FWL_ERR FWL_SetToolTipInitialDelay(FX_INT32 nDelayTime)
+FWL_ERR FWL_SetToolTipInitialDelay(int32_t nDelayTime)
{
return CFWL_ToolTipContainer::getInstance()->SetToolTipInitialDelay(nDelayTime);
}
-FWL_ERR FWL_SetToolTipAutoPopDelay(FX_INT32 nDelayTime)
+FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t nDelayTime)
{
return CFWL_ToolTipContainer::getInstance()->SetToolTipAutoPopDelay(nDelayTime);
}
diff --git a/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp b/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp index fae5a2a6db..25636ea582 100644 --- a/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp +++ b/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp @@ -63,7 +63,7 @@ FWL_ERR CFWL_SDAdapterWidgetMgr::RepaintWidget(IFWL_Widget *pWidget, const CFX_R {
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_SDAdapterWidgetMgr::Exit(FX_INT32 iExitCode)
+FWL_ERR CFWL_SDAdapterWidgetMgr::Exit(int32_t iExitCode)
{
return FWL_ERR_Succeeded;
}
@@ -135,11 +135,11 @@ FWL_ERR CFWL_SDAdapterWidgetMgr::InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuD {
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_SDAdapterWidgetMgr::UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType)
+FWL_ERR CFWL_SDAdapterWidgetMgr::UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, int32_t iType)
{
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_SDAdapterWidgetMgr::TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData)
+int32_t CFWL_SDAdapterWidgetMgr::TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData)
{
return 0;
}
@@ -173,11 +173,11 @@ FWL_ERR CFWL_SDAdapterThreadMgr::Suspend(FWL_HTHREAD hThread) {
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_SDAdapterThreadMgr::Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode)
+FWL_ERR CFWL_SDAdapterThreadMgr::Kill(FWL_HTHREAD hThread, int32_t iExitCode)
{
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_SDAdapterThreadMgr::Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode)
+FWL_ERR CFWL_SDAdapterThreadMgr::Stop(FWL_HTHREAD hThread, int32_t iExitCode)
{
return FWL_ERR_Succeeded;
}
diff --git a/xfa/src/fwl/src/core/fwl_threadimp.cpp b/xfa/src/fwl/src/core/fwl_threadimp.cpp index 66f4144c71..7d9609a9cd 100644 --- a/xfa/src/fwl/src/core/fwl_threadimp.cpp +++ b/xfa/src/fwl/src/core/fwl_threadimp.cpp @@ -35,7 +35,7 @@ FWL_ERR CFWL_Thread::Run(FWL_HTHREAD hThread) }
CFWL_ControlThread * CFWL_NoteThread::_assistantThreadHandler = NULL;
FWL_HTHREAD CFWL_NoteThread::_assistantThread = NULL;
-FX_INT32 CFWL_NoteThread::_refCount = 0;
+int32_t CFWL_NoteThread::_refCount = 0;
IFWL_NoteThread* IFWL_NoteThread::Create()
{
return (IFWL_NoteThread*) FX_NEW CFWL_NoteThread;
@@ -92,7 +92,7 @@ FWL_ERR FWL_SuspendThread(FWL_HTHREAD hThread) _FWL_RETURN_VALUE_IF_FAIL(ThreadMgr, FWL_ERR_Indefinite);
return ThreadMgr->Suspend(hThread);
}
-FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, FX_INT32 iExitCode)
+FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, int32_t iExitCode)
{
IFWL_AdapterNative * Native = FWL_GetAdapterNative();
_FWL_RETURN_VALUE_IF_FAIL(Native, FWL_ERR_Indefinite);
@@ -100,7 +100,7 @@ FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, FX_INT32 iExitCode) _FWL_RETURN_VALUE_IF_FAIL(ThreadMgr, FWL_ERR_Indefinite);
return ThreadMgr->Kill(hThread, iExitCode);
}
-FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, FX_INT32 iExitCode)
+FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, int32_t iExitCode)
{
IFWL_AdapterNative * Native = FWL_GetAdapterNative();
_FWL_RETURN_VALUE_IF_FAIL(Native, FWL_ERR_Indefinite);
@@ -144,15 +144,15 @@ FWL_ERR FWL_WaitSemaphore(FWL_HSEMAPHORE hSemaphore) {
return ((IFWL_AdapterSemaphore*)hSemaphore)->Wait();
}
-FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 down )
+FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t down )
{
return ((IFWL_AdapterSemaphore*)hSemaphore)->Post();
}
-FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, FX_INT32 &value)
+FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, int32_t &value)
{
return ((IFWL_AdapterSemaphore*)hSemaphore)->Value((FX_DWORD &)value);
}
-FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 init)
+FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t init)
{
return ((IFWL_AdapterSemaphore*)hSemaphore)->Reset(init);
}
diff --git a/xfa/src/fwl/src/core/fwl_timerimp.cpp b/xfa/src/fwl/src/core/fwl_timerimp.cpp index e0300f4316..300ab5cefb 100644 --- a/xfa/src/fwl/src/core/fwl_timerimp.cpp +++ b/xfa/src/fwl/src/core/fwl_timerimp.cpp @@ -18,7 +18,7 @@ FWL_HTIMER FWL_StartTimer(IFWL_Timer *pTimer, FX_DWORD dwElapse, FX_BOOL bImmedi pAdapterTimerMgr->Start(pTimer, dwElapse, hTimer, bImmediately);
return hTimer;
}
-FX_INT32 FWL_StopTimer(FWL_HTIMER hTimer)
+int32_t FWL_StopTimer(FWL_HTIMER hTimer)
{
IFWL_AdapterNative *pAdapterNative = FWL_GetAdapterNative();
_FWL_RETURN_VALUE_IF_FAIL(pAdapterNative, FWL_ERR_Indefinite);
diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp index 61186a7ede..4659e6bc9e 100644 --- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp @@ -450,8 +450,8 @@ FWL_ERR CFWL_WidgetImp::GetMatrix(CFX_Matrix &matrix, FX_BOOL bGlobal ) matrix.Reset();
CFX_Matrix ctmOnParent;
CFX_RectF rect;
- FX_INT32 count = parents.GetSize();
- for (FX_INT32 i = count - 2; i >= 0; i--) {
+ int32_t count = parents.GetSize();
+ for (int32_t i = count - 2; i >= 0; i--) {
parent = (IFWL_Widget *) parents.GetAt(i);
parent->GetMatrix(ctmOnParent, FALSE);
parent->GetWidgetRect(rect);
@@ -708,7 +708,7 @@ CFWL_WidgetImp* CFWL_WidgetImp::GetSameAncestor(CFWL_WidgetImp *pWidget) arr2.Add(pAncestor);
relation = pAncestor->IsPopup() ? FWL_WGTRELATION_Owner : FWL_WGTRELATION_Parent;
} while ((pAncestor = (CFWL_WidgetImp*)m_pWidgetMgr->GetWidget(pAncestor->m_pInterface, relation)) != NULL);
- for (FX_INT32 i = 0; i < arr1.GetSize(); i ++) {
+ for (int32_t i = 0; i < arr1.GetSize(); i ++) {
FX_LPVOID pVoid = arr1[i];
if (arr2.Find(pVoid) < 0) {
continue;
@@ -755,7 +755,7 @@ FX_BOOL CFWL_WidgetImp::TransformFromOuter(FX_FLOAT &fx, FX_FLOAT &fy) #define FWL_WGT_CalcHeight 2048
#define FWL_WGT_CalcWidth 2048
#define FWL_WGT_CalcMultiLineDefWidth 120.0f
-CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine , FX_INT32 iLineWidth )
+CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine , int32_t iLineWidth )
{
CFX_SizeF sz;
sz.Set(0, 0);
@@ -775,7 +775,7 @@ CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeP sz.y = rect.height;
return sz;
}
-void CFWL_WidgetImp::CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, FX_INT32 iTTOAlign, CFX_RectF &rect)
+void CFWL_WidgetImp::CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, int32_t iTTOAlign, CFX_RectF &rect)
{
CFWL_ThemeText calPart;
calPart.m_pWidget = m_pInterface;
@@ -955,7 +955,7 @@ void CFWL_WidgetImp::Repaint(const CFX_RectF *pRect ) m_pWidgetMgr->RepaintWidget(m_pInterface, &rect);
}
void CFWL_WidgetImp::DrawBackground(CFX_Graphics *pGraphics,
- FX_INT32 iPartBk,
+ int32_t iPartBk,
IFWL_ThemeProvider *pTheme,
const CFX_Matrix *pMatrix )
{
@@ -972,7 +972,7 @@ void CFWL_WidgetImp::DrawBackground(CFX_Graphics *pGraphics, pTheme->DrawBackground(¶m);
}
void CFWL_WidgetImp::DrawBorder(CFX_Graphics *pGraphics,
- FX_INT32 iPartBorder,
+ int32_t iPartBorder,
IFWL_ThemeProvider *pTheme,
const CFX_Matrix *pMatrix )
{
@@ -989,7 +989,7 @@ void CFWL_WidgetImp::DrawBorder(CFX_Graphics *pGraphics, pTheme->DrawBackground(¶m);
}
void CFWL_WidgetImp::DrawEdge(CFX_Graphics *pGraphics,
- FX_INT32 iPartEdge,
+ int32_t iPartEdge,
IFWL_ThemeProvider *pTheme,
const CFX_Matrix *pMatrix )
{
@@ -1051,7 +1051,7 @@ FX_BOOL CFWL_WidgetImp::IsParent(IFWL_Widget *pParent) CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate()
{
}
-FX_INT32 CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage->m_pDstTarget, 0);
CFWL_WidgetImp *pWidget = (CFWL_WidgetImp*)((IFWL_TargetData*)pMessage->m_pDstTarget)->GetData();
diff --git a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp index 283c328008..a1e1d45718 100644 --- a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp @@ -59,12 +59,12 @@ CFWL_WidgetMgr::~CFWL_WidgetMgr() m_pDelegate = NULL;
}
}
-FX_INT32 CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent )
+int32_t CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent )
{
CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);
return TravelWidgetMgr(pParentItem, NULL, NULL);
}
-IFWL_Widget* CFWL_WidgetMgr::GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent )
+IFWL_Widget* CFWL_WidgetMgr::GetWidget(int32_t nIndex, IFWL_Widget *pParent )
{
CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);
IFWL_Widget *pWidget = NULL;
@@ -138,19 +138,19 @@ IFWL_Widget* CFWL_WidgetMgr::GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRe }
return pRet;
}
-FX_INT32 CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget)
+int32_t CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget)
{
CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget);
_FWL_RETURN_VALUE_IF_FAIL(pItem, -1);
return TravelWidgetMgr(pItem->pParent, NULL, pItem);
}
-FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex)
+FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex)
{
CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget);
_FWL_RETURN_VALUE_IF_FAIL(pItem, FALSE);
_FWL_RETURN_VALUE_IF_FAIL(pItem->pParent, FALSE);
CFWL_WidgetMgrItem *pChild = pItem->pParent->pChild;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (pChild) {
if (pChild == pItem) {
if (i == nIndex) {
@@ -264,7 +264,7 @@ void CFWL_WidgetMgr::AddWidget(IFWL_Widget *pWidget) pItem->pParent = pParentItem;
SetWidgetIndex(pWidget, -1);
}
-void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, FX_INT32 nIndex )
+void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, int32_t nIndex )
{
CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);
if (!pParentItem) {
@@ -462,7 +462,7 @@ FX_BOOL CFWL_WidgetMgr::IsIdleMessage_Native() {
return m_pAdapter->IsIdleMessage();
}
-FWL_ERR CFWL_WidgetMgr::Exit_Native(FX_INT32 iExitCode)
+FWL_ERR CFWL_WidgetMgr::Exit_Native(int32_t iExitCode)
{
return m_pAdapter->Exit(iExitCode);
}
@@ -527,9 +527,9 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget *parent, IFWL_Widget *focus, FX }
return NULL;
}
-FX_INT32 CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst)
+int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst)
{
- FX_INT32 iRet = 0;
+ int32_t iRet = 0;
IFWL_Widget *pChild = pFirst;
while (pChild) {
if ((pChild->GetStyles() & FWL_WGTSTYLE_Group) && pChild->GetClassID() == 3811304691) {
@@ -580,7 +580,7 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(IFWL_Widget *pRadioButton, CFX_PtrA if (!pFirst) {
pFirst = pRadioButton;
}
- FX_INT32 iGroup = CountRadioButtonGroup(pFirst);
+ int32_t iGroup = CountRadioButtonGroup(pFirst);
if (iGroup < 2) {
if (pFirst->GetClassID() == 3811304691) {
group.Add(pFirst);
@@ -636,12 +636,12 @@ CFWL_WidgetMgrItem* CFWL_WidgetMgr::GetWidgetMgrItem(IFWL_Widget *pWidget) {
return (CFWL_WidgetMgrItem*)m_mapWidgetItem.GetValueAt(pWidget);
}
-FX_INT32 CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, FX_INT32 *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget )
+int32_t CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, int32_t *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget )
{
if (!pParent) {
return 0;
}
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CFWL_WidgetMgrItem *pChild = pParent->pChild;
while (pChild) {
iCount ++;
@@ -695,7 +695,7 @@ FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(FX_DWORD dwCapability ) m_pWidgetMgr->m_dwCapability = dwCapability;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage)
+int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage)
{
_FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);
_FWL_RETURN_VALUE_IF_FAIL(pMessage->m_pDstTarget, 0);
@@ -833,7 +833,7 @@ CFX_Graphics* CFWL_WidgetMgrDelegate::DrawWidgetBefore(IFWL_Widget *pWidget, CFX pItem->pOffscreen = FX_NEW CFX_Graphics;
CFX_RectF rect;
pWidget->GetWidgetRect(rect);
- pItem->pOffscreen->Create((FX_INT32)rect.width, (FX_INT32)rect.height, FXDIB_Argb);
+ pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height, FXDIB_Argb);
}
CFX_RectF rect;
pGraphics->GetClipRect(rect);
@@ -893,7 +893,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * FX_BOOL bOrginPtIntersectWidthChild = FALSE;
FX_BOOL bOrginPtIntersectWidthDirty = rtDirty.Contains(rtWidget.left, rtWidget.top);
static FWL_NeedRepaintHitData hitPoint[FWL_NEEDREPAINTHIT_Point];
- static FX_INT32 iSize = sizeof(FWL_NeedRepaintHitData);
+ static int32_t iSize = sizeof(FWL_NeedRepaintHitData);
FXSYS_memset(hitPoint, 0, iSize);
FX_FLOAT fxPiece = rtWidget.width / FWL_NEEDREPAINTHIT_Piece;
FX_FLOAT fyPiece = rtWidget.height / FWL_NEEDREPAINTHIT_Piece;
@@ -928,7 +928,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * } else if (!(pChild->GetStates() & FWL_WGTSTATE_Invisible)) {
rtChilds.Union(rect);
}
- for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {
+ for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {
if (hitPoint[i].bNotContainByDirty || hitPoint[i].bNotNeedRepaint) {
continue;
}
@@ -950,8 +950,8 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * if (rtChilds.IsEmpty()) {
return TRUE;
}
- FX_INT32 repaintPoint = FWL_NEEDREPAINTHIT_Point;
- for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {
+ int32_t repaintPoint = FWL_NEEDREPAINTHIT_Point;
+ for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {
if (hitPoint[i].bNotNeedRepaint) {
repaintPoint --;
}
@@ -1027,7 +1027,7 @@ FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget *pWidget, const CFX_WideString *saveFi CFX_RectF r;
pWidget->GetWidgetRect(r);
CFX_Graphics gs;
- gs.Create((FX_INT32)r.width, (FX_INT32)r.height, FXDIB_Argb);
+ gs.Create((int32_t)r.width, (int32_t)r.height, FXDIB_Argb);
CFWL_WidgetMgr *widgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr();
CFWL_WidgetMgrDelegate *delegate = widgetMgr->GetDelegate();
delegate->OnDrawWidget(pWidget, &gs, pMatrix);
diff --git a/xfa/src/fwl/src/core/include/fwl_appimp.h b/xfa/src/fwl/src/core/include/fwl_appimp.h index edc2089252..e0f1f5977a 100644 --- a/xfa/src/fwl/src/core/include/fwl_appimp.h +++ b/xfa/src/fwl/src/core/include/fwl_appimp.h @@ -23,7 +23,7 @@ public: virtual IFWL_AdapterNative* GetAdapterNative();
virtual IFWL_WidgetMgr* GetWidgetMgr();
virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
- virtual FWL_ERR Exit(FX_INT32 iExitCode = 0);
+ virtual FWL_ERR Exit(int32_t iExitCode = 0);
IFWL_ThemeProvider* GetThemeProvider();
protected:
CFWL_WidgetMgr *m_pWidgetMgr;
diff --git a/xfa/src/fwl/src/core/include/fwl_contentimp.h b/xfa/src/fwl/src/core/include/fwl_contentimp.h index 0aaaf0e1b8..95a47a3796 100644 --- a/xfa/src/fwl/src/core/include/fwl_contentimp.h +++ b/xfa/src/fwl/src/core/include/fwl_contentimp.h @@ -15,7 +15,7 @@ public: CFWL_ContentImp();
CFWL_ContentImp(const CFWL_WidgetImpProperties &properties);
virtual ~CFWL_ContentImp();
- virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex = -1);
+ virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, int32_t nIndex = -1);
virtual FWL_ERR RemoveWidget(IFWL_Widget *pWidget);
virtual FWL_ERR RemoveAllWidgets();
virtual FWL_ERR GetMinSize(FX_FLOAT &fWidth, FX_FLOAT &fHeight);
diff --git a/xfa/src/fwl/src/core/include/fwl_formimp.h b/xfa/src/fwl/src/core/include/fwl_formimp.h index b283c121e9..0cf9c9d25c 100644 --- a/xfa/src/fwl/src/core/include/fwl_formimp.h +++ b/xfa/src/fwl/src/core/include/fwl_formimp.h @@ -58,7 +58,7 @@ public: {
bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled;
}
- FX_INT32 GetPartState()
+ int32_t GetPartState()
{
return (IsDisabled() ? FWL_PARTSTATE_FRM_Disabled : (m_dwState + 1));
}
@@ -116,8 +116,8 @@ protected: void CalcContentRect(CFX_RectF &rtContent);
CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy);
CFWL_SysBtn* GetSysBtnByState(FX_DWORD dwState);
- CFWL_SysBtn* GetSysBtnByIndex(FX_INT32 nIndex);
- FX_INT32 GetSysBtnIndex(CFWL_SysBtn *pBtn);
+ CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex);
+ int32_t GetSysBtnIndex(CFWL_SysBtn *pBtn);
FX_FLOAT GetCaptionHeight();
void DrawCaptionText(CFX_Graphics *pGs, IFWL_ThemeProvider *pTheme, const CFX_Matrix* pMatrix = NULL);
void DrawIconImage(CFX_Graphics *pGs, IFWL_ThemeProvider *pTheme, const CFX_Matrix* pMatrix = NULL);
@@ -150,9 +150,9 @@ protected: RestoreInfo m_InfoStart;
FX_FLOAT m_fCXBorder;
FX_FLOAT m_fCYBorder;
- FX_INT32 m_iCaptureBtn;
- FX_INT32 m_iSysBox;
- FX_INT32 m_eResizeType;
+ int32_t m_iCaptureBtn;
+ int32_t m_iSysBox;
+ int32_t m_eResizeType;
FX_BOOL m_bLButtonDown;
FX_BOOL m_bMaximized;
FX_BOOL m_bSetMaximize;
@@ -170,7 +170,7 @@ class CFWL_FormDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_FormDelegate(CFWL_FormImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fwl/src/core/include/fwl_gridimp.h b/xfa/src/fwl/src/core/include/fwl_gridimp.h index 1bd7ada04b..82aeb7ecdc 100644 --- a/xfa/src/fwl/src/core/include/fwl_gridimp.h +++ b/xfa/src/fwl/src/core/include/fwl_gridimp.h @@ -71,10 +71,10 @@ public: m_Size[FWL_GRIDSIZE_MaxHeight].fLength = 0;
m_Margin[0] = m_Margin[1] = m_Margin[2] = m_Margin[3] = 0;
}
- FX_INT32 m_iColumn;
- FX_INT32 m_iColumnSpan;
- FX_INT32 m_iRow;
- FX_INT32 m_iRowSpan;
+ int32_t m_iColumn;
+ int32_t m_iColumnSpan;
+ int32_t m_iRow;
+ int32_t m_iRowSpan;
CFWL_GridLength m_Size[6];
FX_DWORD m_dwMarginFlag;
FX_FLOAT m_Margin[4];
@@ -96,12 +96,12 @@ public: virtual FWL_ERR Update();
virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
- virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex = -1);
+ virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, int32_t nIndex = -1);
virtual FWL_ERR RemoveWidget(IFWL_Widget *pWidget);
- virtual FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex = -1);
- virtual FX_INT32 CountColRows(FX_BOOL bColumn);
- virtual FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, FX_INT32 nIndex);
- virtual FX_INT32 GetIndex(FWL_HGRIDCOLROW hColRow);
+ virtual FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1);
+ virtual int32_t CountColRows(FX_BOOL bColumn);
+ virtual FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex);
+ virtual int32_t GetIndex(FWL_HGRIDCOLROW hColRow);
virtual FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit);
virtual FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit);
virtual FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit);
@@ -110,10 +110,10 @@ public: virtual FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit);
virtual FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow);
virtual FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow);
- virtual FX_INT32 GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn);
- virtual FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn);
- virtual FX_INT32 GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn);
- virtual FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn);
+ virtual int32_t GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn);
+ virtual FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn);
+ virtual int32_t GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn);
+ virtual FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn);
virtual FX_FLOAT GetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FWL_GRIDUNIT &eUnit);
virtual FWL_ERR SetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit);
virtual FX_BOOL GetWidgetMargin(IFWL_Widget *pWidget, FWL_GRIDMARGIN eMargin, FX_FLOAT &fMargin);
@@ -123,9 +123,9 @@ public: virtual FWL_ERR SetGridSize(FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit);
protected:
CFWL_GridWidgetInfo* GetWidgetInfo(IFWL_Widget* pWidget);
- void ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn);
- void ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_BOOL bColumn);
- void ProcScaledColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn);
+ void ProcFixedColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn);
+ void ProcAutoColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_BOOL bColumn);
+ void ProcScaledColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn);
void CalcWidgetWidth(IFWL_Widget *pWidget, CFWL_GridWidgetInfo *pInfo, FX_FLOAT fColunmWidth);
void CalcWidgetHeigt(IFWL_Widget *pWidget, CFWL_GridWidgetInfo *pInfo, FX_FLOAT fRowHeigt);
FX_FLOAT CalcAutoColumnWidgetWidth(IFWL_Widget *pWidget, CFWL_GridWidgetInfo* pInfo);
@@ -153,7 +153,7 @@ class CFWL_GridDelegate : public CFWL_WidgetImpDelegate {
public:
CFWL_GridDelegate(CFWL_GridImp *pOwner);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
CFWL_GridImp *m_pOwner;
diff --git a/xfa/src/fwl/src/core/include/fwl_noteimp.h b/xfa/src/fwl/src/core/include/fwl_noteimp.h index 08ab13d3e7..699840d27e 100644 --- a/xfa/src/fwl/src/core/include/fwl_noteimp.h +++ b/xfa/src/fwl/src/core/include/fwl_noteimp.h @@ -21,7 +21,7 @@ class CFWL_NoteLoop public:
CFWL_NoteLoop(CFWL_WidgetImp *pForm = NULL);
virtual FX_BOOL PreProcessMessage(CFWL_Message *pMessage);
- virtual FWL_ERR Idle(FX_INT32 count);
+ virtual FWL_ERR Idle(int32_t count);
CFWL_WidgetImp* GetForm();
FX_BOOL ContinueModal();
FWL_ERR EndModalLoop();
@@ -43,8 +43,8 @@ public: virtual FWL_ERR RegisterEventTarget(IFWL_Widget *pListener, IFWL_Widget *pEventSource = NULL, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK);
virtual FWL_ERR UnregisterEventTarget(IFWL_Widget *pListener);
virtual void ClearEventTargets(FX_BOOL bRemoveAll);
- virtual FX_INT32 GetQueueMaxSize() const;
- virtual FWL_ERR SetQueueMaxSize(const FX_INT32 size);
+ virtual int32_t GetQueueMaxSize() const;
+ virtual FWL_ERR SetQueueMaxSize(const int32_t size);
virtual IFWL_NoteThread* GetOwnerThread() const;
virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop *pNoteLoop);
virtual IFWL_NoteLoop* PopNoteLoop();
@@ -62,7 +62,7 @@ public: FX_BOOL QueueMessage(CFWL_Message *pMessage);
FX_BOOL UnqueueMessage(CFWL_NoteLoop *pNoteLoop);
CFWL_NoteLoop* GetTopLoop();
- FX_INT32 CountLoop();
+ int32_t CountLoop();
void SetHook(FWLMessageHookCallback callback, FX_LPVOID info);
FX_BOOL ProcessMessage(CFWL_Message *pMessage);
protected:
@@ -86,8 +86,8 @@ protected: CFX_PtrArray m_noteQueue;
CFX_PtrArray m_noteLoopQueue;
CFX_MapPtrToPtr m_eventTargets;
- FX_INT32 m_sendEventCalled;
- FX_INT32 m_maxSize;
+ int32_t m_sendEventCalled;
+ int32_t m_maxSize;
FX_BOOL m_bFullScreen;
IFWL_Widget *m_pHover;
IFWL_Widget *m_pFocus;
@@ -107,7 +107,7 @@ public: {
}
~CFWL_EventTarget();
- FX_INT32 SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK);
+ int32_t SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK);
FX_BOOL ProcessEvent(CFWL_Event *pEvent);
FX_BOOL IsFilterEvent(CFWL_Event *pEvent, FX_DWORD dwFilter);
FX_BOOL IsInvalid()
@@ -139,8 +139,8 @@ public: FX_BOOL ProcessEnter(CFWL_EvtMouse *pEvt, IFWL_Widget *pOwner);
FX_BOOL ProcessLeave(CFWL_EvtMouse *pEvt);
- FX_ERR SetToolTipInitialDelay(FX_INT32 iDelayTime);
- FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+ FX_ERR SetToolTipInitialDelay(int32_t iDelayTime);
+ FX_ERR SetToolTipAutoPopDelay(int32_t iDelayTime);
protected:
CFWL_ToolTipContainer();
diff --git a/xfa/src/fwl/src/core/include/fwl_threadimp.h b/xfa/src/fwl/src/core/include/fwl_threadimp.h index e03e6c6e15..26acc54006 100644 --- a/xfa/src/fwl/src/core/include/fwl_threadimp.h +++ b/xfa/src/fwl/src/core/include/fwl_threadimp.h @@ -48,6 +48,6 @@ protected: FWL_HTHREAD m_hThread;
static CFWL_ControlThread * _assistantThreadHandler;
static FWL_HTHREAD _assistantThread;
- static FX_INT32 _refCount;
+ static int32_t _refCount;
};
#endif
diff --git a/xfa/src/fwl/src/core/include/fwl_widgetimp.h b/xfa/src/fwl/src/core/include/fwl_widgetimp.h index 862bb53665..4d28722576 100644 --- a/xfa/src/fwl/src/core/include/fwl_widgetimp.h +++ b/xfa/src/fwl/src/core/include/fwl_widgetimp.h @@ -83,8 +83,8 @@ protected: CFX_SizeF GetOffsetFromAncestor(CFWL_WidgetImp *pAncestor);
FX_BOOL TransformToOuter(FX_FLOAT &fx, FX_FLOAT &fy);
FX_BOOL TransformFromOuter(FX_FLOAT &fx, FX_FLOAT &fy);
- CFX_SizeF CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine = FALSE, FX_INT32 iLineWidth = -1);
- void CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, FX_INT32 iTTOAlign, CFX_RectF &rect);
+ CFX_SizeF CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine = FALSE, int32_t iLineWidth = -1);
+ void CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, int32_t iTTOAlign, CFX_RectF &rect);
void SetFocus(FX_BOOL bFocus);
void SetGrab(FX_BOOL bSet);
FX_BOOL GetPopupPos(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup);
@@ -97,9 +97,9 @@ protected: void DispatchKeyEvent(CFWL_MsgKey *pNote);
void DispatchEvent(CFWL_Event *pEvent);
void Repaint(const CFX_RectF *pRect = NULL);
- void DrawBackground(CFX_Graphics *pGraphics, FX_INT32 iPartBk, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
- void DrawBorder(CFX_Graphics *pGraphics, FX_INT32 iPartBorder, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
- void DrawEdge(CFX_Graphics *pGraphics, FX_INT32 iPartEdge, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
+ void DrawBackground(CFX_Graphics *pGraphics, int32_t iPartBk, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
+ void DrawBorder(CFX_Graphics *pGraphics, int32_t iPartBorder, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
+ void DrawEdge(CFX_Graphics *pGraphics, int32_t iPartEdge, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL);
void NotifyDriver();
FX_BOOL IsParent(IFWL_Widget *pParent);
@@ -111,7 +111,7 @@ protected: IFWL_WidgetDelegate *m_pCurDelegate;
IFWL_Widget *m_pOuter;
IFWL_Widget *m_pInterface;
- FX_INT32 m_iLock;
+ int32_t m_iLock;
friend class CFWL_WidgetImpDelegate;
friend void FWL_SetWidgetRect(IFWL_Widget *widget, const CFX_RectF &rect);
friend void FWL_SetWidgetStates(IFWL_Widget *widget, FX_DWORD dwStates);
@@ -121,7 +121,7 @@ class CFWL_WidgetImpDelegate {
public:
CFWL_WidgetImpDelegate();
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
};
diff --git a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h index 314021f9b6..f730f5b33d 100644 --- a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h +++ b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h @@ -44,7 +44,7 @@ public: CFWL_WidgetMgrItem *pNext;
IFWL_Widget *pWidget;
CFX_Graphics *pOffscreen;
- FX_INT32 iRedrawCounter;
+ int32_t iRedrawCounter;
#if (_FX_OS_==_FX_WIN32_DESKTOP_) || (_FX_OS_==_FX_WIN64_)
FX_BOOL bOutsideChanged;
#endif
@@ -54,11 +54,11 @@ class CFWL_WidgetMgr public:
CFWL_WidgetMgr(IFWL_AdapterNative *pAdapterNative);
~CFWL_WidgetMgr();
- virtual FX_INT32 CountWidgets(IFWL_Widget *pParent = NULL);
- virtual IFWL_Widget* GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent = NULL);
+ virtual int32_t CountWidgets(IFWL_Widget *pParent = NULL);
+ virtual IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget *pParent = NULL);
virtual IFWL_Widget* GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRelation);
- virtual FX_INT32 GetWidgetIndex(IFWL_Widget *pWidget);
- virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex);
+ virtual int32_t GetWidgetIndex(IFWL_Widget *pWidget);
+ virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex);
virtual FX_BOOL IsWidget(FX_LPVOID pObj);
virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect = NULL);
virtual FX_DWORD GetCapability()
@@ -66,7 +66,7 @@ public: return m_dwCapability;
}
void AddWidget(IFWL_Widget *pWidget);
- void InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, FX_INT32 nIndex = -1);
+ void InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, int32_t nIndex = -1);
void RemoveWidget(IFWL_Widget *pWidget);
void SetOwner(IFWL_Widget *pOwner, IFWL_Widget *pOwned);
void SetParent(IFWL_Widget *pParent, IFWL_Widget *pChild);
@@ -87,12 +87,12 @@ public: FX_BOOL CheckMessage_Native();
FWL_ERR DispatchMessage_Native();
FX_BOOL IsIdleMessage_Native();
- FWL_ERR Exit_Native(FX_INT32 iExitCode);
+ FWL_ERR Exit_Native(int32_t iExitCode);
FWL_ERR CreateWidgetWithNativeId_Native(IFWL_Widget *pWidget, void *vp);
IFWL_Widget* GetWidgetAtPoint(IFWL_Widget *pParent, FX_FLOAT fx, FX_FLOAT fy);
void NotifySizeChanged(IFWL_Widget *pForm, FX_FLOAT fx, FX_FLOAT fy);
IFWL_Widget* nextTab(IFWL_Widget *parent, IFWL_Widget *focus, FX_BOOL &bFind);
- FX_INT32 CountRadioButtonGroup(IFWL_Widget *pFirst);
+ int32_t CountRadioButtonGroup(IFWL_Widget *pFirst);
IFWL_Widget* GetSiblingRadioButton(IFWL_Widget *pWidget, FX_BOOL bNext);
IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget *pRadioButton);
void GetSameGroupRadioButton(IFWL_Widget *pRadioButton, CFX_PtrArray &group);
@@ -112,7 +112,7 @@ public: FX_BOOL IsFormDisabled();
FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup);
protected:
- FX_INT32 TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, FX_INT32 *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget = NULL);
+ int32_t TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, int32_t *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget = NULL);
FX_BOOL IsAbleNative(IFWL_Widget *pWidget);
CFX_MapPtrToPtr m_mapWidgetItem;
IFWL_AdapterWidgetMgr *m_pAdapter;
@@ -128,7 +128,7 @@ class CFWL_WidgetMgrDelegate public:
CFWL_WidgetMgrDelegate(CFWL_WidgetMgr *pWidgetMgr);
virtual FWL_ERR OnSetCapability(FX_DWORD dwCapability = FWL_WGTMGR_DisableThread);
- virtual FX_INT32 OnProcessMessageToForm(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessageToForm(CFWL_Message *pMessage);
virtual FWL_ERR OnDrawWidget(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix );
protected:
void DrawChild(IFWL_Widget *pParent, const CFX_RectF &rtClip, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix );
diff --git a/xfa/src/fwl/src/lightwidget/app.cpp b/xfa/src/fwl/src/lightwidget/app.cpp index e89b6c86de..54327c8cbc 100644 --- a/xfa/src/fwl/src/lightwidget/app.cpp +++ b/xfa/src/fwl/src/lightwidget/app.cpp @@ -31,7 +31,7 @@ CFWL_Theme* CFWL_App::GetTheme() {
return m_pThemeProvider;
}
-FWL_ERR CFWL_App::Exit(FX_INT32 iExitCode )
+FWL_ERR CFWL_App::Exit(int32_t iExitCode )
{
_FWL_RETURN_VALUE_IF_FAIL(m_pAppImp, FWL_ERR_Indefinite);
return m_pAppImp->Exit(iExitCode);
diff --git a/xfa/src/fwl/src/lightwidget/checkbox.cpp b/xfa/src/fwl/src/lightwidget/checkbox.cpp index cb659fffa7..298aa41b4e 100644 --- a/xfa/src/fwl/src/lightwidget/checkbox.cpp +++ b/xfa/src/fwl/src/lightwidget/checkbox.cpp @@ -45,11 +45,11 @@ FWL_ERR CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) m_checkboxData.m_fBoxHeight = fHeight;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_CheckBox::GetCheckState()
+int32_t CFWL_CheckBox::GetCheckState()
{
return ((IFWL_CheckBox*)m_pImp)->GetCheckState();
}
-FWL_ERR CFWL_CheckBox::SetCheckState(FX_INT32 iCheck)
+FWL_ERR CFWL_CheckBox::SetCheckState(int32_t iCheck)
{
return ((IFWL_CheckBox*)m_pImp)->SetCheckState(iCheck);
}
diff --git a/xfa/src/fwl/src/lightwidget/combobox.cpp b/xfa/src/fwl/src/lightwidget/combobox.cpp index 557dc2d2b5..c443dfbcb3 100644 --- a/xfa/src/fwl/src/lightwidget/combobox.cpp +++ b/xfa/src/fwl/src/lightwidget/combobox.cpp @@ -35,14 +35,14 @@ FWL_ERR CFWL_ComboBox::Initialize(const CFWL_WidgetProperties *pProperties ) }
return ret;
}
-FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText)
+int32_t CFWL_ComboBox::AddString(FX_WSTR wsText)
{
CFWL_ComboBoxItem *pItem = FX_NEW CFWL_ComboBoxItem;
pItem->m_wsText = wsText;
pItem->m_dwStyles = 0;
return m_comboBoxData.m_arrItem.Add(pItem);
}
-FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon)
+int32_t CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon)
{
CFWL_ComboBoxItem *pItem = FX_NEW CFWL_ComboBoxItem;
pItem->m_wsText = wsText;
@@ -50,32 +50,32 @@ FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon) pItem->m_pDIB = pIcon;
return m_comboBoxData.m_arrItem.Add(pItem);
}
-FX_INT32 CFWL_ComboBox::RemoveAt(FX_INT32 iIndex)
+int32_t CFWL_ComboBox::RemoveAt(int32_t iIndex)
{
return m_comboBoxData.m_arrItem.RemoveAt(iIndex);
}
-FX_INT32 CFWL_ComboBox::RemoveAll()
+int32_t CFWL_ComboBox::RemoveAll()
{
m_comboBoxData.m_arrItem.RemoveAll();
return 0;
}
-FX_INT32 CFWL_ComboBox::CountItems()
+int32_t CFWL_ComboBox::CountItems()
{
return m_comboBoxData.CountItems(GetWidget());
}
-FWL_ERR CFWL_ComboBox::GetTextByIndex(FX_INT32 iIndex, CFX_WideString &wsText)
+FWL_ERR CFWL_ComboBox::GetTextByIndex(int32_t iIndex, CFX_WideString &wsText)
{
CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex));
_FWL_RETURN_VALUE_IF_FAIL(pItem, FWL_ERR_Indefinite);
wsText = pItem->m_wsText;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ComboBox::GetCurSel()
+int32_t CFWL_ComboBox::GetCurSel()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1);
return ((IFWL_ComboBox*)m_pImp)->GetCurSel();
}
-FWL_ERR CFWL_ComboBox::SetCurSel(FX_INT32 iSel)
+FWL_ERR CFWL_ComboBox::SetCurSel(int32_t iSel)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->SetCurSel(iSel);
@@ -85,37 +85,37 @@ FWL_ERR CFWL_ComboBox::SetEditText(FX_WSTR wsText) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->SetEditText(wsText);
}
-FX_INT32 CFWL_ComboBox::GetEditTextLength() const
+int32_t CFWL_ComboBox::GetEditTextLength() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_ComboBox*)m_pImp)->GetEditTextLength();
}
-FWL_ERR CFWL_ComboBox::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR CFWL_ComboBox::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->GetEditText(wsText, nStart, nCount);
}
-FWL_ERR CFWL_ComboBox::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR CFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->SetEditSelRange(nStart, nCount);
}
-FX_INT32 CFWL_ComboBox::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t &nStart)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_ComboBox*)m_pImp)->GetEditSelRange(nIndex, nStart);
}
-FX_INT32 CFWL_ComboBox::GetEditLimit()
+int32_t CFWL_ComboBox::GetEditLimit()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_ComboBox*)m_pImp)->GetEditLimit();
}
-FWL_ERR CFWL_ComboBox::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_ComboBox::SetEditLimit(int32_t nLimit)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->SetEditLimit(nLimit);
}
-FWL_ERR CFWL_ComboBox::EditDoClipboard(FX_INT32 iCmd)
+FWL_ERR CFWL_ComboBox::EditDoClipboard(int32_t iCmd)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_ComboBox*)m_pImp)->EditDoClipboard(iCmd);
@@ -135,14 +135,14 @@ FWL_ERR CFWL_ComboBox::SetMaxListHeight(FX_FLOAT fMaxHeight) m_comboBoxData.m_fMaxListHeight = fMaxHeight;
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_ComboBox::SetItemData(FX_INT32 iIndex, FX_LPVOID pData)
+FWL_ERR CFWL_ComboBox::SetItemData(int32_t iIndex, FX_LPVOID pData)
{
CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex));
_FWL_RETURN_VALUE_IF_FAIL(pItem, FWL_ERR_Indefinite);
pItem->m_pData = pData;
return FWL_ERR_Succeeded;
}
-FX_LPVOID CFWL_ComboBox::GetItemData(FX_INT32 iIndex)
+FX_LPVOID CFWL_ComboBox::GetItemData(int32_t iIndex)
{
CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex));
_FWL_RETURN_VALUE_IF_FAIL(pItem, NULL);
@@ -249,8 +249,8 @@ CFWL_ComboBox::CFWL_ComboBoxDP::CFWL_ComboBoxDP() }
CFWL_ComboBox::CFWL_ComboBoxDP::~CFWL_ComboBoxDP()
{
- FX_INT32 nCount = m_arrItem.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_arrItem.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)m_arrItem[i];
if (pItem) {
delete pItem;
@@ -258,23 +258,23 @@ CFWL_ComboBox::CFWL_ComboBoxDP::~CFWL_ComboBoxDP() }
m_arrItem.RemoveAll();
}
-FX_INT32 CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget *pWidget)
+int32_t CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget *pWidget)
{
return m_arrItem.GetSize();
}
-FWL_HLISTITEM CFWL_ComboBox::CFWL_ComboBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex)
+FWL_HLISTITEM CFWL_ComboBox::CFWL_ComboBoxDP::GetItem(IFWL_Widget *pWidget, int32_t nIndex)
{
- FX_INT32 iCount = m_arrItem.GetSize();
+ int32_t iCount = m_arrItem.GetSize();
if (nIndex >= iCount || nIndex < 0) {
return NULL;
}
return (FWL_HLISTITEM)m_arrItem[nIndex];
}
-FX_INT32 CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem)
+int32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem)
{
return m_arrItem.Find(hItem);
}
-FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex)
+FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex)
{
return m_arrItem.SetAt(nIndex, hItem);
}
diff --git a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp index 4a314c5079..5a18efe542 100644 --- a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp +++ b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp @@ -35,18 +35,18 @@ FWL_ERR CFWL_DateTimePicker::Initialize(const CFWL_WidgetProperties *pProperties }
return ret;
}
-FWL_ERR CFWL_DateTimePicker::SetToday(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FWL_ERR CFWL_DateTimePicker::SetToday(int32_t iYear, int32_t iMonth, int32_t iDay)
{
m_DateTimePickerDP.m_iYear = iYear;
m_DateTimePickerDP.m_iMonth = iMonth;
m_DateTimePickerDP.m_iDay = iDay;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_DateTimePicker::CountSelRanges()
+int32_t CFWL_DateTimePicker::CountSelRanges()
{
return ((IFWL_DateTimePicker*)m_pImp)->CountSelRanges();
}
-FX_INT32 CFWL_DateTimePicker::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t &nStart)
{
return ((IFWL_DateTimePicker*)m_pImp)->GetSelRange(nIndex, nStart);
}
@@ -58,11 +58,11 @@ FWL_ERR CFWL_DateTimePicker::SetEditText(FX_WSTR wsText) {
return ((IFWL_DateTimePicker*)m_pImp)->SetEditText(wsText);
}
-FWL_ERR CFWL_DateTimePicker::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FWL_ERR CFWL_DateTimePicker::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
return ((IFWL_DateTimePicker*)m_pImp)->GetCurSel(iYear, iMonth, iDay);
}
-FWL_ERR CFWL_DateTimePicker::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+FWL_ERR CFWL_DateTimePicker::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay)
{
return ((IFWL_DateTimePicker*)m_pImp)->SetCurSel(iYear, iMonth, iDay);
}
@@ -83,7 +83,7 @@ FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetCaption(IFWL_Widget *pWid wsCaption = m_wsData;
return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(IFWL_Widget *pWidget, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(IFWL_Widget *pWidget, int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
iYear = m_iYear;
iMonth = m_iMonth;
@@ -146,7 +146,7 @@ FWL_ERR CFWL_DateTimePicker::GetBBox(CFX_RectF &rect) {
return ((IFWL_DateTimePicker*)m_pImp)->GetBBox(rect);
}
-FWL_ERR CFWL_DateTimePicker::SetEditLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_DateTimePicker::SetEditLimit(int32_t nLimit)
{
return ((IFWL_DateTimePicker*)m_pImp)->SetEditLimit(nLimit);
}
diff --git a/xfa/src/fwl/src/lightwidget/edit.cpp b/xfa/src/fwl/src/lightwidget/edit.cpp index c87f83fac6..8bace71d74 100644 --- a/xfa/src/fwl/src/lightwidget/edit.cpp +++ b/xfa/src/fwl/src/lightwidget/edit.cpp @@ -39,12 +39,12 @@ FWL_ERR CFWL_Edit::SetText(const CFX_WideString &wsText) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->SetText(wsText);
}
-FX_INT32 CFWL_Edit::GetTextLength() const
+int32_t CFWL_Edit::GetTextLength() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_Edit*)m_pImp)->GetTextLength();
}
-FWL_ERR CFWL_Edit::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const
+FWL_ERR CFWL_Edit::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->GetText(wsText, nStart, nCount);
@@ -54,22 +54,22 @@ FWL_ERR CFWL_Edit::ClearText() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->ClearText();
}
-FX_INT32 CFWL_Edit::GetCaretPos() const
+int32_t CFWL_Edit::GetCaretPos() const
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1);
return ((IFWL_Edit*)m_pImp)->GetCaretPos();
}
-FX_INT32 CFWL_Edit::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore)
+int32_t CFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1);
return ((IFWL_Edit*)m_pImp)->SetCaretPos(nIndex, bBefore);
}
-FWL_ERR CFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR CFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
((IFWL_Edit*)m_pImp)->AddSelRange(nStart, nCount);
- FX_INT32 pos = 0;
- FX_INT32 sum = ((IFWL_Edit*)m_pImp)->GetTextLength();
+ int32_t pos = 0;
+ int32_t sum = ((IFWL_Edit*)m_pImp)->GetTextLength();
if (nCount == -1) {
pos = sum;
} else {
@@ -77,12 +77,12 @@ FWL_ERR CFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount) }
return ((IFWL_Edit*)m_pImp)->SetCaretPos(pos);
}
-FX_INT32 CFWL_Edit::CountSelRanges()
+int32_t CFWL_Edit::CountSelRanges()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_Edit*)m_pImp)->CountSelRanges();
}
-FX_INT32 CFWL_Edit::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart)
+int32_t CFWL_Edit::GetSelRange(int32_t nIndex, int32_t &nStart)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_Edit*)m_pImp)->GetSelRange(nIndex, nStart);
@@ -92,12 +92,12 @@ FWL_ERR CFWL_Edit::ClearSelections() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->ClearSelections();
}
-FX_INT32 CFWL_Edit::GetLimit()
+int32_t CFWL_Edit::GetLimit()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1);
return ((IFWL_Edit*)m_pImp)->GetLimit();
}
-FWL_ERR CFWL_Edit::SetLimit(FX_INT32 nLimit)
+FWL_ERR CFWL_Edit::SetLimit(int32_t nLimit)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->SetLimit(nLimit);
@@ -112,7 +112,7 @@ FWL_ERR CFWL_Edit::SetFormatString(const CFX_WideString &wsFormat) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->SetFormatString(wsFormat);
}
-FWL_ERR CFWL_Edit::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen)
+FWL_ERR CFWL_Edit::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->Insert(nStart, lpText, nLen);
@@ -122,7 +122,7 @@ FWL_ERR CFWL_Edit::DeleteSelections() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->DeleteSelections();
}
-FWL_ERR CFWL_Edit::DeleteRange(FX_INT32 nStart, FX_INT32 nCount)
+FWL_ERR CFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->DeleteRange(nStart, nCount);
@@ -132,12 +132,12 @@ FWL_ERR CFWL_Edit::ReplaceSelections(const CFX_WideStringC &wsReplace) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->ReplaceSelections(wsReplace);
}
-FWL_ERR CFWL_Edit::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace)
+FWL_ERR CFWL_Edit::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->Replace(nStart, nLen, wsReplace);
}
-FWL_ERR CFWL_Edit::DoClipboard(FX_INT32 iCmd)
+FWL_ERR CFWL_Edit::DoClipboard(int32_t iCmd)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->DoClipboard(iCmd);
@@ -157,7 +157,7 @@ FWL_ERR CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite);
return ((IFWL_Edit*)m_pImp)->SetTabWidth(fTabWidth, bEquidistant);
}
-FWL_ERR CFWL_Edit::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax)
+FWL_ERR CFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax)
{
if (iMin > iMax) {
return FWL_ERR_Parameter_Invalid;
diff --git a/xfa/src/fwl/src/lightwidget/listbox.cpp b/xfa/src/fwl/src/lightwidget/listbox.cpp index 7cc3878d3f..f3278df1f9 100644 --- a/xfa/src/fwl/src/lightwidget/listbox.cpp +++ b/xfa/src/fwl/src/lightwidget/listbox.cpp @@ -51,13 +51,13 @@ FWL_HLISTITEM CFWL_ListBox::AddString(FX_WSTR wsAdd, FX_BOOL bSelect) }
FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem)
{
- FX_INT32 nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem);
+ int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem);
if (nIndex < 0 || nIndex >= m_ListBoxDP.m_arrItem.GetSize()) {
return FALSE;
}
CFWL_ListItem *pDelItem = (CFWL_ListItem*)m_ListBoxDP.GetItem((IFWL_ListBox*)this, nIndex);
- FX_INT32 iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this);
- FX_INT32 iSel = nIndex + 1;
+ int32_t iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this);
+ int32_t iSel = nIndex + 1;
if (iSel >= iCount) {
iSel = nIndex - 1;
if (iSel < 0) {
@@ -74,25 +74,25 @@ FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem) }
FX_BOOL CFWL_ListBox::DeleteAll()
{
- FX_INT32 iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this);
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_ListItem *pItem = (CFWL_ListItem*)m_ListBoxDP.GetItem((IFWL_ListBox*)this, i);
delete pItem;
}
m_ListBoxDP.m_arrItem.RemoveAll();
return TRUE;
}
-FX_INT32 CFWL_ListBox::CountSelItems()
+int32_t CFWL_ListBox::CountSelItems()
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_ListBox*)m_pImp)->CountSelItems();
}
-FWL_HLISTITEM CFWL_ListBox::GetSelItem(FX_INT32 nIndexSel)
+FWL_HLISTITEM CFWL_ListBox::GetSelItem(int32_t nIndexSel)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, NULL);
return ((IFWL_ListBox*)m_pImp)->GetSelItem(nIndexSel);
}
-FX_INT32 CFWL_ListBox::GetSelIndex(FX_INT32 nIndex)
+int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex)
{
_FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0);
return ((IFWL_ListBox*)m_pImp)->GetSelIndex(nIndex);
@@ -119,7 +119,7 @@ FWL_ERR CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) }
FWL_HLISTITEM CFWL_ListBox::GetFocusItem()
{
- for (FX_INT32 i = 0; i < m_ListBoxDP.m_arrItem.GetSize(); i++) {
+ for (int32_t i = 0; i < m_ListBoxDP.m_arrItem.GetSize(); i++) {
CFWL_ListItem * hItem = (CFWL_ListItem *)(m_ListBoxDP.m_arrItem[i]);
if (hItem->m_dwStates & FWL_ITEMSTATE_LTB_Focused) {
return (FWL_HLISTITEM)hItem;
@@ -129,7 +129,7 @@ FWL_HLISTITEM CFWL_ListBox::GetFocusItem() }
FWL_ERR CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem)
{
- FX_INT32 nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem);
+ int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem);
((CFWL_ListItem *)(m_ListBoxDP.m_arrItem[nIndex]))->m_dwStates |= FWL_ITEMSTATE_LTB_Focused;
return FWL_ERR_Succeeded;
}
@@ -137,13 +137,13 @@ FWL_ERR* CFWL_ListBox::Sort(IFWL_ListBoxCompare *pCom) {
return ((IFWL_ListBox*)m_pImp)->Sort(pCom);
}
-FX_INT32 CFWL_ListBox::CountItems()
+int32_t CFWL_ListBox::CountItems()
{
return m_ListBoxDP.m_arrItem.GetSize();
}
-FWL_HLISTITEM CFWL_ListBox::GetItem(FX_INT32 nIndex)
+FWL_HLISTITEM CFWL_ListBox::GetItem(int32_t nIndex)
{
- FX_INT32 nCount = m_ListBoxDP.m_arrItem.GetSize();
+ int32_t nCount = m_ListBoxDP.m_arrItem.GetSize();
if (nIndex > nCount - 1 && nIndex < 0) {
return NULL;
}
@@ -186,8 +186,8 @@ FWL_HLISTITEM CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) FX_FLOAT fPosY = 0;
((IFWL_ListBox*)m_pImp)->GetScrollPos(fx);
((IFWL_ListBox*)m_pImp)->GetScrollPos(fy, FALSE);
- FX_INT32 nCount = m_ListBoxDP.CountItems(NULL);
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_ListBoxDP.CountItems(NULL);
+ for (int32_t i = 0; i < nCount; i ++) {
FWL_HLISTITEM hItem = m_ListBoxDP.GetItem(NULL, i);
if (!hItem) {
continue;
@@ -218,8 +218,8 @@ CFWL_ListBox::CFWL_ListBoxDP::CFWL_ListBoxDP() }
CFWL_ListBox::CFWL_ListBoxDP::~CFWL_ListBoxDP()
{
- FX_INT32 nCount = m_arrItem.GetSize();
- for (FX_INT32 i = 0; i < nCount; i ++) {
+ int32_t nCount = m_arrItem.GetSize();
+ for (int32_t i = 0; i < nCount; i ++) {
CFWL_ListItem *pItem = (CFWL_ListItem*)m_arrItem[i];
if (pItem != NULL) {
delete pItem;
@@ -232,11 +232,11 @@ FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget *pWidget, CFX_WideS wsCaption = m_wsData;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget *pWidget)
+int32_t CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget *pWidget)
{
return m_arrItem.GetSize();
}
-FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex)
+FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, int32_t nIndex)
{
if (nIndex >= m_arrItem.GetSize() || nIndex < 0) {
return NULL;
@@ -244,11 +244,11 @@ FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT return (FWL_HLISTITEM)m_arrItem[nIndex];
}
}
-FX_INT32 CFWL_ListBox::CFWL_ListBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem)
+int32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem)
{
return m_arrItem.Find(hItem);
}
-FX_BOOL CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex)
+FX_BOOL CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex)
{
return m_arrItem.SetAt(nIndex, hItem);
}
diff --git a/xfa/src/fwl/src/lightwidget/picturebox.cpp b/xfa/src/fwl/src/lightwidget/picturebox.cpp index e7d21de90e..619a473c21 100644 --- a/xfa/src/fwl/src/lightwidget/picturebox.cpp +++ b/xfa/src/fwl/src/lightwidget/picturebox.cpp @@ -53,20 +53,20 @@ FWL_ERR CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) m_PictureBoxDP.m_fRotation = fRotation;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_PictureBox::GetFlipMode()
+int32_t CFWL_PictureBox::GetFlipMode()
{
return m_PictureBoxDP.GetFlipMode((IFWL_Widget*)this);
}
-FWL_ERR CFWL_PictureBox::SetFlipMode(FX_INT32 iFlipMode)
+FWL_ERR CFWL_PictureBox::SetFlipMode(int32_t iFlipMode)
{
m_PictureBoxDP.m_iFlipMode = iFlipMode;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_PictureBox::GetOpacity()
+int32_t CFWL_PictureBox::GetOpacity()
{
return m_PictureBoxDP.GetOpacity((IFWL_Widget*)this);
}
-FWL_ERR CFWL_PictureBox::SetOpacity(FX_INT32 iOpacity)
+FWL_ERR CFWL_PictureBox::SetOpacity(int32_t iOpacity)
{
m_PictureBoxDP.m_iOpacity = iOpacity;
return FWL_ERR_Succeeded;
@@ -120,7 +120,7 @@ CFX_DIBitmap* CFWL_PictureBox::CFWL_PictureBoxDP::GetInitialPicture(IFWL_Widget {
return m_pBitmap;
}
-FX_INT32 CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget *pWidget)
+int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget *pWidget)
{
return m_iOpacity;
}
@@ -138,7 +138,7 @@ FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget *pWidget, CFX_ matrix.Translate(m_fOffSetX, m_fOffSetY);
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget *pWidget)
+int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget *pWidget)
{
return m_iFlipMode;
}
diff --git a/xfa/src/fwl/src/lightwidget/theme.cpp b/xfa/src/fwl/src/lightwidget/theme.cpp index a631b37f88..84925f562e 100644 --- a/xfa/src/fwl/src/lightwidget/theme.cpp +++ b/xfa/src/fwl/src/lightwidget/theme.cpp @@ -18,9 +18,9 @@ FX_DWORD CFWL_Theme::GetThemeID(IFWL_Widget *pWidget) }
FX_DWORD CFWL_Theme::SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BOOL bChildren )
{
- FX_INT32 iCount = m_arrThemes.GetSize();
+ int32_t iCount = m_arrThemes.GetSize();
FX_DWORD dwID;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
dwID = pTheme->GetThemeID(pWidget);
pTheme->SetThemeID(pWidget, dwThemeID, FALSE);
@@ -79,8 +79,8 @@ FX_BOOL CFWL_Theme::CalcTextRect(CFWL_ThemeText *pParams, CFX_RectF &rect) }
FWL_ERR CFWL_Theme::Initialize()
{
- FX_INT32 iCount = m_arrThemes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrThemes.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
pTheme->Initialize();
}
@@ -89,8 +89,8 @@ FWL_ERR CFWL_Theme::Initialize() }
FWL_ERR CFWL_Theme::Finalize()
{
- FX_INT32 iCount = m_arrThemes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrThemes.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
pTheme->Finalize();
}
@@ -126,8 +126,8 @@ CFWL_Theme::CFWL_Theme() }
CFWL_Theme::~CFWL_Theme()
{
- FX_INT32 iCount = m_arrThemes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrThemes.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
delete pTheme;
}
@@ -135,8 +135,8 @@ CFWL_Theme::~CFWL_Theme() }
FWL_ERR CFWL_Theme::SetFont(IFWL_Widget *pWidget, FX_LPCWSTR strFont, FX_FLOAT fFontSize, FX_ARGB rgbFont)
{
- FX_INT32 iCount = m_arrThemes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrThemes.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
pTheme->SetFont(pWidget, strFont, fFontSize, rgbFont);
}
@@ -144,8 +144,8 @@ FWL_ERR CFWL_Theme::SetFont(IFWL_Widget *pWidget, FX_LPCWSTR strFont, FX_FLOAT f }
CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget)
{
- FX_INT32 iCount = m_arrThemes.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_arrThemes.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i];
if (pTheme->IsValidWidget(pWidget)) {
return pTheme;
diff --git a/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp b/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp index 9397013c07..5fc3d5a4f3 100644 --- a/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp +++ b/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp @@ -51,20 +51,20 @@ FWL_ERR CFWL_ToolTip::SetCaption(FX_WSTR wsCaption) m_tooltipData.m_wsCaption = wsCaption;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ToolTip::GetInitialDelay()
+int32_t CFWL_ToolTip::GetInitialDelay()
{
return m_tooltipData.m_nInitDelayTime;
}
-FX_INT32 CFWL_ToolTip::SetInitialDelay(FX_INT32 nDelayTime)
+int32_t CFWL_ToolTip::SetInitialDelay(int32_t nDelayTime)
{
m_tooltipData.m_nInitDelayTime = nDelayTime;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ToolTip::GetAutoPopDelay()
+int32_t CFWL_ToolTip::GetAutoPopDelay()
{
return m_tooltipData.m_nAutoPopDelayTime;
}
-FX_INT32 CFWL_ToolTip::SetAutoPopDelay(FX_INT32 nDelayTime)
+int32_t CFWL_ToolTip::SetAutoPopDelay(int32_t nDelayTime)
{
m_tooltipData.m_nAutoPopDelayTime = nDelayTime;
return FWL_ERR_Succeeded;
@@ -119,11 +119,11 @@ FWL_ERR CFWL_ToolTip::CFWL_ToolTipDP::GetCaption(IFWL_Widget *pWidget, CFX_WideS wsCaption = m_wsCaption;
return FWL_ERR_Succeeded;
}
-FX_INT32 CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget *pWidget)
+int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget *pWidget)
{
return m_nInitDelayTime;
}
-FX_INT32 CFWL_ToolTip::CFWL_ToolTipDP::GetAutoPopDelay(IFWL_Widget *pWidget)
+int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetAutoPopDelay(IFWL_Widget *pWidget)
{
return m_nAutoPopDelayTime;
}
diff --git a/xfa/src/fwl/src/lightwidget/widget.cpp b/xfa/src/fwl/src/lightwidget/widget.cpp index f080d691bc..6171eecf31 100644 --- a/xfa/src/fwl/src/lightwidget/widget.cpp +++ b/xfa/src/fwl/src/lightwidget/widget.cpp @@ -302,7 +302,7 @@ void CFWL_Widget::DispatchEvent(CFWL_Event *pEvent) #define FWL_WGT_CalcHeight 2048
#define FWL_WGT_CalcWidth 2048
#define FWL_WGT_CalcMultiLineDefWidth 120.0f
-CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine , FX_INT32 iLineWidth )
+CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine , int32_t iLineWidth )
{
CFX_SizeF sz;
sz.Set(0, 0);
@@ -330,7 +330,7 @@ CFWL_WidgetDelegate::CFWL_WidgetDelegate() CFWL_WidgetDelegate::~CFWL_WidgetDelegate()
{
}
-FX_INT32 CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message *pMessage)
{
return 1;
}
diff --git a/xfa/src/fwl/src/theme/checkboxtp.cpp b/xfa/src/fwl/src/theme/checkboxtp.cpp index 32e74e4a44..bba56e69ed 100644 --- a/xfa/src/fwl/src/theme/checkboxtp.cpp +++ b/xfa/src/fwl/src/theme/checkboxtp.cpp @@ -101,7 +101,7 @@ FWL_ERR CFWL_CheckBoxTP::Finalize() void CFWL_CheckBoxTP::DrawBoxBk(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRect, FX_DWORD dwStates, CFX_Matrix *pMatrix )
{
dwStates &= 0x03;
- FX_INT32 fillMode = FXFILL_WINDING;
+ int32_t fillMode = FXFILL_WINDING;
FX_DWORD dwStyleEx = pWidget->GetStylesEx();
dwStyleEx &= FWL_STYLEEXT_CKB_ShapeMask;
CFX_Path path;
@@ -137,7 +137,7 @@ void CFWL_CheckBoxTP::DrawBoxBk(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, c path.AddEllipse(rtClip);
}
}
- FX_INT32 iTheme = 1;
+ int32_t iTheme = 1;
if ((dwStates & FWL_PARTSTATE_CKB_Mask1) == FWL_PARTSTATE_CKB_Hovered) {
iTheme = 2;
} else if ((dwStates & FWL_PARTSTATE_CKB_Mask1) == FWL_PARTSTATE_CKB_Pressed) {
@@ -303,14 +303,14 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics *pGraphics, const CFX_RectF *pRt ptCenter.Set((pRtSign->left + pRtSign->right()) / 2.0f, (pRtSign->top + fBottom) / 2.0f);
FX_FLOAT px[5], py[5];
FX_FLOAT fAngel = FX_PI / 10.0f;
- for (FX_INT32 i = 0; i < 5; i++) {
+ for (int32_t i = 0; i < 5; i++) {
px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
fAngel += FX_PI * 2 / 5.0f;
}
path.MoveTo(px[0], py[0]);
- FX_INT32 nNext = 0;
- for (FX_INT32 j = 0; j < 5; j++) {
+ int32_t nNext = 0;
+ for (int32_t j = 0; j < 5; j++) {
nNext += 2;
if (nNext >= 5) {
nNext -= 5;
diff --git a/xfa/src/fwl/src/theme/formtp.cpp b/xfa/src/fwl/src/theme/formtp.cpp index 5a6633d3ea..ce12c15e78 100644 --- a/xfa/src/fwl/src/theme/formtp.cpp +++ b/xfa/src/fwl/src/theme/formtp.cpp @@ -71,7 +71,7 @@ FX_DWORD CFWL_FormTP::SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BO FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground *pParams)
{
_FWL_RETURN_VALUE_IF_FAIL(pParams, FALSE);
- FX_INT32 iActive = 0;
+ int32_t iActive = 0;
if (pParams->m_dwStates & FWL_PARTSTATE_FRM_Inactive) {
iActive = 1;
}
@@ -285,7 +285,7 @@ void CFWL_FormTP::CalCaption(IFWL_Widget *pWidget, CFX_RectF &rect) void CFWL_FormTP::CalIcon(IFWL_Widget *pWidget, CFX_RectF &rect)
{
}
-void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
CFX_RectF rt;
rt.Set(pRect->left, pRect->top, 1, pRect->height);
@@ -332,7 +332,7 @@ void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4);
m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29);
}
-void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
CFX_RectF rt;
FX_FLOAT fBottom, fRight;
@@ -368,10 +368,10 @@ void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, pGraphics->StretchImage(m_pDeactivebitmap, rect, pMatrix);
}
}
-void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
}
-void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
FX_FLOAT fRight = pRect->right();
FX_FLOAT fBottom = pRect->bottom();
@@ -438,7 +438,7 @@ void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
}
-void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
pGraphics->SaveGraphState();
FX_FLOAT fRight = pRect->right();
@@ -489,14 +489,14 @@ void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF * m_pThemeData->clrNormalBtBKEnd[iActive][eState - 1],
&path, FXFILL_WINDING, pMatrix);
}
-void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
CFX_RectF rtMin;
rtMin.Set(pRect->left + 5, pRect->top + 13, pRect->width - 14, pRect->height - 18);
FillSoildRect(pGraphics, 0xFFFFFFFF, &rtMin, pMatrix);
}
-void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, int32_t iActive)
{
DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
FX_FLOAT fWidth = pRect->width;
@@ -534,7 +534,7 @@ void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRec pGraphics->RestoreGraphState();
}
}
-void CFWL_FormTP::DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive)
+void CFWL_FormTP::DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive)
{
pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix);
}
@@ -739,8 +739,8 @@ void CFWL_FormTP::DeactiveForm() }
void CFWL_FormTP::TransModeColor(FX_ARGB clrFore, FX_ARGB &clrBack)
{
- FX_INT32 iAlfaF, iRF, iGF, iBF;
- FX_INT32 iAlfaB, iRB, iGB, iBB;
+ int32_t iAlfaF, iRF, iGF, iBF;
+ int32_t iAlfaB, iRB, iGB, iBB;
ArgbDecode(clrFore, iAlfaF, iRF, iGF, iBF);
ArgbDecode(clrBack, iAlfaB, iRB, iGB, iBB);
clrBack = ArgbEncode(0xff,
diff --git a/xfa/src/fwl/src/theme/pushbuttontp.cpp b/xfa/src/fwl/src/theme/pushbuttontp.cpp index 13c5eef567..8194b249be 100644 --- a/xfa/src/fwl/src/theme/pushbuttontp.cpp +++ b/xfa/src/fwl/src/theme/pushbuttontp.cpp @@ -63,7 +63,7 @@ FX_BOOL CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground *pParams) PUSHBUTTON_SIZE_Corner,
PUSHBUTTON_SIZE_Corner);
fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height);
- FX_INT32 iColor = GetColorID(pParams->m_dwStates);
+ int32_t iColor = GetColorID(pParams->m_dwStates);
DrawAxialShading(pGraphics,
rect.left + PUSHBUTTON_SIZE_Corner,
rect.top,
@@ -159,7 +159,7 @@ void CFWL_PushButtonTP::SetThemeData(FX_DWORD dwID) m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234);
}
}
-FX_INT32 CFWL_PushButtonTP::GetColorID(FX_DWORD dwStates)
+int32_t CFWL_PushButtonTP::GetColorID(FX_DWORD dwStates)
{
return dwStates &= FWL_PARTSTATE_PSB_Mask;
}
diff --git a/xfa/src/fwl/src/theme/widgettp.cpp b/xfa/src/fwl/src/theme/widgettp.cpp index 5e186b74ab..aac6516799 100644 --- a/xfa/src/fwl/src/theme/widgettp.cpp +++ b/xfa/src/fwl/src/theme/widgettp.cpp @@ -57,7 +57,7 @@ FX_BOOL CFWL_WidgetTP::DrawText(CFWL_ThemeText *pParams) if (!m_pTextOut) {
InitTTO();
}
- FX_INT32 iLen = pParams->m_wsText.GetLength();
+ int32_t iLen = pParams->m_wsText.GetLength();
_FWL_RETURN_VALUE_IF_FAIL(iLen > 0, FALSE)
CFX_Graphics *pGraphics = pParams->m_pGraphics;
m_pTextOut->SetRenderDevice(pGraphics->GetRenderDevice());
@@ -434,7 +434,7 @@ void CFWL_WidgetTP::FillSoildRect(CFX_Graphics *pGraphics, FX_ARGB fillColor, co pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
}
-void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, FX_INT32 fillMode, CFX_Matrix *pMatrix )
+void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, int32_t fillMode, CFX_Matrix *pMatrix )
{
_FWL_RETURN_IF_FAIL(pGraphics);
_FWL_RETURN_IF_FAIL(path);
@@ -636,14 +636,14 @@ void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics *pGraphics, const CFX_RectF *pRect CFWL_ArrowData::CColorData *pColorData = CFWL_ArrowData::GetInstance()->m_pColorData;
DrawArrow(pGraphics, pRect, eDict, pColorData->clrSign[eState - 1], pMatrix);
}
-FWLCOLOR CFWL_WidgetTP::BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, FX_BYTE scale)
+FWLCOLOR CFWL_WidgetTP::BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale)
{
FWLCOLOR dstColor;
- FX_BYTE n = 255 - scale;
- dstColor.a = (FX_BYTE)(((FX_WORD)srcColor.a * n + (FX_WORD)renderColor.a * scale) >> 8);
- dstColor.r = (FX_BYTE)(((FX_WORD)srcColor.r * n + (FX_WORD)renderColor.r * scale) >> 8);
- dstColor.g = (FX_BYTE)(((FX_WORD)srcColor.g * n + (FX_WORD)renderColor.g * scale) >> 8);
- dstColor.b = (FX_BYTE)(((FX_WORD)srcColor.b * n + (FX_WORD)renderColor.b * scale) >> 8);
+ uint8_t n = 255 - scale;
+ dstColor.a = (uint8_t)(((FX_WORD)srcColor.a * n + (FX_WORD)renderColor.a * scale) >> 8);
+ dstColor.r = (uint8_t)(((FX_WORD)srcColor.r * n + (FX_WORD)renderColor.r * scale) >> 8);
+ dstColor.g = (uint8_t)(((FX_WORD)srcColor.g * n + (FX_WORD)renderColor.g * scale) >> 8);
+ dstColor.b = (uint8_t)(((FX_WORD)srcColor.b * n + (FX_WORD)renderColor.b * scale) >> 8);
return dstColor;
}
CFWL_ArrowData::CFWL_ArrowData()
@@ -713,8 +713,8 @@ CFWL_FontManager::CFWL_FontManager() }
CFWL_FontManager::~CFWL_FontManager()
{
- FX_INT32 count = m_arrFonts.GetSize();
- for (FX_INT32 i = 0; i < count; i ++) {
+ int32_t count = m_arrFonts.GetSize();
+ for (int32_t i = 0; i < count; i ++) {
CFWL_FontData *data = (CFWL_FontData*)m_arrFonts[i];
delete data;
}
@@ -722,8 +722,8 @@ CFWL_FontManager::~CFWL_FontManager() }
IFX_Font* CFWL_FontManager::FindFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage)
{
- FX_INT32 count = m_arrFonts.GetSize();
- for (FX_INT32 i = 0; i < count; i ++) {
+ int32_t count = m_arrFonts.GetSize();
+ for (int32_t i = 0; i < count; i ++) {
CFWL_FontData *data = (CFWL_FontData*)m_arrFonts[i];
if (data->Equal(wsFontFamily, dwFontStyles, wCodePage)) {
return data->GetFont();
diff --git a/xfa/src/fxbarcode/BC_BarCode.cpp b/xfa/src/fxbarcode/BC_BarCode.cpp index 063f8b5d8d..d87a0ce045 100644 --- a/xfa/src/fxbarcode/BC_BarCode.cpp +++ b/xfa/src/fxbarcode/BC_BarCode.cpp @@ -86,35 +86,35 @@ CBC_CodeBase :: CBC_CodeBase() CBC_CodeBase :: ~CBC_CodeBase()
{
}
-FX_BOOL CBC_CodeBase::SetCharEncoding(FX_INT32 encoding)
+FX_BOOL CBC_CodeBase::SetCharEncoding(int32_t encoding)
{
if (m_pBCWriter) {
return m_pBCWriter->SetCharEncoding(encoding);
}
return FALSE;
}
-FX_BOOL CBC_CodeBase::SetModuleHeight(FX_INT32 moduleHeight)
+FX_BOOL CBC_CodeBase::SetModuleHeight(int32_t moduleHeight)
{
if (m_pBCWriter) {
return m_pBCWriter->SetModuleHeight(moduleHeight);
}
return FALSE;
}
-FX_BOOL CBC_CodeBase::SetModuleWidth(FX_INT32 moduleWidth)
+FX_BOOL CBC_CodeBase::SetModuleWidth(int32_t moduleWidth)
{
if (m_pBCWriter) {
return m_pBCWriter->SetModuleWidth(moduleWidth);
}
return FALSE;
}
-FX_BOOL CBC_CodeBase::SetHeight(FX_INT32 height)
+FX_BOOL CBC_CodeBase::SetHeight(int32_t height)
{
if (m_pBCWriter) {
return m_pBCWriter->SetHeight(height);
}
return FALSE;
}
-FX_BOOL CBC_CodeBase::SetWidth(FX_INT32 width)
+FX_BOOL CBC_CodeBase::SetWidth(int32_t width)
{
if (m_pBCWriter) {
return m_pBCWriter->SetWidth(width);
@@ -160,7 +160,7 @@ void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum) ((CBC_OneDimWriter*)m_pBCWriter)->SetPrintChecksum(checksum);
}
}
-void CBC_OneCode::SetDataLength(FX_INT32 length)
+void CBC_OneCode::SetDataLength(int32_t length)
{
if (m_pBCWriter) {
((CBC_OneDimWriter*)m_pBCWriter)->SetDataLength(length);
@@ -185,7 +185,7 @@ void CBC_OneCode::SetFontSize(FX_FLOAT size) ((CBC_OneDimWriter*)m_pBCWriter)->SetFontSize(size);
}
}
-void CBC_OneCode::SetFontStyle(FX_INT32 style)
+void CBC_OneCode::SetFontStyle(int32_t style)
{
if (m_pBCWriter) {
((CBC_OneDimWriter*)m_pBCWriter)->SetFontStyle(style);
@@ -223,46 +223,46 @@ CBC_Code39::~CBC_Code39() m_pBCWriter = NULL;
}
}
-FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_CODE_39;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString filtercontents = ((CBC_OnedCode39Writer*)m_pBCWriter)->FilterContents(contents);
CFX_WideString renderContents = ((CBC_OnedCode39Writer*)m_pBCWriter)->RenderTextContents(contents);
m_renderContents = renderContents;
CFX_ByteString byteString = filtercontents.UTF8Encode();
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(renderContents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e);
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e);
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_Code39::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_Code39::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -278,7 +278,7 @@ FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location) }
return FALSE;
}
-FX_BOOL CBC_Code39::SetWideNarrowRatio(FX_INT32 ratio)
+FX_BOOL CBC_Code39::SetWideNarrowRatio(int32_t ratio)
{
if (m_pBCWriter) {
return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetWideNarrowRatio(ratio);
@@ -319,52 +319,52 @@ FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location) {
return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetTextLocation(location);
}
-FX_BOOL CBC_Codabar::SetWideNarrowRatio(FX_INT32 ratio)
+FX_BOOL CBC_Codabar::SetWideNarrowRatio(int32_t ratio)
{
if (m_pBCWriter) {
return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetWideNarrowRatio(ratio);
}
return FALSE;
}
-FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_CODABAR;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString filtercontents = ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents);
CFX_ByteString byteString = filtercontents.UTF8Encode();
m_renderContents = filtercontents;
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(filtercontents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_Codabar::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_Codabar::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -396,15 +396,15 @@ FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location) }
return FALSE;
}
-FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_CODE_128;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString content = contents;
if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer *)m_pBCWriter)->GetType() == BC_CODE128_C) {
content += '0';
@@ -412,31 +412,31 @@ FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)->FilterContents(content);
m_renderContents = encodeContents;
CFX_ByteString byteString = encodeContents.UTF8Encode();
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_Code128::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_Code128::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -464,13 +464,13 @@ CBC_EAN8::~CBC_EAN8() CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents)
{
CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);
- FX_INT32 length = encodeContents.GetLength();
+ int32_t length = encodeContents.GetLength();
if (length <= 7) {
- for (FX_INT32 i = 0; i < 7 - length; i++) {
+ for (int32_t i = 0; i < 7 - length; i++) {
encodeContents = FX_WCHAR('0') + encodeContents;
}
CFX_ByteString byteString = encodeContents.UTF8Encode();
- FX_INT32 checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byteString);
+ int32_t checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byteString);
encodeContents += FX_WCHAR(checksum - 0 + '0');
}
if (length > 8) {
@@ -478,43 +478,43 @@ CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents) }
return encodeContents;
}
-FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_EAN_8;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString encodeContents = Preprocess(contents);
CFX_ByteString byteString = encodeContents.UTF8Encode();
m_renderContents = encodeContents;
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_EAN8::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_EAN8::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -542,13 +542,13 @@ CBC_EAN13::~CBC_EAN13() CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents)
{
CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);
- FX_INT32 length = encodeContents.GetLength();
+ int32_t length = encodeContents.GetLength();
if (length <= 12) {
- for (FX_INT32 i = 0; i < 12 - length; i++) {
+ for (int32_t i = 0; i < 12 - length; i++) {
encodeContents = FX_WCHAR('0') + encodeContents;
}
CFX_ByteString byteString = encodeContents.UTF8Encode();
- FX_INT32 checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(byteString);
+ int32_t checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(byteString);
byteString += checksum - 0 + '0';
encodeContents = byteString.UTF8Decode();
}
@@ -557,43 +557,43 @@ CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents) }
return encodeContents;
}
-FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_EAN_13;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString encodeContents = Preprocess(contents);
CFX_ByteString byteString = encodeContents.UTF8Encode();
m_renderContents = encodeContents;
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_EAN13::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_EAN13::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -622,13 +622,13 @@ CBC_UPCA::~CBC_UPCA() CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents)
{
CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);
- FX_INT32 length = encodeContents.GetLength();
+ int32_t length = encodeContents.GetLength();
if (length <= 11) {
- for (FX_INT32 i = 0; i < 11 - length; i++) {
+ for (int32_t i = 0; i < 11 - length; i++) {
encodeContents = FX_WCHAR('0') + encodeContents;
}
CFX_ByteString byteString = encodeContents.UTF8Encode();
- FX_INT32 checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byteString);
+ int32_t checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byteString);
byteString += checksum - 0 + '0';
encodeContents = byteString.UTF8Decode();
}
@@ -637,44 +637,44 @@ CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents) }
return encodeContents;
}
-FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
if(contents.IsEmpty()) {
e = BCExceptionNoContents;
return FALSE;
}
BCFORMAT format = BCFORMAT_UPC_A;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
CFX_WideString encodeContents = Preprocess(contents);
CFX_ByteString byteString = encodeContents.UTF8Encode();
m_renderContents = encodeContents;
((CBC_OnedUPCAWriter*)m_pBCWriter)->Init();
- FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
+ uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_UPCA::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_UPCA::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -700,7 +700,7 @@ CBC_QRCode ::~CBC_QRCode() m_pBCWriter = NULL;
}
}
-FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version)
+FX_BOOL CBC_QRCode::SetVersion(int32_t version)
{
if (version < 0 || version > 40) {
return FALSE;
@@ -710,7 +710,7 @@ FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version) }
return((CBC_QRCodeWriter*)m_pBCWriter)->SetVersion(version);
}
-FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level)
+FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (int32_t level)
{
if (level < 0 || level > 3) {
return FALSE;
@@ -720,34 +720,34 @@ FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level) }
return ((CBC_TwoDimWriter*)m_pBCWriter)->SetErrorCorrectionLevel(level);
}
-FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
- FX_BYTE *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e);
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
+ uint8_t *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
return TRUE;
}
-FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_QRCode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_QRCode::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -772,7 +772,7 @@ CBC_PDF417I::~CBC_PDF417I() m_pBCWriter = NULL;
}
}
-FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (FX_INT32 level)
+FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (int32_t level)
{
((CBC_PDF417Writer*)m_pBCWriter)->SetErrorCorrectionLevel(level);
return TRUE;
@@ -781,35 +781,35 @@ void CBC_PDF417I::SetTruncated(FX_BOOL truncated) {
((CBC_PDF417Writer*)m_pBCWriter)->SetTruncated(truncated);
}
-FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
BCFORMAT format = BCFORMAT_PDF_417;
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
- FX_BYTE *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
+ uint8_t *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
return TRUE;
}
-FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_PDF417I::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_PDF417I::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -835,34 +835,34 @@ CBC_DataMatrix::~CBC_DataMatrix() m_pBCWriter = NULL;
}
}
-FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)
+FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
{
- FX_INT32 outWidth = 0;
- FX_INT32 outHeight = 0;
- FX_BYTE *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);
+ int32_t outWidth = 0;
+ int32_t outHeight = 0;
+ uint8_t *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)
+FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
return TRUE;
}
-FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)
+FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
{
((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
-CFX_WideString CBC_DataMatrix::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)
+CFX_WideString CBC_DataMatrix::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e)
{
CFX_WideString str;
return str;
}
-CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)
+CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
diff --git a/xfa/src/fxbarcode/BC_Binarizer.h b/xfa/src/fxbarcode/BC_Binarizer.h index 730829aba1..241bc1da03 100644 --- a/xfa/src/fxbarcode/BC_Binarizer.h +++ b/xfa/src/fxbarcode/BC_Binarizer.h @@ -16,8 +16,8 @@ public: CBC_Binarizer(CBC_LuminanceSource *source);
virtual ~CBC_Binarizer();
CBC_LuminanceSource *GetLuminanceSource();
- virtual CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e) = 0;
- virtual CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) = 0;
+ virtual CBC_CommonBitMatrix *GetBlackMatrix(int32_t &e) = 0;
+ virtual CBC_CommonBitArray *GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e) = 0;
private:
CBC_LuminanceSource *m_source;
};
diff --git a/xfa/src/fxbarcode/BC_BinaryBitmap.cpp b/xfa/src/fxbarcode/BC_BinaryBitmap.cpp index 90e1755cf4..f37b49c478 100644 --- a/xfa/src/fxbarcode/BC_BinaryBitmap.cpp +++ b/xfa/src/fxbarcode/BC_BinaryBitmap.cpp @@ -36,15 +36,15 @@ CBC_BinaryBitmap::~CBC_BinaryBitmap() }
m_matrix = NULL;
}
-FX_INT32 CBC_BinaryBitmap::GetHeight()
+int32_t CBC_BinaryBitmap::GetHeight()
{
return m_binarizer->GetLuminanceSource()->GetHeight();
}
-FX_INT32 CBC_BinaryBitmap::GetWidth()
+int32_t CBC_BinaryBitmap::GetWidth()
{
return m_binarizer->GetLuminanceSource()->GetWidth();
}
-CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(FX_INT32 &e)
+CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(int32_t &e)
{
if (m_matrix == NULL) {
m_matrix = m_binarizer->GetBlackMatrix(e);
@@ -60,13 +60,13 @@ FX_BOOL CBC_BinaryBitmap::IsRotateSupported() {
return m_binarizer->GetLuminanceSource()->IsRotateSupported();
}
-CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e)
+CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e)
{
CBC_CommonBitArray *temp = m_binarizer->GetBlackRow(y, row, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(FX_INT32 &e)
+CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(int32_t &e)
{
if (m_matrix == NULL) {
m_matrix = m_binarizer->GetBlackMatrix(e);
diff --git a/xfa/src/fxbarcode/BC_BinaryBitmap.h b/xfa/src/fxbarcode/BC_BinaryBitmap.h index e555a2b42c..439e446354 100644 --- a/xfa/src/fxbarcode/BC_BinaryBitmap.h +++ b/xfa/src/fxbarcode/BC_BinaryBitmap.h @@ -15,11 +15,11 @@ class CBC_BinaryBitmap public:
CBC_BinaryBitmap(CBC_Binarizer *binarizer);
virtual ~CBC_BinaryBitmap();
- FX_INT32 GetWidth();
- FX_INT32 GetHeight();
- CBC_CommonBitMatrix * GetMatrix(FX_INT32 &e);
- CBC_CommonBitArray * GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);
- CBC_CommonBitMatrix * GetBlackMatrix(FX_INT32 &e);
+ int32_t GetWidth();
+ int32_t GetHeight();
+ CBC_CommonBitMatrix * GetMatrix(int32_t &e);
+ CBC_CommonBitArray * GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e);
+ CBC_CommonBitMatrix * GetBlackMatrix(int32_t &e);
FX_BOOL IsCropSupported();
FX_BOOL IsRotateSupported();
private:
diff --git a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp index d385c456de..423d2c74aa 100644 --- a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp +++ b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp @@ -47,7 +47,7 @@ static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread) bitmap->Create(pImageCodec->GetWidth(), pImageCodec->GetHeight(), FXDIB_Argb);
bitmap->Clear(FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF));
CBC_Pause pause;
- FX_INT32 frames;
+ int32_t frames;
status = pImageCodec->GetFrames(frames, &pause);
while (status == FXCODEC_STATUS_FRAME_TOBECONTINUE) {
status = pImageCodec->GetFrames(frames, &pause);
@@ -105,7 +105,7 @@ CBC_BufferedImageLuminanceSource::CBC_BufferedImageLuminanceSource(const CFX_Wid m_top = 0;
m_left = 0;
}
-void CBC_BufferedImageLuminanceSource::Init(FX_INT32 &e)
+void CBC_BufferedImageLuminanceSource::Init(int32_t &e)
{
IFX_FileRead* fileread = FX_CreateFileRead(m_filename);
m_pBitmap = CreateDIBSource(fileread);
@@ -137,27 +137,27 @@ CBC_BufferedImageLuminanceSource::~CBC_BufferedImageLuminanceSource() delete m_pBitmap;
m_pBitmap = NULL;
}
-CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e)
+CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetRow(int32_t y, CFX_ByteArray &row, int32_t &e)
{
if (y < 0 || y >= m_height) {
e = BCExceptionRequestedRowIsOutSizeTheImage;
return NULL;
}
- FX_INT32 width = m_width;
+ int32_t width = m_width;
if(row.GetSize() == 0 || row.GetSize() < width) {
row.SetSize(width);
}
if(m_rgbData.GetSize() == 0 || m_rgbData.GetSize() < width) {
m_rgbData.SetSize(width);
}
- FX_INT32* rowLine = (FX_INT32*)m_pBitmap->GetScanline(y);
- FX_INT32 x;
+ int32_t* rowLine = (int32_t*)m_pBitmap->GetScanline(y);
+ int32_t x;
for (x = 0; x < width; x++) {
- FX_INT32 pixel = rowLine[x];
- FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) +
+ int32_t pixel = rowLine[x];
+ int32_t luminance = (306 * ((pixel >> 16) & 0xFF) +
601 * ((pixel >> 8) & 0xFF) +
117 * (pixel & 0xFF)) >> 10;
- row[x] = (FX_BYTE) luminance;
+ row[x] = (uint8_t) luminance;
}
return &row;
}
@@ -165,17 +165,17 @@ CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetMatrix() {
CFX_ByteArray *matirx = FX_NEW CFX_ByteArray();
matirx->SetSize(m_bytesPerLine * m_height);
- FX_INT32 *rgb = (FX_INT32*)m_pBitmap->GetBuffer();
- FX_INT32 y;
+ int32_t *rgb = (int32_t*)m_pBitmap->GetBuffer();
+ int32_t y;
for(y = 0; y < m_height; y++) {
- FX_INT32 offset = y * m_width;
- FX_INT32 x;
+ int32_t offset = y * m_width;
+ int32_t x;
for(x = 0; x < m_width; x++) {
- FX_INT32 pixel = rgb[offset + x];
- FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) +
+ int32_t pixel = rgb[offset + x];
+ int32_t luminance = (306 * ((pixel >> 16) & 0xFF) +
601 * ((pixel >> 8) & 0xFF) +
117 * (pixel & 0xFF)) >> 10;
- (*matirx)[offset + x] = (FX_BYTE) luminance;
+ (*matirx)[offset + x] = (uint8_t) luminance;
}
}
return matirx;
@@ -188,17 +188,17 @@ FX_BOOL CBC_BufferedImageLuminanceSource::IsRotateSupported() {
return TRUE;
}
-CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height)
+CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::Crop(int32_t left, int32_t top, int32_t width, int32_t height)
{
return NULL;
}
-CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::RotateCounterClockwise(FX_INT32 &e)
+CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::RotateCounterClockwise(int32_t &e)
{
if (!IsRotateSupported()) {
e = BCExceptionRotateNotSupported;
return NULL;
}
- FX_INT32 sourceWidth = m_width;
- FX_INT32 sourceHeight = m_height;
+ int32_t sourceWidth = m_width;
+ int32_t sourceHeight = m_height;
return NULL;
}
diff --git a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h index 4bff1756d5..11d51e3c1d 100644 --- a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h +++ b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h @@ -14,18 +14,18 @@ public: CBC_BufferedImageLuminanceSource(const CFX_WideString &filename);
CBC_BufferedImageLuminanceSource(CFX_DIBitmap *pBitmap);
virtual ~CBC_BufferedImageLuminanceSource();
- CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e);
- CBC_LuminanceSource *Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height);
+ CBC_LuminanceSource *RotateCounterClockwise(int32_t &e);
+ CBC_LuminanceSource *Crop(int32_t left, int32_t top, int32_t width, int32_t height);
- CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e);
+ CFX_ByteArray *GetRow(int32_t y, CFX_ByteArray &row, int32_t &e);
CFX_ByteArray *GetMatrix();
FX_BOOL IsCropSupported();
FX_BOOL IsRotateSupported();
- virtual void Init(FX_INT32 &e);
+ virtual void Init(int32_t &e);
private:
- FX_INT32 m_bytesPerLine;
- FX_INT32 m_left;
- FX_INT32 m_top;
+ int32_t m_bytesPerLine;
+ int32_t m_left;
+ int32_t m_top;
CFX_Int32Array m_rgbData;
CFX_DIBitmap *m_pBitmap;
const CFX_WideString m_filename;
diff --git a/xfa/src/fxbarcode/BC_DecoderResult.h b/xfa/src/fxbarcode/BC_DecoderResult.h index 9655d66383..1dcfb8ae5b 100644 --- a/xfa/src/fxbarcode/BC_DecoderResult.h +++ b/xfa/src/fxbarcode/BC_DecoderResult.h @@ -15,18 +15,18 @@ public: CFX_ByteArray* getRawBytes();
CFX_ByteString getText();
CFX_ByteString getECLevel();
- FX_INT32 getErrorsCorrected();
- void setErrorsCorrected(FX_INT32 errorsCorrected);
- FX_INT32 getErasures();
- void setErasures(FX_INT32 erasures);
+ int32_t getErrorsCorrected();
+ void setErrorsCorrected(int32_t errorsCorrected);
+ int32_t getErasures();
+ void setErasures(int32_t erasures);
void* getOther();
void setOther(void* other);
private:
CFX_ByteArray* m_rawBytes;
CFX_ByteString m_text;
CFX_ByteString m_ecLevel;
- FX_INT32 m_errorsCorrected;
- FX_INT32 m_erasures;
+ int32_t m_errorsCorrected;
+ int32_t m_erasures;
void* m_other;
};
#endif
diff --git a/xfa/src/fxbarcode/BC_Dimension.cpp b/xfa/src/fxbarcode/BC_Dimension.cpp index 5662c6eba7..dcd39ae3f1 100644 --- a/xfa/src/fxbarcode/BC_Dimension.cpp +++ b/xfa/src/fxbarcode/BC_Dimension.cpp @@ -26,7 +26,7 @@ CBC_Dimension::CBC_Dimension()
{
}
-CBC_Dimension::CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e)
+CBC_Dimension::CBC_Dimension(int32_t width, int32_t height, int32_t &e)
{
if (width < 0 || height < 0) {
e = BCExceptionHeightAndWidthMustBeAtLeast1;
@@ -37,15 +37,15 @@ CBC_Dimension::CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e) CBC_Dimension::~CBC_Dimension()
{
}
-FX_INT32 CBC_Dimension::getWidth()
+int32_t CBC_Dimension::getWidth()
{
return m_width;
}
-FX_INT32 CBC_Dimension::getHeight()
+int32_t CBC_Dimension::getHeight()
{
return m_height;
}
-FX_INT32 CBC_Dimension::hashCode()
+int32_t CBC_Dimension::hashCode()
{
return m_width * 32713 + m_height;
}
diff --git a/xfa/src/fxbarcode/BC_Dimension.h b/xfa/src/fxbarcode/BC_Dimension.h index 42c87a6cb3..655d5e4ad3 100644 --- a/xfa/src/fxbarcode/BC_Dimension.h +++ b/xfa/src/fxbarcode/BC_Dimension.h @@ -11,14 +11,14 @@ class CBC_Dimension {
public:
CBC_Dimension();
- CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e);
+ CBC_Dimension(int32_t width, int32_t height, int32_t &e);
virtual ~CBC_Dimension();
- FX_INT32 getWidth();
- FX_INT32 getHeight();
- FX_INT32 hashCode();
+ int32_t getWidth();
+ int32_t getHeight();
+ int32_t hashCode();
CFX_WideString toString();
private:
- FX_INT32 m_width;
- FX_INT32 m_height;
+ int32_t m_width;
+ int32_t m_height;
};
#endif
diff --git a/xfa/src/fxbarcode/BC_Library.cpp b/xfa/src/fxbarcode/BC_Library.cpp index e84eda6099..917a902456 100644 --- a/xfa/src/fxbarcode/BC_Library.cpp +++ b/xfa/src/fxbarcode/BC_Library.cpp @@ -97,7 +97,7 @@ void BC_Library_Init() CBC_SymbolInfo::Initialize();
CBC_ErrorCorrection::Initialize();
CBC_PDF417HighLevelEncoder::Initialize();
- FX_INT32 e = 0;
+ int32_t e = 0;
CBC_PDF417ECModulusGF::Initialize(e);
CBC_DecodedBitStreamPaser::Initialize();
CBC_PDF417CodewordDecoder::Initialize();
diff --git a/xfa/src/fxbarcode/BC_LuminanceSource.cpp b/xfa/src/fxbarcode/BC_LuminanceSource.cpp index e237454a83..b656389c5e 100644 --- a/xfa/src/fxbarcode/BC_LuminanceSource.cpp +++ b/xfa/src/fxbarcode/BC_LuminanceSource.cpp @@ -22,17 +22,17 @@ #include "barcode.h"
#include "BC_LuminanceSource.h"
-CBC_LuminanceSource::CBC_LuminanceSource(FX_INT32 width, FX_INT32 height): m_width(width), m_height(height)
+CBC_LuminanceSource::CBC_LuminanceSource(int32_t width, int32_t height): m_width(width), m_height(height)
{
}
CBC_LuminanceSource::~CBC_LuminanceSource()
{
}
-FX_INT32 CBC_LuminanceSource::GetWidth()
+int32_t CBC_LuminanceSource::GetWidth()
{
return m_width;
}
-FX_INT32 CBC_LuminanceSource::GetHeight()
+int32_t CBC_LuminanceSource::GetHeight()
{
return m_height;
}
diff --git a/xfa/src/fxbarcode/BC_LuminanceSource.h b/xfa/src/fxbarcode/BC_LuminanceSource.h index 013f1b84f3..168868e421 100644 --- a/xfa/src/fxbarcode/BC_LuminanceSource.h +++ b/xfa/src/fxbarcode/BC_LuminanceSource.h @@ -10,12 +10,12 @@ class CBC_LuminanceSource; class CBC_LuminanceSource
{
public:
- CBC_LuminanceSource(FX_INT32 width, FX_INT32 height);
+ CBC_LuminanceSource(int32_t width, int32_t height);
virtual ~CBC_LuminanceSource();
- FX_INT32 GetWidth();
- FX_INT32 GetHeight();
+ int32_t GetWidth();
+ int32_t GetHeight();
- virtual CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e) = 0;
+ virtual CFX_ByteArray *GetRow(int32_t y, CFX_ByteArray &row, int32_t &e) = 0;
virtual CFX_ByteArray *GetMatrix() = 0;
virtual FX_BOOL IsCropSupported()
{
@@ -26,9 +26,9 @@ public: return FALSE;
}
- virtual CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e) = 0;
+ virtual CBC_LuminanceSource *RotateCounterClockwise(int32_t &e) = 0;
protected:
- FX_INT32 m_width;
- FX_INT32 m_height;
+ int32_t m_width;
+ int32_t m_height;
};
#endif
diff --git a/xfa/src/fxbarcode/BC_Reader.h b/xfa/src/fxbarcode/BC_Reader.h index 74c12b6e2c..0db699d357 100644 --- a/xfa/src/fxbarcode/BC_Reader.h +++ b/xfa/src/fxbarcode/BC_Reader.h @@ -13,7 +13,7 @@ class CBC_Reader public:
CBC_Reader();
virtual ~CBC_Reader();
- virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e) = 0;
- virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) = 0;
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e) = 0;
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) = 0;
};
#endif
diff --git a/xfa/src/fxbarcode/BC_TwoDimWriter.cpp b/xfa/src/fxbarcode/BC_TwoDimWriter.cpp index c0456cd104..7c261aa052 100644 --- a/xfa/src/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/src/fxbarcode/BC_TwoDimWriter.cpp @@ -27,8 +27,8 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma CFX_PathData path;
path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height);
device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE);
- FX_INT32 leftPos = 0;
- FX_INT32 topPos = 0;
+ int32_t leftPos = 0;
+ int32_t topPos = 0;
if ( m_bFixedSize) {
leftPos = (m_Width - m_output->GetWidth()) / 2;
topPos = (m_Height - m_output->GetHeight()) / 2;
@@ -39,8 +39,8 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma matriScale.Concat(*matrix);
matri = matriScale;
}
- for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {
- for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {
+ for (int32_t x = 0; x < m_output->GetWidth(); x++) {
+ for (int32_t y = 0; y < m_output->GetHeight(); y++) {
CFX_PathData rect;
rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1));
CFX_GraphStateData stateData;
@@ -50,7 +50,7 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma }
}
}
-void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e)
+void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, int32_t& e)
{
if (m_bFixedSize) {
pOutBitmap = CreateDIBitmap(m_Width, m_Height);
@@ -62,14 +62,14 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e return;
}
pOutBitmap->Clear(m_backgroundColor);
- FX_INT32 leftPos = 0;
- FX_INT32 topPos = 0;
+ int32_t leftPos = 0;
+ int32_t topPos = 0;
if ( m_bFixedSize) {
leftPos = (m_Width - m_output->GetWidth()) / 2;
topPos = (m_Height - m_output->GetHeight()) / 2;
}
- for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {
- for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {
+ for (int32_t x = 0; x < m_output->GetWidth(); x++) {
+ for (int32_t y = 0; y < m_output->GetHeight(); y++) {
if (m_output->Get(x, y)) {
pOutBitmap->SetPixel(leftPos + x, topPos + y, m_barColor);
}
@@ -83,22 +83,22 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e pOutBitmap = pStretchBitmap;
}
}
-void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e)
+void CBC_TwoDimWriter::RenderResult(uint8_t *code, int32_t codeWidth, int32_t codeHeight, int32_t &e)
{
- FX_INT32 inputWidth = codeWidth;
- FX_INT32 inputHeight = codeHeight;
- FX_INT32 tempWidth = inputWidth + (1 << 1);
- FX_INT32 tempHeight = inputHeight + (1 << 1);
+ int32_t inputWidth = codeWidth;
+ int32_t inputHeight = codeHeight;
+ int32_t tempWidth = inputWidth + (1 << 1);
+ int32_t tempHeight = inputHeight + (1 << 1);
FX_FLOAT moduleHSize = (FX_FLOAT)FX_MIN(m_ModuleWidth, m_ModuleHeight);
if (moduleHSize > 8) {
moduleHSize = 8;
} else if (moduleHSize < 1) {
moduleHSize = 1;
}
- FX_INT32 outputWidth = (FX_INT32)FX_MAX(tempWidth * moduleHSize, tempWidth);
- FX_INT32 outputHeight = (FX_INT32)FX_MAX(tempHeight * moduleHSize, tempHeight);
- FX_INT32 multiX = 1;
- FX_INT32 multiY = 1;
+ int32_t outputWidth = (int32_t)FX_MAX(tempWidth * moduleHSize, tempWidth);
+ int32_t outputHeight = (int32_t)FX_MAX(tempHeight * moduleHSize, tempHeight);
+ int32_t multiX = 1;
+ int32_t multiY = 1;
if (m_bFixedSize) {
if (m_Width < outputWidth || m_Height < outputHeight) {
e = BCExceptionBitmapSizeError;
@@ -106,18 +106,18 @@ void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 }
} else {
if (m_Width > outputWidth || m_Height > outputHeight) {
- outputWidth = (FX_INT32)(outputWidth * ceil ( (FX_FLOAT)m_Width / (FX_FLOAT)outputWidth));
- outputHeight = (FX_INT32)(outputHeight * ceil ( (FX_FLOAT)m_Height / (FX_FLOAT)outputHeight));
+ outputWidth = (int32_t)(outputWidth * ceil ( (FX_FLOAT)m_Width / (FX_FLOAT)outputWidth));
+ outputHeight = (int32_t)(outputHeight * ceil ( (FX_FLOAT)m_Height / (FX_FLOAT)outputHeight));
}
}
- multiX = (FX_INT32)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth);
- multiY = (FX_INT32)ceil((FX_FLOAT)outputHeight / (FX_FLOAT) tempHeight);
+ multiX = (int32_t)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth);
+ multiY = (int32_t)ceil((FX_FLOAT)outputHeight / (FX_FLOAT) tempHeight);
if (m_bFixedSize) {
multiX = FX_MIN(multiX, multiY);
multiY = multiX;
}
- FX_INT32 leftPadding = (outputWidth - (inputWidth * multiX)) / 2;
- FX_INT32 topPadding = (outputHeight - (inputHeight * multiY)) / 2;
+ int32_t leftPadding = (outputWidth - (inputWidth * multiX)) / 2;
+ int32_t topPadding = (outputHeight - (inputHeight * multiY)) / 2;
if (leftPadding < 0) {
leftPadding = 0;
}
@@ -126,8 +126,8 @@ void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 }
m_output = FX_NEW CBC_CommonBitMatrix;
m_output->Init(outputWidth, outputHeight);
- for (FX_INT32 inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); inputY++, outputY += multiY) {
- for (FX_INT32 inputX = 0, outputX = leftPadding; (inputX < inputWidth) && (outputX < outputWidth - multiX); inputX++, outputX += multiX) {
+ for (int32_t inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); inputY++, outputY += multiY) {
+ for (int32_t inputX = 0, outputX = leftPadding; (inputX < inputWidth) && (outputX < outputWidth - multiX); inputX++, outputX += multiX) {
if (code[inputX + inputY * inputWidth] == 1) {
m_output->SetRegion(outputX, outputY, multiX, multiY, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
diff --git a/xfa/src/fxbarcode/BC_TwoDimWriter.h b/xfa/src/fxbarcode/BC_TwoDimWriter.h index 369d494c08..9ed2932c27 100644 --- a/xfa/src/fxbarcode/BC_TwoDimWriter.h +++ b/xfa/src/fxbarcode/BC_TwoDimWriter.h @@ -15,29 +15,29 @@ class CBC_TwoDimWriter : public CBC_Writer public:
CBC_TwoDimWriter();
virtual ~CBC_TwoDimWriter();
- virtual FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+ virtual uint8_t* Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
return NULL;
};
- virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+ virtual uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
return NULL;
};
- virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+ virtual uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
return NULL;
};
- virtual void RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e);
- virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e);
+ virtual void RenderResult(uint8_t *code, int32_t codeWidth, int32_t codeHeight, int32_t &e);
+ virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, int32_t& e);
virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix);
- virtual FX_BOOL SetErrorCorrectionLevel (FX_INT32 level) = 0;
- virtual FX_INT32 GetErrorCorrectionLevel()
+ virtual FX_BOOL SetErrorCorrectionLevel (int32_t level) = 0;
+ virtual int32_t GetErrorCorrectionLevel()
{
return m_iCorrectLevel;
};
protected:
- FX_INT32 m_iCorrectLevel;
+ int32_t m_iCorrectLevel;
FX_BOOL m_bFixedSize;
CBC_CommonBitMatrix* m_output;
};
diff --git a/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp b/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp index c6aa1f3eb7..440df7c889 100644 --- a/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp +++ b/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp @@ -25,20 +25,20 @@ void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString &src, CFX_ByteArra {
CFX_WideString unicode = CFX_WideString::FromLocal(src, src.GetLength());
CFX_ByteString utf8 = unicode.UTF8Encode();
- for (FX_INT32 i = 0; i < utf8.GetLength(); i ++) {
+ for (int32_t i = 0; i < utf8.GetLength(); i ++) {
dst.Add(utf8[i]);
}
}
void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ByteArray &src, CFX_ByteString &dst)
{
CFX_ByteString utf8;
- for (FX_INT32 i = 0; i < src.GetSize(); i ++) {
+ for (int32_t i = 0; i < src.GetSize(); i ++) {
utf8 += src[i];
}
CFX_WideString unicode = CFX_WideString::FromUTF8(utf8, utf8.GetLength());
dst.ConvertFrom(unicode);
}
-void CBC_UtilCodingConvert::Utf8ToLocale(const FX_BYTE *src, FX_INT32 count, CFX_ByteString &dst)
+void CBC_UtilCodingConvert::Utf8ToLocale(const uint8_t *src, int32_t count, CFX_ByteString &dst)
{
CFX_WideString unicode = CFX_WideString::FromUTF8((const char*)src, count);
dst.ConvertFrom(unicode);
diff --git a/xfa/src/fxbarcode/BC_UtilCodingConvert.h b/xfa/src/fxbarcode/BC_UtilCodingConvert.h index c5dc5a415e..175d32e4f6 100644 --- a/xfa/src/fxbarcode/BC_UtilCodingConvert.h +++ b/xfa/src/fxbarcode/BC_UtilCodingConvert.h @@ -16,7 +16,7 @@ public: static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteString &result);
static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteArray &result);
static void Utf8ToLocale(const CFX_ByteArray &source, CFX_ByteString &result);
- static void Utf8ToLocale(const FX_BYTE *source, FX_INT32 count, CFX_ByteString &result);
+ static void Utf8ToLocale(const uint8_t *source, int32_t count, CFX_ByteString &result);
static void UnicodeToUTF8(const CFX_WideString &source, CFX_ByteString &result);
};
#endif
diff --git a/xfa/src/fxbarcode/BC_UtilRSS.cpp b/xfa/src/fxbarcode/BC_UtilRSS.cpp index c65df34e13..8ebfb6d6f1 100644 --- a/xfa/src/fxbarcode/BC_UtilRSS.cpp +++ b/xfa/src/fxbarcode/BC_UtilRSS.cpp @@ -28,17 +28,17 @@ CBC_UtilRSS::CBC_UtilRSS() CBC_UtilRSS::~CBC_UtilRSS()
{
}
-CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow)
+CFX_Int32Array *CBC_UtilRSS::GetRssWidths(int32_t val, int32_t n, int32_t elements, int32_t maxWidth, FX_BOOL noNarrow)
{
CFX_Int32Array *iTemp = FX_NEW CFX_Int32Array;
iTemp->SetSize(elements);
CBC_AutoPtr<CFX_Int32Array > widths(iTemp);
- FX_INT32 bar;
- FX_INT32 narrowMask = 0;
+ int32_t bar;
+ int32_t narrowMask = 0;
for (bar = 0; bar < elements - 1; bar++) {
narrowMask |= (1 << bar);
- FX_INT32 elmWidth = 1;
- FX_INT32 subVal;
+ int32_t elmWidth = 1;
+ int32_t subVal;
while (TRUE) {
subVal = Combins(n - elmWidth - 1, elements - bar - 2);
if (noNarrow && (narrowMask == 0) &&
@@ -46,8 +46,8 @@ CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 ele subVal -= Combins(n - elmWidth - (elements - bar), elements - bar - 2);
}
if (elements - bar - 1 > 1) {
- FX_INT32 lessVal = 0;
- for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2);
+ int32_t lessVal = 0;
+ for (int32_t mxwElement = n - elmWidth - (elements - bar - 2);
mxwElement > maxWidth;
mxwElement--) {
lessVal += Combins(n - elmWidth - mxwElement - 1, elements - bar - 3);
@@ -70,29 +70,29 @@ CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 ele (*widths)[bar] = n;
return widths.release();
}
-FX_INT32 CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow)
+int32_t CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, int32_t maxWidth, FX_BOOL noNarrow)
{
- FX_INT32 elements = widths.GetSize();
- FX_INT32 n = 0;
- for (FX_INT32 i = 0; i < elements; i++) {
+ int32_t elements = widths.GetSize();
+ int32_t n = 0;
+ for (int32_t i = 0; i < elements; i++) {
n += widths[i];
}
- FX_INT32 val = 0;
- FX_INT32 narrowMask = 0;
- for (FX_INT32 bar = 0; bar < elements - 1; bar++) {
- FX_INT32 elmWidth;
+ int32_t val = 0;
+ int32_t narrowMask = 0;
+ for (int32_t bar = 0; bar < elements - 1; bar++) {
+ int32_t elmWidth;
for (elmWidth = 1, narrowMask |= (1 << bar);
elmWidth < widths[bar];
elmWidth++, narrowMask &= ~(1 << bar)) {
- FX_INT32 subVal = Combins(n - elmWidth - 1, elements - bar - 2);
+ int32_t subVal = Combins(n - elmWidth - 1, elements - bar - 2);
if (noNarrow && (narrowMask == 0) &&
(n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) {
subVal -= Combins(n - elmWidth - (elements - bar),
elements - bar - 2);
}
if (elements - bar - 1 > 1) {
- FX_INT32 lessVal = 0;
- for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2);
+ int32_t lessVal = 0;
+ for (int32_t mxwElement = n - elmWidth - (elements - bar - 2);
mxwElement > maxWidth; mxwElement--) {
lessVal += Combins(n - elmWidth - mxwElement - 1,
elements - bar - 3);
@@ -107,10 +107,10 @@ FX_INT32 CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_ }
return val;
}
-FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r)
+int32_t CBC_UtilRSS::Combins(int32_t n, int32_t r)
{
- FX_INT32 maxDenom;
- FX_INT32 minDenom;
+ int32_t maxDenom;
+ int32_t minDenom;
if (n - r > r) {
minDenom = r;
maxDenom = n - r;
@@ -118,9 +118,9 @@ FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r) minDenom = n - r;
maxDenom = r;
}
- FX_INT32 val = 1;
- FX_INT32 j = 1;
- for (FX_INT32 i = n; i > maxDenom; i--) {
+ int32_t val = 1;
+ int32_t j = 1;
+ for (int32_t i = n; i > maxDenom; i--) {
val *= i;
if (j <= minDenom) {
val /= j;
@@ -133,15 +133,15 @@ FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r) }
return val;
}
-CFX_Int32Array *CBC_UtilRSS::Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K)
+CFX_Int32Array *CBC_UtilRSS::Elements(CFX_Int32Array &eDist, int32_t N, int32_t K)
{
CFX_Int32Array *widths = FX_NEW CFX_Int32Array;
widths->SetSize(eDist.GetSize() + 2);
- FX_INT32 twoK = K << 1;
+ int32_t twoK = K << 1;
(*widths)[0] = 1;
- FX_INT32 i;
- FX_INT32 minEven = 10;
- FX_INT32 barSum = 1;
+ int32_t i;
+ int32_t minEven = 10;
+ int32_t barSum = 1;
for (i = 1; i < twoK - 2; i += 2) {
(*widths)[i] = eDist[i - 1] - (*widths)[i - 1];
(*widths)[i + 1] = eDist[i] - (*widths)[i];
diff --git a/xfa/src/fxbarcode/BC_UtilRSS.h b/xfa/src/fxbarcode/BC_UtilRSS.h index 076e2f263d..3c63a51579 100644 --- a/xfa/src/fxbarcode/BC_UtilRSS.h +++ b/xfa/src/fxbarcode/BC_UtilRSS.h @@ -11,12 +11,12 @@ class CBC_UtilRSS {
public:
virtual ~CBC_UtilRSS();
- static FX_INT32 GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow);
+ static int32_t GetRSSvalue(CFX_Int32Array &widths, int32_t maxWidth, FX_BOOL noNarrow);
protected:
- static CFX_Int32Array *GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow);
- static FX_INT32 Combins(FX_INT32 n, FX_INT32 r);
- static CFX_Int32Array *Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K);
+ static CFX_Int32Array *GetRssWidths(int32_t val, int32_t n, int32_t elements, int32_t maxWidth, FX_BOOL noNarrow);
+ static int32_t Combins(int32_t n, int32_t r);
+ static CFX_Int32Array *Elements(CFX_Int32Array &eDist, int32_t N, int32_t K);
private:
CBC_UtilRSS();
};
diff --git a/xfa/src/fxbarcode/BC_Utils.cpp b/xfa/src/fxbarcode/BC_Utils.cpp index 3a04ebda2b..8ddbb51d49 100644 --- a/xfa/src/fxbarcode/BC_Utils.cpp +++ b/xfa/src/fxbarcode/BC_Utils.cpp @@ -5,36 +5,36 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "barcode.h"
-FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c)
+FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, int32_t count, FX_CHAR c)
{
if (first > last || count <= 0) {
return FALSE;
}
dst.Delete(first, last - first);
- for (FX_INT32 i = 0; i < count; i ++) {
+ for (int32_t i = 0; i < count; i ++) {
dst.Insert(0, c);
}
return TRUE;
}
-void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c)
+void BC_FX_ByteString_Append(CFX_ByteString &dst, int32_t count, FX_CHAR c)
{
- for (FX_INT32 i = 0; i < count; i ++) {
+ for (int32_t i = 0; i < count; i ++) {
dst += c;
}
}
void BC_FX_ByteString_Append(CFX_ByteString &dst, const CFX_ByteArray &ba)
{
- for (FX_INT32 i = 0; i < ba.GetSize(); i ++) {
+ for (int32_t i = 0; i < ba.GetSize(); i ++) {
dst += ba[i];
}
}
void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun)
{
- FX_INT32 nLength = src.GetSize();
+ int32_t nLength = src.GetSize();
FX_BOOL changed = true;
do {
changed = false;
- for (FX_INT32 i = 0; i < nLength - 1; i++) {
+ for (int32_t i = 0; i < nLength - 1; i++) {
if ( fun(src[i + 1], src[i]) ) {
void *temp = src[i];
src.SetAt(i, src[i + 1]);
diff --git a/xfa/src/fxbarcode/BC_Writer.cpp b/xfa/src/fxbarcode/BC_Writer.cpp index 69276dd1f4..07dabb31ed 100644 --- a/xfa/src/fxbarcode/BC_Writer.cpp +++ b/xfa/src/fxbarcode/BC_Writer.cpp @@ -20,12 +20,12 @@ CBC_Writer::CBC_Writer() CBC_Writer::~CBC_Writer()
{
}
-FX_BOOL CBC_Writer::SetCharEncoding(FX_INT32 encoding)
+FX_BOOL CBC_Writer::SetCharEncoding(int32_t encoding)
{
m_CharEncoding = encoding;
return TRUE;
}
-FX_BOOL CBC_Writer::SetModuleHeight(FX_INT32 moduleHeight)
+FX_BOOL CBC_Writer::SetModuleHeight(int32_t moduleHeight)
{
if (moduleHeight > 10 || moduleHeight < 1) {
return FALSE;
@@ -33,7 +33,7 @@ FX_BOOL CBC_Writer::SetModuleHeight(FX_INT32 moduleHeight) m_ModuleHeight = moduleHeight;
return TRUE;
}
-FX_BOOL CBC_Writer::SetModuleWidth(FX_INT32 moduleWidth)
+FX_BOOL CBC_Writer::SetModuleWidth(int32_t moduleWidth)
{
if ( moduleWidth > 10 || moduleWidth < 1) {
return FALSE;
@@ -41,12 +41,12 @@ FX_BOOL CBC_Writer::SetModuleWidth(FX_INT32 moduleWidth) m_ModuleWidth = moduleWidth;
return TRUE;
}
-FX_BOOL CBC_Writer::SetHeight(FX_INT32 height)
+FX_BOOL CBC_Writer::SetHeight(int32_t height)
{
m_Height = height;
return TRUE;
}
-FX_BOOL CBC_Writer::SetWidth(FX_INT32 width)
+FX_BOOL CBC_Writer::SetWidth(int32_t width)
{
m_Width = width;
return TRUE;
@@ -59,7 +59,7 @@ void CBC_Writer::SetBarcodeColor(FX_ARGB foregroundColor) {
m_barColor = foregroundColor;
}
-CFX_DIBitmap* CBC_Writer::CreateDIBitmap(FX_INT32 width, FX_INT32 height)
+CFX_DIBitmap* CBC_Writer::CreateDIBitmap(int32_t width, int32_t height)
{
CFX_DIBitmap *pDIBitmap = NULL;
pDIBitmap = FX_NEW CFX_DIBitmap;
diff --git a/xfa/src/fxbarcode/BC_Writer.h b/xfa/src/fxbarcode/BC_Writer.h index d92dc9b2ea..3d226255c6 100644 --- a/xfa/src/fxbarcode/BC_Writer.h +++ b/xfa/src/fxbarcode/BC_Writer.h @@ -12,22 +12,22 @@ class CBC_Writer public:
CBC_Writer();
virtual ~CBC_Writer();
- virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) = 0;
- virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) = 0;
- virtual FX_BOOL SetCharEncoding(FX_INT32 encoding);
- virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight);
- virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth);
- virtual FX_BOOL SetHeight(FX_INT32 height);
- virtual FX_BOOL SetWidth(FX_INT32 width);
+ virtual uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) = 0;
+ virtual uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) = 0;
+ virtual FX_BOOL SetCharEncoding(int32_t encoding);
+ virtual FX_BOOL SetModuleHeight(int32_t moduleHeight);
+ virtual FX_BOOL SetModuleWidth(int32_t moduleWidth);
+ virtual FX_BOOL SetHeight(int32_t height);
+ virtual FX_BOOL SetWidth(int32_t width);
virtual void SetBackgroundColor(FX_ARGB backgroundColor);
virtual void SetBarcodeColor(FX_ARGB foregroundColor);
protected:
- CFX_DIBitmap* CreateDIBitmap(FX_INT32 width, FX_INT32 height);
- FX_INT32 m_CharEncoding;
- FX_INT32 m_ModuleHeight;
- FX_INT32 m_ModuleWidth;
- FX_INT32 m_Height;
- FX_INT32 m_Width;
+ CFX_DIBitmap* CreateDIBitmap(int32_t width, int32_t height);
+ int32_t m_CharEncoding;
+ int32_t m_ModuleHeight;
+ int32_t m_ModuleWidth;
+ int32_t m_Height;
+ int32_t m_Width;
FXDIB_Format m_colorSpace;
FX_ARGB m_barColor;
FX_ARGB m_backgroundColor;
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp index 6263affbe8..a73fd37148 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp @@ -32,7 +32,7 @@ CBC_CommonBitArray::CBC_CommonBitArray() m_bits.SetSize(1);
m_size = 0;
}
-CBC_CommonBitArray::CBC_CommonBitArray(FX_INT32 size)
+CBC_CommonBitArray::CBC_CommonBitArray(int32_t size)
{
m_bits.SetSize((size + 31) >> 5);
m_size = size;
@@ -41,7 +41,7 @@ CBC_CommonBitArray::~CBC_CommonBitArray() {
m_size = 0;
}
-FX_INT32 CBC_CommonBitArray::GetSize()
+int32_t CBC_CommonBitArray::GetSize()
{
return m_size;
}
@@ -49,31 +49,31 @@ CFX_Int32Array& CBC_CommonBitArray::GetBits() {
return m_bits;
}
-FX_INT32 CBC_CommonBitArray::GetSizeInBytes()
+int32_t CBC_CommonBitArray::GetSizeInBytes()
{
return (m_size + 7) >> 3;
}
-FX_BOOL CBC_CommonBitArray::Get(FX_INT32 i)
+FX_BOOL CBC_CommonBitArray::Get(int32_t i)
{
return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0;
}
-void CBC_CommonBitArray::Set(FX_INT32 i)
+void CBC_CommonBitArray::Set(int32_t i)
{
m_bits[i >> 5] |= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::Flip(FX_INT32 i)
+void CBC_CommonBitArray::Flip(int32_t i)
{
m_bits[i >> 5] ^= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::SetBulk(FX_INT32 i, FX_INT32 newBits)
+void CBC_CommonBitArray::SetBulk(int32_t i, int32_t newBits)
{
m_bits[i >> 5] = newBits;
}
void CBC_CommonBitArray::Clear()
{
- FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(int32_t));
}
-FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e)
+FX_BOOL CBC_CommonBitArray::IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e)
{
if (end < start) {
e = BCExceptionEndLessThanStart;
@@ -83,18 +83,18 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, return TRUE;
}
end--;
- FX_INT32 firstInt = start >> 5;
- FX_INT32 lastInt = end >> 5;
- FX_INT32 i;
+ int32_t firstInt = start >> 5;
+ int32_t lastInt = end >> 5;
+ int32_t i;
for (i = firstInt; i <= lastInt; i++) {
- FX_INT32 firstBit = i > firstInt ? 0 : start & 0x1F;
- FX_INT32 lastBit = i < lastInt ? 31 : end & 0x1F;
- FX_INT32 mask;
+ int32_t firstBit = i > firstInt ? 0 : start & 0x1F;
+ int32_t lastBit = i < lastInt ? 31 : end & 0x1F;
+ int32_t mask;
if (firstBit == 0 && lastBit == 31) {
mask = -1;
} else {
mask = 0;
- for (FX_INT32 j = firstBit; j <= lastBit; j++) {
+ for (int32_t j = firstBit; j <= lastBit; j++) {
mask |= 1 << j;
}
}
@@ -104,21 +104,21 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, }
return TRUE;
}
-FX_INT32* CBC_CommonBitArray::GetBitArray()
+int32_t* CBC_CommonBitArray::GetBitArray()
{
return &m_bits[0];
}
void CBC_CommonBitArray::Reverse()
{
- FX_INT32* newBits = FX_Alloc(FX_INT32, m_bits.GetSize());
- FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(FX_INT32));
- FX_INT32 size = m_size;
- FX_INT32 i;
+ int32_t* newBits = FX_Alloc(int32_t, m_bits.GetSize());
+ FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(int32_t));
+ int32_t size = m_size;
+ int32_t i;
for (i = 0; i < size; i++) {
if (Get(size - i - 1)) {
newBits[i >> 5] |= 1 << (i & 0x1F);
}
}
- FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(int32_t));
FX_Free(newBits);
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.h b/xfa/src/fxbarcode/common/BC_CommonBitArray.h index d1c8f6d528..32b94f4912 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitArray.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.h @@ -10,22 +10,22 @@ class CBC_CommonBitArray {
public:
CBC_CommonBitArray(CBC_CommonBitArray* array);
- CBC_CommonBitArray(FX_INT32 size);
+ CBC_CommonBitArray(int32_t size);
CBC_CommonBitArray();
virtual ~CBC_CommonBitArray();
- FX_INT32 GetSize();
+ int32_t GetSize();
CFX_Int32Array& GetBits();
- FX_INT32 GetSizeInBytes();
- FX_BOOL Get(FX_INT32 i);
- void Set(FX_INT32 i);
- void Flip(FX_INT32 i);
- void SetBulk(FX_INT32 i, FX_INT32 newBits);
- FX_BOOL IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e);
- FX_INT32 *GetBitArray();
+ int32_t GetSizeInBytes();
+ FX_BOOL Get(int32_t i);
+ void Set(int32_t i);
+ void Flip(int32_t i);
+ void SetBulk(int32_t i, int32_t newBits);
+ FX_BOOL IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e);
+ int32_t *GetBitArray();
void Reverse();
void Clear();
private:
- FX_INT32 m_size;
+ int32_t m_size;
CFX_Int32Array m_bits;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp index df24d1dabb..135dd2ff28 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp @@ -30,23 +30,23 @@ CBC_CommonBitMatrix::CBC_CommonBitMatrix() m_rowSize = 0;
m_bits = NULL;
}
-void CBC_CommonBitMatrix::Init(FX_INT32 dimension)
+void CBC_CommonBitMatrix::Init(int32_t dimension)
{
m_width = dimension;
m_height = dimension;
- FX_INT32 rowSize = (m_height + 31) >> 5;
+ int32_t rowSize = (m_height + 31) >> 5;
m_rowSize = rowSize;
- m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ m_bits = FX_Alloc(int32_t, m_rowSize * m_height);
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
-void CBC_CommonBitMatrix::Init(FX_INT32 width, FX_INT32 height)
+void CBC_CommonBitMatrix::Init(int32_t width, int32_t height)
{
m_width = width;
m_height = height;
- FX_INT32 rowSize = (width + 31) >> 5;
+ int32_t rowSize = (width + 31) >> 5;
m_rowSize = rowSize;
- m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ m_bits = FX_Alloc(int32_t, m_rowSize * m_height);
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
CBC_CommonBitMatrix::~CBC_CommonBitMatrix()
{
@@ -56,36 +56,36 @@ CBC_CommonBitMatrix::~CBC_CommonBitMatrix() m_bits = NULL;
m_height = m_width = m_rowSize = 0;
}
-FX_BOOL CBC_CommonBitMatrix::Get(FX_INT32 x, FX_INT32 y)
+FX_BOOL CBC_CommonBitMatrix::Get(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0) {
return false;
}
return ((((FX_DWORD)m_bits[offset]) >> (x & 0x1f)) & 1) != 0;
}
-FX_INT32* CBC_CommonBitMatrix::GetBits()
+int32_t* CBC_CommonBitMatrix::GetBits()
{
return m_bits;
}
-void CBC_CommonBitMatrix::Set(FX_INT32 x, FX_INT32 y)
+void CBC_CommonBitMatrix::Set(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0) {
return;
}
m_bits[offset] |= 1 << (x & 0x1f);
}
-void CBC_CommonBitMatrix::Flip(FX_INT32 x, FX_INT32 y)
+void CBC_CommonBitMatrix::Flip(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
m_bits[offset] ^= 1 << (x & 0x1f);
}
void CBC_CommonBitMatrix::Clear()
{
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
-void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e)
+void CBC_CommonBitMatrix::SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e)
{
if (top < 0 || left < 0) {
e = BCExceptionLeftAndTopMustBeNonnegative;
@@ -95,22 +95,22 @@ void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, e = BCExceptionHeightAndWidthMustBeAtLeast1;
return;
}
- FX_INT32 right = left + width;
- FX_INT32 bottom = top + height;
+ int32_t right = left + width;
+ int32_t bottom = top + height;
if (m_height < bottom || m_width < right) {
e = BCExceptionRegionMustFitInsideMatrix;
return;
}
- FX_INT32 y;
+ int32_t y;
for (y = top; y < bottom; y++) {
- FX_INT32 offset = y * m_rowSize;
- FX_INT32 x;
+ int32_t offset = y * m_rowSize;
+ int32_t x;
for (x = left; x < right; x++) {
m_bits[offset + (x >> 5)] |= 1 << (x & 0x1f);
}
}
}
-CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* row)
+CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(int32_t y, CBC_CommonBitArray* row)
{
CBC_CommonBitArray* rowArray = NULL;
if (row == NULL || row->GetSize() < m_width) {
@@ -118,40 +118,40 @@ CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* } else {
rowArray = FX_NEW CBC_CommonBitArray(row);
}
- FX_INT32 offset = y * m_rowSize;
- FX_INT32 x;
+ int32_t offset = y * m_rowSize;
+ int32_t x;
for (x = 0; x < m_rowSize; x++) {
rowArray->SetBulk(x << 5, m_bits[offset + x]);
}
return rowArray;
}
-void CBC_CommonBitMatrix::SetRow(FX_INT32 y, CBC_CommonBitArray* row)
+void CBC_CommonBitMatrix::SetRow(int32_t y, CBC_CommonBitArray* row)
{
- FX_INT32 l = y * m_rowSize;
- for (FX_INT32 i = 0; i < m_rowSize; i++) {
+ int32_t l = y * m_rowSize;
+ for (int32_t i = 0; i < m_rowSize; i++) {
m_bits[l] = row->GetBitArray()[i];
l++;
}
}
-void CBC_CommonBitMatrix::SetCol(FX_INT32 y, CBC_CommonBitArray* col)
+void CBC_CommonBitMatrix::SetCol(int32_t y, CBC_CommonBitArray* col)
{
- for (FX_INT32 i = 0; i < col->GetBits().GetSize(); i++) {
+ for (int32_t i = 0; i < col->GetBits().GetSize(); i++) {
m_bits[i * m_rowSize + y] = col->GetBitArray()[i];
}
}
-FX_INT32 CBC_CommonBitMatrix::GetWidth()
+int32_t CBC_CommonBitMatrix::GetWidth()
{
return m_width;
}
-FX_INT32 CBC_CommonBitMatrix::GetHeight()
+int32_t CBC_CommonBitMatrix::GetHeight()
{
return m_height;
}
-FX_INT32 CBC_CommonBitMatrix::GetRowSize()
+int32_t CBC_CommonBitMatrix::GetRowSize()
{
return m_rowSize;
}
-FX_INT32 CBC_CommonBitMatrix::GetDimension(FX_INT32 &e)
+int32_t CBC_CommonBitMatrix::GetDimension(int32_t &e)
{
if (m_width != m_height) {
e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix;
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h index 8641ef1f63..4c129fdb82 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h @@ -12,26 +12,26 @@ class CBC_CommonBitMatrix public:
CBC_CommonBitMatrix();
virtual ~CBC_CommonBitMatrix();
- FX_BOOL Get(FX_INT32 x, FX_INT32 y);
- void Set(FX_INT32 x, FX_INT32 y);
- void Flip(FX_INT32 x, FX_INT32 y);
+ FX_BOOL Get(int32_t x, int32_t y);
+ void Set(int32_t x, int32_t y);
+ void Flip(int32_t x, int32_t y);
void Clear();
- void SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e);
- CBC_CommonBitArray* GetRow(FX_INT32 y, CBC_CommonBitArray* row);
- void SetRow(FX_INT32 y, CBC_CommonBitArray* row);
- CBC_CommonBitArray* GetCol(FX_INT32 y, CBC_CommonBitArray* row);
- void SetCol(FX_INT32 y, CBC_CommonBitArray* col);
- FX_INT32 GetWidth();
- FX_INT32 GetHeight();
- FX_INT32 GetRowSize();
- FX_INT32 GetDimension(FX_INT32 &e);
- virtual void Init(FX_INT32 dimension);
- virtual void Init(FX_INT32 width, FX_INT32 height);
- FX_INT32* GetBits();
+ void SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e);
+ CBC_CommonBitArray* GetRow(int32_t y, CBC_CommonBitArray* row);
+ void SetRow(int32_t y, CBC_CommonBitArray* row);
+ CBC_CommonBitArray* GetCol(int32_t y, CBC_CommonBitArray* row);
+ void SetCol(int32_t y, CBC_CommonBitArray* col);
+ int32_t GetWidth();
+ int32_t GetHeight();
+ int32_t GetRowSize();
+ int32_t GetDimension(int32_t &e);
+ virtual void Init(int32_t dimension);
+ virtual void Init(int32_t width, int32_t height);
+ int32_t* GetBits();
private:
- FX_INT32 m_width;
- FX_INT32 m_height;
- FX_INT32 m_rowSize;
- FX_INT32* m_bits;
+ int32_t m_width;
+ int32_t m_height;
+ int32_t m_rowSize;
+ int32_t* m_bits;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp index b71848a60c..f32d634a5a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp @@ -31,18 +31,18 @@ CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes) CBC_CommonBitSource::~CBC_CommonBitSource()
{
}
-FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)
+int32_t CBC_CommonBitSource::ReadBits(int32_t numBits, int32_t &e)
{
if (numBits < 1 || numBits > 32) {
e = BCExceptionIllegalArgument;
return 0;
}
- FX_INT32 result = 0;
+ int32_t result = 0;
if (m_bitOffset > 0) {
- FX_INT32 bitsLeft = 8 - m_bitOffset;
- FX_INT32 toRead = numBits < bitsLeft ? numBits : bitsLeft;
- FX_INT32 bitsToNotRead = bitsLeft - toRead;
- FX_INT32 mask = (0xff >> (8 - toRead)) << bitsToNotRead;
+ int32_t bitsLeft = 8 - m_bitOffset;
+ int32_t toRead = numBits < bitsLeft ? numBits : bitsLeft;
+ int32_t bitsToNotRead = bitsLeft - toRead;
+ int32_t mask = (0xff >> (8 - toRead)) << bitsToNotRead;
result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead;
numBits -= toRead;
m_bitOffset += toRead;
@@ -58,19 +58,19 @@ FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e) numBits -= 8;
}
if (numBits > 0) {
- FX_INT32 bitsToNotRead = 8 - numBits;
- FX_INT32 mask = (0xff >> bitsToNotRead) << bitsToNotRead;
+ int32_t bitsToNotRead = 8 - numBits;
+ int32_t mask = (0xff >> bitsToNotRead) << bitsToNotRead;
result = (result << numBits) | ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead);
m_bitOffset += numBits;
}
}
return result;
}
-FX_INT32 CBC_CommonBitSource::Available()
+int32_t CBC_CommonBitSource::Available()
{
return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset;
}
-FX_INT32 CBC_CommonBitSource::getByteOffset()
+int32_t CBC_CommonBitSource::getByteOffset()
{
return m_byteOffset;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.h b/xfa/src/fxbarcode/common/BC_CommonBitSource.h index f6a5985ae2..278b4b6a1c 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitSource.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.h @@ -11,12 +11,12 @@ class CBC_CommonBitSource public:
CBC_CommonBitSource(CFX_ByteArray *bytes);
virtual ~CBC_CommonBitSource();
- FX_INT32 ReadBits(FX_INT32 numBits, FX_INT32 &e);
- FX_INT32 Available();
- FX_INT32 getByteOffset();
+ int32_t ReadBits(int32_t numBits, int32_t &e);
+ int32_t Available();
+ int32_t getByteOffset();
private:
CFX_ByteArray m_bytes;
- FX_INT32 m_byteOffset;
- FX_INT32 m_bitOffset;
+ int32_t m_byteOffset;
+ int32_t m_bitOffset;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp index 99e97d38d8..4b9667e406 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp @@ -28,17 +28,17 @@ CBC_CommonByteArray::CBC_CommonByteArray() m_size = 0;
m_index = 0;
}
-CBC_CommonByteArray::CBC_CommonByteArray(FX_INT32 size)
+CBC_CommonByteArray::CBC_CommonByteArray(int32_t size)
{
m_size = size;
- m_bytes = FX_Alloc(FX_BYTE, size);
+ m_bytes = FX_Alloc(uint8_t, size);
FXSYS_memset32(m_bytes, 0, size);
m_index = 0;
}
-CBC_CommonByteArray::CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size)
+CBC_CommonByteArray::CBC_CommonByteArray(uint8_t* byteArray, int32_t size)
{
m_size = size;
- m_bytes = FX_Alloc(FX_BYTE, size);
+ m_bytes = FX_Alloc(uint8_t, size);
FXSYS_memcpy32(m_bytes, byteArray, size);
m_index = size;
}
@@ -51,15 +51,15 @@ CBC_CommonByteArray::~CBC_CommonByteArray() m_index = 0;
m_size = 0;
}
-FX_INT32 CBC_CommonByteArray::At(FX_INT32 index)
+int32_t CBC_CommonByteArray::At(int32_t index)
{
return m_bytes[index] & 0xff;
}
-void CBC_CommonByteArray::Set(FX_INT32 index, FX_INT32 value)
+void CBC_CommonByteArray::Set(int32_t index, int32_t value)
{
- m_bytes[index] = (FX_BYTE) value;
+ m_bytes[index] = (uint8_t) value;
}
-FX_INT32 CBC_CommonByteArray::Size()
+int32_t CBC_CommonByteArray::Size()
{
return m_size;
}
@@ -67,19 +67,19 @@ FX_BOOL CBC_CommonByteArray::IsEmpty() {
return m_size == 0;
}
-void CBC_CommonByteArray::AppendByte(FX_INT32 value)
+void CBC_CommonByteArray::AppendByte(int32_t value)
{
if (m_size == 0 || m_index >= m_size) {
- FX_INT32 newSize = FX_MAX(32, m_size << 1);
+ int32_t newSize = FX_MAX(32, m_size << 1);
Reserve(newSize);
}
- m_bytes[m_index] = (FX_BYTE)value;
+ m_bytes[m_index] = (uint8_t)value;
m_index++;
}
-void CBC_CommonByteArray::Reserve(FX_INT32 capacity)
+void CBC_CommonByteArray::Reserve(int32_t capacity)
{
if (m_bytes == NULL || m_size < capacity) {
- FX_BYTE *newArray = FX_Alloc(FX_BYTE, capacity);
+ uint8_t *newArray = FX_Alloc(uint8_t, capacity);
FXSYS_memset32(newArray, 0, capacity);
if (m_bytes != NULL) {
FXSYS_memcpy32(newArray, m_bytes, m_size);
@@ -89,24 +89,24 @@ void CBC_CommonByteArray::Reserve(FX_INT32 capacity) m_size = capacity;
}
}
-void CBC_CommonByteArray::Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count)
+void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count)
{
if (m_bytes != NULL) {
FX_Free( m_bytes );
}
- m_bytes = FX_Alloc(FX_BYTE, count);
+ m_bytes = FX_Alloc(uint8_t, count);
m_size = count;
FXSYS_memcpy32(m_bytes, source + offset, count);
m_index = count;
}
-void CBC_CommonByteArray::Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count)
+void CBC_CommonByteArray::Set(CFX_ByteArray* source, int32_t offset, int32_t count)
{
if (m_bytes != NULL) {
FX_Free( m_bytes );
}
- m_bytes = FX_Alloc(FX_BYTE, count);
+ m_bytes = FX_Alloc(uint8_t, count);
m_size = count;
- FX_INT32 i;
+ int32_t i;
for(i = 0; i < count; i++) {
m_bytes[i] = source->operator [](i + offset);
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.h b/xfa/src/fxbarcode/common/BC_CommonByteArray.h index b9baf8a964..234b25db69 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteArray.h +++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.h @@ -9,21 +9,21 @@ class CBC_CommonByteArray
{
private:
- FX_INT32 m_size;
- FX_INT32 m_index;
- FX_BYTE* m_bytes;
+ int32_t m_size;
+ int32_t m_index;
+ uint8_t* m_bytes;
public:
CBC_CommonByteArray();
- CBC_CommonByteArray(FX_INT32 size);
- CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size);
+ CBC_CommonByteArray(int32_t size);
+ CBC_CommonByteArray(uint8_t* byteArray, int32_t size);
virtual ~CBC_CommonByteArray();
- FX_INT32 At(FX_INT32 index);
- void Set(FX_INT32 index, FX_INT32 value);
- FX_INT32 Size();
+ int32_t At(int32_t index);
+ void Set(int32_t index, int32_t value);
+ int32_t Size();
FX_BOOL IsEmpty();
- void AppendByte(FX_INT32 value);
- void Reserve(FX_INT32 capacity);
- void Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count);
- void Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count);
+ void AppendByte(int32_t value);
+ void Reserve(int32_t capacity);
+ void Set(uint8_t* source, int32_t offset, int32_t count);
+ void Set(CFX_ByteArray* source, int32_t offset, int32_t count);
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp index 27c8615bf9..da4741d11a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp @@ -22,7 +22,7 @@ #include "../barcode.h"
#include "BC_CommonByteMatrix.h"
-CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height)
+CBC_CommonByteMatrix::CBC_CommonByteMatrix(int32_t width, int32_t height)
{
m_height = height;
m_width = width;
@@ -30,7 +30,7 @@ CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height) }
void CBC_CommonByteMatrix::Init()
{
- m_bytes = FX_Alloc(FX_BYTE, m_height * m_width);
+ m_bytes = FX_Alloc(uint8_t, m_height * m_width);
FXSYS_memset8(m_bytes, 0xff, m_height * m_width);
}
CBC_CommonByteMatrix::~CBC_CommonByteMatrix()
@@ -40,37 +40,37 @@ CBC_CommonByteMatrix::~CBC_CommonByteMatrix() m_bytes = NULL;
}
}
-FX_INT32 CBC_CommonByteMatrix::GetHeight()
+int32_t CBC_CommonByteMatrix::GetHeight()
{
return m_height;
}
-FX_INT32 CBC_CommonByteMatrix::GetWidth()
+int32_t CBC_CommonByteMatrix::GetWidth()
{
return m_width;
}
-FX_BYTE CBC_CommonByteMatrix::Get(FX_INT32 x, FX_INT32 y)
+uint8_t CBC_CommonByteMatrix::Get(int32_t x, int32_t y)
{
return m_bytes[y * m_width + x];
}
-void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_INT32 value)
+void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, int32_t value)
{
- m_bytes[y * m_width + x] = (FX_BYTE)value;
+ m_bytes[y * m_width + x] = (uint8_t)value;
}
-void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_BYTE value)
+void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, uint8_t value)
{
m_bytes[y * m_width + x] = value;
}
-void CBC_CommonByteMatrix::clear(FX_BYTE value)
+void CBC_CommonByteMatrix::clear(uint8_t value)
{
- FX_INT32 y;
+ int32_t y;
for(y = 0; y < m_height; y++) {
- FX_INT32 x;
+ int32_t x;
for(x = 0; x < m_width; x++) {
m_bytes[y * m_width + x] = value;
}
}
}
-FX_BYTE* CBC_CommonByteMatrix::GetArray()
+uint8_t* CBC_CommonByteMatrix::GetArray()
{
return m_bytes;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h index 55277660f3..f19e0038b6 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h +++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h @@ -9,20 +9,20 @@ class CBC_CommonByteMatrix
{
public:
- CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height);
+ CBC_CommonByteMatrix(int32_t width, int32_t height);
virtual ~CBC_CommonByteMatrix();
- FX_INT32 GetHeight();
- FX_INT32 GetWidth();
- FX_BYTE Get(FX_INT32 x, FX_INT32 y);
- FX_BYTE* GetArray();
+ int32_t GetHeight();
+ int32_t GetWidth();
+ uint8_t Get(int32_t x, int32_t y);
+ uint8_t* GetArray();
- void Set(FX_INT32 x, FX_INT32 y, FX_INT32 value);
- void Set(FX_INT32 x, FX_INT32 y, FX_BYTE value);
- void clear(FX_BYTE value);
+ void Set(int32_t x, int32_t y, int32_t value);
+ void Set(int32_t x, int32_t y, uint8_t value);
+ void clear(uint8_t value);
virtual void Init();
private:
- FX_BYTE *m_bytes;
- FX_INT32 m_width;
- FX_INT32 m_height;
+ uint8_t *m_bytes;
+ int32_t m_width;
+ int32_t m_height;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp index 2909704796..36f8e10af1 100644 --- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp @@ -26,7 +26,7 @@ void CBC_CommonCharacterSetECI::initialize()
{
}
-CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName):
+CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName):
CBC_CommonECI(value), m_encodingName(encodingName)
{
}
@@ -37,10 +37,10 @@ CFX_ByteString CBC_CommonCharacterSetECI::GetEncodingName() {
return m_encodingName;
}
-void CBC_CommonCharacterSetECI::AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName)
+void CBC_CommonCharacterSetECI::AddCharacterSet(int32_t value, CFX_ByteString encodingName)
{
}
-CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(FX_INT32 value)
+CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(int32_t value)
{
return NULL;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h index 1e9f9a433f..1c324796c8 100644 --- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h +++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h @@ -11,12 +11,12 @@ class CBC_CommonCharacterSetECI; class CBC_CommonCharacterSetECI : public CBC_CommonECI
{
public:
- CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName);
+ CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName);
virtual ~CBC_CommonCharacterSetECI();
CFX_ByteString GetEncodingName();
- static void AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName);
- FX_INT32 GetValue();
- static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(FX_INT32 value);
+ static void AddCharacterSet(int32_t value, CFX_ByteString encodingName);
+ int32_t GetValue();
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(int32_t value);
static CBC_CommonCharacterSetECI* GetCharacterSetECIByName(const CFX_ByteString& name);
private:
CFX_ByteString m_encodingName;
diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp index d0c55734db..e17a58db43 100644 --- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp @@ -27,7 +27,7 @@ CBC_CommonDecoderResult::CBC_CommonDecoderResult()
{
}
-void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e)
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e)
{
if(text.IsEmpty()) {
e = BCExceptionIllegalArgument;
@@ -39,7 +39,7 @@ void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_Byte m_ecLevel = ecLevel;
m_other = NULL;
}
-void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e)
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e)
{
if(text.IsEmpty()) {
e = BCExceptionIllegalArgument;
diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h index 5f41afc774..e85317934a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h +++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h @@ -17,8 +17,8 @@ public: const CFX_ByteString& GetText();
const CFX_Int32Array& GetByteSegments();
CBC_QRCoderErrorCorrectionLevel* GetECLevel();
- virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);
- virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e);
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e);
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e);
void setOther(CBC_PDF417ResultMetadata* other);
private:
CFX_ByteArray m_rawBytes;
diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.cpp b/xfa/src/fxbarcode/common/BC_CommonECI.cpp index 5aa64095f7..98e88b5dab 100644 --- a/xfa/src/fxbarcode/common/BC_CommonECI.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonECI.cpp @@ -23,18 +23,18 @@ #include "../barcode.h"
#include "BC_CommonECI.h"
#include "BC_CommonCharacterSetECI.h"
-CBC_CommonECI::CBC_CommonECI(FX_INT32 value)
+CBC_CommonECI::CBC_CommonECI(int32_t value)
{
m_value = value;
}
CBC_CommonECI::~CBC_CommonECI()
{
}
-FX_INT32 CBC_CommonECI::GetValue()
+int32_t CBC_CommonECI::GetValue()
{
return m_value;
}
-CBC_CommonECI* CBC_CommonECI::GetEICByValue(FX_INT32 value, FX_INT32 &e)
+CBC_CommonECI* CBC_CommonECI::GetEICByValue(int32_t value, int32_t &e)
{
if(value < 0 || value > 999999) {
e = BCExceptionBadECI;
diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.h b/xfa/src/fxbarcode/common/BC_CommonECI.h index 7a4ae6b8a6..503f15fef7 100644 --- a/xfa/src/fxbarcode/common/BC_CommonECI.h +++ b/xfa/src/fxbarcode/common/BC_CommonECI.h @@ -9,12 +9,12 @@ class CBC_CommonECI
{
public:
- CBC_CommonECI(FX_INT32 value);
+ CBC_CommonECI(int32_t value);
virtual ~CBC_CommonECI();
- FX_INT32 GetValue();
- static CBC_CommonECI* GetEICByValue(FX_INT32 value, FX_INT32 &e);
+ int32_t GetValue();
+ static CBC_CommonECI* GetEICByValue(int32_t value, int32_t &e);
private:
- FX_INT32 m_value;
+ int32_t m_value;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp index cb59d99cdf..7fbcac5bb2 100644 --- a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp @@ -48,7 +48,7 @@ CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::QuadrilateralToQ }
void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points)
{
- FX_INT32 max = points->GetSize();
+ int32_t max = points->GetSize();
FX_FLOAT a11 = m_a11;
FX_FLOAT a12 = m_a12;
FX_FLOAT a13 = m_a13;
@@ -58,7 +58,7 @@ void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points) FX_FLOAT a31 = m_a31;
FX_FLOAT a32 = m_a32;
FX_FLOAT a33 = m_a33;
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < max; i += 2) {
FX_FLOAT x = (*points)[i];
FX_FLOAT y = (*points)[i + 1];
diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp index 7ef1671d98..5976d450d9 100644 --- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp +++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp @@ -26,19 +26,19 @@ #include "BC_CommonBitMatrix.h"
#include "BC_CommonBitArray.h"
#include "BC_GlobalHistogramBinarizer.h"
-const FX_INT32 LUMINANCE_BITS = 5;
-const FX_INT32 LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
-const FX_INT32 LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
+const int32_t LUMINANCE_BITS = 5;
+const int32_t LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
+const int32_t LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
CBC_GlobalHistogramBinarizer::CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source): CBC_Binarizer(source)
{
}
CBC_GlobalHistogramBinarizer::~CBC_GlobalHistogramBinarizer()
{
}
-CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e)
+CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e)
{
CBC_LuminanceSource *source = GetLuminanceSource();
- FX_INT32 width = source->GetWidth();
+ int32_t width = source->GetWidth();
CBC_AutoPtr<CBC_CommonBitArray> result(FX_NEW CBC_CommonBitArray(width));
InitArrays(width);
CFX_ByteArray *localLuminances = source->GetRow(y, m_luminance, e);
@@ -47,20 +47,20 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co }
CFX_Int32Array localBuckets;
localBuckets.Copy(m_buckets);
- FX_INT32 x;
+ int32_t x;
for (x = 0; x < width; x++) {
- FX_INT32 pixel = (*localLuminances)[x] & 0xff;
+ int32_t pixel = (*localLuminances)[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
- FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);
+ int32_t blackPoint = EstimateBlackPoint(localBuckets, e);
if (e != BCExceptionNO) {
return result.release();
}
- FX_INT32 left = (*localLuminances)[0] & 0xff;
- FX_INT32 center = (*localLuminances)[1] & 0xff;
+ int32_t left = (*localLuminances)[0] & 0xff;
+ int32_t center = (*localLuminances)[1] & 0xff;
for (x = 1; x < width - 1; x++) {
- FX_INT32 right = (*localLuminances)[x + 1] & 0xff;
- FX_INT32 luminance = ((center << 2) - left - right) >> 1;
+ int32_t right = (*localLuminances)[x + 1] & 0xff;
+ int32_t luminance = ((center << 2) - left - right) >> 1;
if (luminance < blackPoint) {
result->Set(x);
}
@@ -69,36 +69,36 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co }
return result.release();
}
-CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e)
+CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(int32_t &e)
{
CBC_LuminanceSource *source = GetLuminanceSource();
- FX_INT32 width = source->GetWidth();
- FX_INT32 height = source->GetHeight();
+ int32_t width = source->GetWidth();
+ int32_t height = source->GetHeight();
CBC_CommonBitMatrix *BitMatrixTemp = FX_NEW CBC_CommonBitMatrix();
BitMatrixTemp->Init(width, height);
CBC_AutoPtr<CBC_CommonBitMatrix> matrix(BitMatrixTemp);
InitArrays(width);
CFX_Int32Array localBuckets;
localBuckets.Copy(m_buckets);
- FX_INT32 y;
+ int32_t y;
for (y = 1; y < 5; y++) {
- FX_INT32 row = height * y / 5;
+ int32_t row = height * y / 5;
CFX_ByteArray *localLuminances = source->GetRow(row, m_luminance, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 right = (width << 2) / 5;
- FX_INT32 x;
+ int32_t right = (width << 2) / 5;
+ int32_t x;
for (x = width / 5; x < right; x++) {
- FX_INT32 pixel = (*localLuminances)[x] & 0xff;
+ int32_t pixel = (*localLuminances)[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
}
- FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);
+ int32_t blackPoint = EstimateBlackPoint(localBuckets, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CFX_ByteArray> localLuminances(source->GetMatrix());
for (y = 0; y < height; y++) {
- FX_INT32 offset = y * width;
- for (FX_INT32 x = 0; x < width; x++) {
- FX_INT32 pixel = (*localLuminances)[offset + x] & 0xff;
+ int32_t offset = y * width;
+ for (int32_t x = 0; x < width; x++) {
+ int32_t pixel = (*localLuminances)[offset + x] & 0xff;
if (pixel < blackPoint) {
matrix->Set(x, y);
}
@@ -106,7 +106,7 @@ CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e) }
return matrix.release();
}
-void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize)
+void CBC_GlobalHistogramBinarizer::InitArrays(int32_t luminanceSize)
{
if(m_luminance.GetSize() < luminanceSize) {
m_luminance.SetSize(luminanceSize);
@@ -114,19 +114,19 @@ void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize) if(m_buckets.GetSize() <= 0) {
m_buckets.SetSize(LUMINANCE_BUCKETS);
} else {
- FX_INT32 x;
+ int32_t x;
for(x = 0; x < LUMINANCE_BUCKETS; x++) {
m_buckets[x] = 0;
}
}
}
-FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e)
+int32_t CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e)
{
- FX_INT32 numBuckets = buckets.GetSize();
- FX_INT32 maxBucketCount = 0;
- FX_INT32 firstPeak = 0;
- FX_INT32 firstPeakSize = 0;
- FX_INT32 x;
+ int32_t numBuckets = buckets.GetSize();
+ int32_t maxBucketCount = 0;
+ int32_t firstPeak = 0;
+ int32_t firstPeakSize = 0;
+ int32_t x;
for (x = 0; x < numBuckets; x++) {
if (buckets[x] > firstPeakSize) {
firstPeak = x;
@@ -136,18 +136,18 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket maxBucketCount = buckets[x];
}
}
- FX_INT32 secondPeak = 0;
- FX_INT32 secondPeakScore = 0;
+ int32_t secondPeak = 0;
+ int32_t secondPeakScore = 0;
for (x = 0; x < numBuckets; x++) {
- FX_INT32 distanceToBiggest = x - firstPeak;
- FX_INT32 score = buckets[x] * distanceToBiggest * distanceToBiggest;
+ int32_t distanceToBiggest = x - firstPeak;
+ int32_t score = buckets[x] * distanceToBiggest * distanceToBiggest;
if (score > secondPeakScore) {
secondPeak = x;
secondPeakScore = score;
}
}
if (firstPeak > secondPeak) {
- FX_INT32 temp = firstPeak;
+ int32_t temp = firstPeak;
firstPeak = secondPeak;
secondPeak = temp;
}
@@ -155,11 +155,11 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket e = BCExceptionRead;
return 0;
}
- FX_INT32 bestValley = secondPeak - 1;
- FX_INT32 bestValleyScore = -1;
+ int32_t bestValley = secondPeak - 1;
+ int32_t bestValleyScore = -1;
for (x = secondPeak - 1; x > firstPeak; x--) {
- FX_INT32 fromFirst = x - firstPeak;
- FX_INT32 score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);
+ int32_t fromFirst = x - firstPeak;
+ int32_t score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);
if (score > bestValleyScore) {
bestValley = x;
bestValleyScore = score;
diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h index ef084c075e..6c6d8ba188 100644 --- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h +++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h @@ -17,10 +17,10 @@ public: CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source);
virtual ~CBC_GlobalHistogramBinarizer();
- void InitArrays(FX_INT32 luminanceSize);
- CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e);
- CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);
- static FX_INT32 EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e);
+ void InitArrays(int32_t luminanceSize);
+ CBC_CommonBitMatrix *GetBlackMatrix(int32_t &e);
+ CBC_CommonBitArray *GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e);
+ static int32_t EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e);
private:
CFX_ByteArray m_luminance;
CFX_Int32Array m_buckets;
diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp index 8bc93136ca..3d350996dd 100644 --- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp +++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp @@ -24,8 +24,8 @@ #include "BC_WhiteRectangleDetector.h"
#include "BC_CommonBitMatrix.h"
#include "../BC_ResultPoint.h"
-const FX_INT32 CBC_WhiteRectangleDetector::INIT_SIZE = 30;
-const FX_INT32 CBC_WhiteRectangleDetector::CORR = 1;
+const int32_t CBC_WhiteRectangleDetector::INIT_SIZE = 30;
+const int32_t CBC_WhiteRectangleDetector::CORR = 1;
CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image)
{
m_image = image;
@@ -36,19 +36,19 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag m_upInit = (m_height - INIT_SIZE) >> 1;
m_downInit = (m_height + INIT_SIZE) >> 1;
}
-void CBC_WhiteRectangleDetector::Init(FX_INT32 &e)
+void CBC_WhiteRectangleDetector::Init(int32_t &e)
{
if (m_upInit < 0 || m_leftInit < 0 || m_downInit >= m_height || m_rightInit >= m_width) {
e = BCExceptionNotFound;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y)
+CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y)
{
m_image = image;
m_height = image->GetHeight();
m_width = image->GetWidth();
- FX_INT32 halfsize = initSize >> 1;
+ int32_t halfsize = initSize >> 1;
m_leftInit = x - halfsize;
m_rightInit = x + halfsize;
m_upInit = y - halfsize;
@@ -57,12 +57,12 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag CBC_WhiteRectangleDetector::~CBC_WhiteRectangleDetector()
{
}
-CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
+CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(int32_t &e)
{
- FX_INT32 left = m_leftInit;
- FX_INT32 right = m_rightInit;
- FX_INT32 up = m_upInit;
- FX_INT32 down = m_downInit;
+ int32_t left = m_leftInit;
+ int32_t right = m_rightInit;
+ int32_t up = m_upInit;
+ int32_t down = m_downInit;
FX_BOOL sizeExceeded = FALSE;
FX_BOOL aBlackPointFoundOnBorder = TRUE;
FX_BOOL atLeastOneBlackPointFoundOnBorder = FALSE;
@@ -121,9 +121,9 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) }
}
if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) {
- FX_INT32 maxSize = right - left;
+ int32_t maxSize = right - left;
CBC_AutoPtr<CBC_ResultPoint> z(NULL);
- for (FX_INT32 i = 1; i < maxSize; i++) {
+ for (int32_t i = 1; i < maxSize; i++) {
z = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(down - i), (FX_FLOAT)(left + i), (FX_FLOAT)(down)) );
if (z.get() != NULL) {
break;
@@ -134,7 +134,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> t(NULL);
- for (FX_INT32 j = 1; j < maxSize; j++) {
+ for (int32_t j = 1; j < maxSize; j++) {
t = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(up + j), (FX_FLOAT)(left + j), (FX_FLOAT)up));
if (t.get() != NULL) {
break;
@@ -145,7 +145,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> x(NULL);
- for (FX_INT32 k = 1; k < maxSize; k++) {
+ for (int32_t k = 1; k < maxSize; k++) {
x = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(up + k), (FX_FLOAT)(right - k), (FX_FLOAT)up));
if (x.get() != NULL) {
break;
@@ -156,7 +156,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> y(NULL);
- for (FX_INT32 m = 1; m < maxSize; m++) {
+ for (int32_t m = 1; m < maxSize; m++) {
y = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(down - m), (FX_FLOAT)(right - m), (FX_FLOAT) down));
if (y.get() != NULL) {
break;
@@ -173,25 +173,25 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) }
return NULL;
}
-FX_INT32 CBC_WhiteRectangleDetector::Round(FX_FLOAT d)
+int32_t CBC_WhiteRectangleDetector::Round(FX_FLOAT d)
{
- return (FX_INT32) (d + 0.5f);
+ return (int32_t) (d + 0.5f);
}
CBC_ResultPoint *CBC_WhiteRectangleDetector::GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
{
- FX_INT32 dist = DistanceL2(aX, aY, bX, bY);
+ int32_t dist = DistanceL2(aX, aY, bX, bY);
float xStep = (bX - aX) / dist;
float yStep = (bY - aY) / dist;
- for (FX_INT32 i = 0; i < dist; i++) {
- FX_INT32 x = Round(aX + i * xStep);
- FX_INT32 y = Round(aY + i * yStep);
+ for (int32_t i = 0; i < dist; i++) {
+ int32_t x = Round(aX + i * xStep);
+ int32_t y = Round(aY + i * yStep);
if (m_image->Get(x, y)) {
return FX_NEW CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT) y);
}
}
return NULL;
}
-FX_INT32 CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
+int32_t CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
{
float xDiff = aX - bX;
float yDiff = aY - bY;
@@ -225,16 +225,16 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::CenterEdges(CBC_ResultPoint *y, CBC_Re return result;
}
}
-FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal)
+FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal)
{
if (horizontal) {
- for (FX_INT32 x = a; x <= b; x++) {
+ for (int32_t x = a; x <= b; x++) {
if (m_image->Get(x, fixed)) {
return TRUE;
}
}
} else {
- for (FX_INT32 y = a; y <= b; y++) {
+ for (int32_t y = a; y <= b; y++) {
if (m_image->Get(fixed, y)) {
return TRUE;
}
diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h index 40146d39de..c7607f9e56 100644 --- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h +++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h @@ -12,26 +12,26 @@ class CBC_WhiteRectangleDetector {
public:
CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image);
- CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y);
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y);
virtual ~CBC_WhiteRectangleDetector();
- CFX_PtrArray *Detect(FX_INT32 &e);
- virtual void Init(FX_INT32 &e);
+ CFX_PtrArray *Detect(int32_t &e);
+ virtual void Init(int32_t &e);
private:
- FX_INT32 Round(float d);
+ int32_t Round(float d);
CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
- FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
+ int32_t DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z,
CBC_ResultPoint *x, CBC_ResultPoint *t);
- FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal);
- const static FX_INT32 INIT_SIZE;
- const static FX_INT32 CORR;
+ FX_BOOL ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal);
+ const static int32_t INIT_SIZE;
+ const static int32_t CORR;
CBC_CommonBitMatrix *m_image;
- FX_INT32 m_height;
- FX_INT32 m_width;
- FX_INT32 m_leftInit;
- FX_INT32 m_rightInit;
- FX_INT32 m_downInit;
- FX_INT32 m_upInit;
+ int32_t m_height;
+ int32_t m_width;
+ int32_t m_leftInit;
+ int32_t m_rightInit;
+ int32_t m_downInit;
+ int32_t m_upInit;
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp index 1fc8b6685a..1ece2add2c 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp @@ -32,11 +32,11 @@ void CBC_ReedSolomonEncoder::Init() {
m_cachedGenerators.Add(FX_NEW CBC_ReedSolomonGF256Poly(m_field, 1));
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree, int32_t &e)
{
if(degree >= m_cachedGenerators.GetSize()) {
CBC_ReedSolomonGF256Poly* lastGenerator = (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[m_cachedGenerators.GetSize() - 1]);
- for(FX_INT32 d = m_cachedGenerators.GetSize(); d <= degree; d++) {
+ for(int32_t d = m_cachedGenerators.GetSize(); d <= degree; d++) {
CFX_Int32Array temp;
temp.Add(1);
temp.Add(m_field->Exp(d - 1));
@@ -51,13 +51,13 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree }
return (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[degree]);
}
-void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e)
+void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e)
{
if(ecBytes == 0) {
e = BCExceptionNoCorrectionBytes;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 dataBytes = toEncode->GetSize() - ecBytes;
+ int32_t dataBytes = toEncode->GetSize() - ecBytes;
if(dataBytes <= 0) {
e = BCExceptionNoDataBytesProvided;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -66,7 +66,7 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, BC_EXCEPTION_CHECK_ReturnVoid(e);
CFX_Int32Array infoCoefficients;
infoCoefficients.SetSize(dataBytes);
- for(FX_INT32 x = 0; x < dataBytes; x++) {
+ for(int32_t x = 0; x < dataBytes; x++) {
infoCoefficients[x] = toEncode->operator [](x);
}
CBC_ReedSolomonGF256Poly info;
@@ -80,21 +80,21 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, CBC_AutoPtr<CFX_PtrArray > temp(pa);
CBC_ReedSolomonGF256Poly* remainder = (CBC_ReedSolomonGF256Poly*)(temp->operator [](1));
CFX_Int32Array* coefficients = remainder->GetCoefficients();
- FX_INT32 numZeroCoefficients = ecBytes - coefficients->GetSize();
- for(FX_INT32 i = 0; i < numZeroCoefficients; i++) {
+ int32_t numZeroCoefficients = ecBytes - coefficients->GetSize();
+ for(int32_t i = 0; i < numZeroCoefficients; i++) {
(*toEncode)[dataBytes + i] = 0;
}
- for(FX_INT32 y = 0; y < coefficients->GetSize(); y++) {
+ for(int32_t y = 0; y < coefficients->GetSize(); y++) {
(*toEncode)[dataBytes + numZeroCoefficients + y] =
coefficients->operator [](y);
}
- for (FX_INT32 k = 0; k < temp->GetSize(); k++) {
+ for (int32_t k = 0; k < temp->GetSize(); k++) {
delete (CBC_ReedSolomonGF256Poly*)(*temp)[k];
}
}
CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder()
{
- for (FX_INT32 i = 0; i < m_cachedGenerators.GetSize(); i++) {
+ for (int32_t i = 0; i < m_cachedGenerators.GetSize(); i++) {
delete (CBC_ReedSolomonGF256Poly*)m_cachedGenerators[i];
}
}
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h index 713f343d98..bc35ebed1f 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h @@ -13,12 +13,12 @@ class CBC_ReedSolomonEncoder private:
CBC_ReedSolomonGF256* m_field;
CFX_PtrArray m_cachedGenerators;
- CBC_ReedSolomonGF256Poly* BuildGenerator(FX_INT32 degree, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* BuildGenerator(int32_t degree, int32_t &e);
public:
CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256 * field);
virtual ~CBC_ReedSolomonEncoder();
- void Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e);
+ void Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e);
virtual void Init();
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp index 3cb5e7762f..f0e87b8e40 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp @@ -31,7 +31,7 @@ CBC_ReedSolomonDecoder::CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256* field) CBC_ReedSolomonDecoder::~CBC_ReedSolomonDecoder()
{
}
-void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e)
+void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e)
{
CBC_ReedSolomonGF256Poly poly;
poly.Init(m_field, received, e);
@@ -40,8 +40,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ syndromeCoefficients.SetSize(twoS);
FX_BOOL dataMatrix = FALSE;
FX_BOOL noError = TRUE;
- for (FX_INT32 i = 0; i < twoS; i++) {
- FX_INT32 eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i));
+ for (int32_t i = 0; i < twoS; i++) {
+ int32_t eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i));
syndromeCoefficients[twoS - 1 - i] = eval;
if (eval != 0) {
noError = FALSE;
@@ -67,8 +67,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ CFX_Int32Array* ia2 = FindErrorMagnitudes(omega.get(), errorLocations.get(), dataMatrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
CBC_AutoPtr<CFX_Int32Array > errorMagnitudes(ia2);
- for (FX_INT32 k = 0; k < errorLocations->GetSize(); k++) {
- FX_INT32 position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e);
+ for (int32_t k = 0; k < errorLocations->GetSize(); k++) {
+ int32_t position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(position < 0) {
e = BCExceptionBadErrorLocation;
@@ -77,7 +77,7 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ (*received)[position] = CBC_ReedSolomonGF256::AddOrSubtract((*received)[position], (*errorMagnitudes)[k]);
}
}
-CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e)
+CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e)
{
if (a->GetDegree() < b->GetDegree()) {
CBC_ReedSolomonGF256Poly* temp = a;
@@ -120,12 +120,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 CBC_ReedSolomonGF256Poly* rsg8 = m_field->GetZero()->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> q(rsg8);
- FX_INT32 denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree());
- FX_INT32 dltInverse = m_field->Inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree());
+ int32_t dltInverse = m_field->Inverse(denominatorLeadingTerm, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
while (r->GetDegree() >= rLast->GetDegree() && !(r->IsZero())) {
- FX_INT32 degreeDiff = r->GetDegree() - rLast->GetDegree();
- FX_INT32 scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse);
+ int32_t degreeDiff = r->GetDegree() - rLast->GetDegree();
+ int32_t scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse);
CBC_ReedSolomonGF256Poly* rsgp1 = m_field->BuildMonomial(degreeDiff, scale, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> build(rsgp1);
@@ -156,12 +156,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp6(rsg12);
t = temp6;
}
- FX_INT32 sigmaTildeAtZero = t->GetCoefficients(0);
+ int32_t sigmaTildeAtZero = t->GetCoefficients(0);
if (sigmaTildeAtZero == 0) {
e = BCExceptionIsZero;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 inverse = m_field->Inverse(sigmaTildeAtZero, e);
+ int32_t inverse = m_field->Inverse(sigmaTildeAtZero, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_ReedSolomonGF256Poly* rsg13 = t->Multiply(inverse, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -174,9 +174,9 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 temp->Add(omega.release());
return temp;
}
-CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e)
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e)
{
- FX_INT32 numErrors = errorLocator->GetDegree();
+ int32_t numErrors = errorLocator->GetDegree();
if (numErrors == 1) {
CBC_AutoPtr<CFX_Int32Array > temp(FX_NEW CFX_Int32Array);
temp->Add(errorLocator->GetCoefficients(1));
@@ -185,8 +185,8 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P CFX_Int32Array *tempT = FX_NEW CFX_Int32Array;
tempT->SetSize(numErrors);
CBC_AutoPtr<CFX_Int32Array > result(tempT);
- FX_INT32 ie = 0;
- for (FX_INT32 i = 1; i < 256 && ie < numErrors; i++) {
+ int32_t ie = 0;
+ for (int32_t i = 1; i < 256 && ie < numErrors; i++) {
if(errorLocator->EvaluateAt(i) == 0) {
(*result)[ie] = m_field->Inverse(i, ie);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -199,23 +199,23 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P }
return result.release();
}
-CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e)
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e)
{
- FX_INT32 s = errorLocations->GetSize();
+ int32_t s = errorLocations->GetSize();
CFX_Int32Array * temp = FX_NEW CFX_Int32Array;
temp->SetSize(s);
CBC_AutoPtr<CFX_Int32Array > result(temp);
- for (FX_INT32 i = 0; i < s; i++) {
- FX_INT32 xiInverse = m_field->Inverse(errorLocations->operator [](i), e);
+ for (int32_t i = 0; i < s; i++) {
+ int32_t xiInverse = m_field->Inverse(errorLocations->operator [](i), e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 denominator = 1;
- for(FX_INT32 j = 0; j < s; j++) {
+ int32_t denominator = 1;
+ for(int32_t j = 0; j < s; j++) {
if(i != j) {
denominator = m_field->Multiply(denominator,
CBC_ReedSolomonGF256::AddOrSubtract(1, m_field->Multiply(errorLocations->operator [](j), xiInverse)));
}
}
- FX_INT32 temp = m_field->Inverse(denominator, temp);
+ int32_t temp = m_field->Inverse(denominator, temp);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
(*result)[i] = m_field->Multiply(errorEvaluator->EvaluateAt(xiInverse),
temp);
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h index db026edd01..edefd4a29a 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h @@ -15,9 +15,9 @@ private: public:
CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256 * field);
virtual ~CBC_ReedSolomonDecoder();
- void Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e);
- CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e);
- CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e);
- CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e);
+ void Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e);
+ CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e);
+ CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e);
+ CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp index bb045ac24c..426ac2fbd8 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp @@ -43,17 +43,17 @@ void CBC_ReedSolomonGF256::Finalize() }
DataMatrixField = NULL;
}
-CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(FX_INT32 primitive)
+CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(int32_t primitive)
{
- FX_INT32 x = 1;
- for(FX_INT32 j = 0; j < 256; j++) {
+ int32_t x = 1;
+ for(int32_t j = 0; j < 256; j++) {
m_expTable[j] = x;
x <<= 1;
if(x >= 0x100) {
x ^= primitive;
}
}
- for(FX_INT32 i = 0; i < 255; i++) {
+ for(int32_t i = 0; i < 255; i++) {
m_logTable[m_expTable[i]] = i;
}
m_logTable[0] = 0;
@@ -82,7 +82,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::GetOne() {
return m_one;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if(degree < 0) {
e = BCExceptionDegreeIsNegative;
@@ -101,15 +101,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-FX_INT32 CBC_ReedSolomonGF256::AddOrSubtract(FX_INT32 a, FX_INT32 b)
+int32_t CBC_ReedSolomonGF256::AddOrSubtract(int32_t a, int32_t b)
{
return a ^ b;
}
-FX_INT32 CBC_ReedSolomonGF256::Exp(FX_INT32 a)
+int32_t CBC_ReedSolomonGF256::Exp(int32_t a)
{
return m_expTable[a];
}
-FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_ReedSolomonGF256::Log(int32_t a, int32_t &e)
{
if(a == 0) {
e = BCExceptionAIsZero;
@@ -117,7 +117,7 @@ FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e) }
return m_logTable[a];
}
-FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_ReedSolomonGF256::Inverse(int32_t a, int32_t &e)
{
if(a == 0) {
e = BCExceptionAIsZero;
@@ -125,7 +125,7 @@ FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e) }
return m_expTable[255 - m_logTable[a]];
}
-FX_INT32 CBC_ReedSolomonGF256::Multiply(FX_INT32 a, FX_INT32 b)
+int32_t CBC_ReedSolomonGF256::Multiply(int32_t a, int32_t b)
{
if(a == 0 || b == 0) {
return 0;
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h index 40e7ffef28..141c3dab36 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h @@ -14,20 +14,20 @@ public: static void Finalize();
static CBC_ReedSolomonGF256 *QRCodeFild;
static CBC_ReedSolomonGF256 *DataMatrixField;
- CBC_ReedSolomonGF256(FX_INT32 primitive);
+ CBC_ReedSolomonGF256(int32_t primitive);
virtual ~CBC_ReedSolomonGF256();
CBC_ReedSolomonGF256Poly* GetZero();
CBC_ReedSolomonGF256Poly* GetOne();
- CBC_ReedSolomonGF256Poly* BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- static FX_INT32 AddOrSubtract(FX_INT32 a, FX_INT32 b);
- FX_INT32 Exp(FX_INT32 a);
- FX_INT32 Log(FX_INT32 a, FX_INT32 &e);
- FX_INT32 Inverse(FX_INT32 a, FX_INT32 &e);
- FX_INT32 Multiply(FX_INT32 a, FX_INT32 b);
+ CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ static int32_t AddOrSubtract(int32_t a, int32_t b);
+ int32_t Exp(int32_t a);
+ int32_t Log(int32_t a, int32_t &e);
+ int32_t Inverse(int32_t a, int32_t &e);
+ int32_t Multiply(int32_t a, int32_t b);
virtual void Init();
private:
- FX_INT32 m_expTable[256];
- FX_INT32 m_logTable[256];
+ int32_t m_expTable[256];
+ int32_t m_logTable[256];
CBC_ReedSolomonGF256Poly *m_zero;
CBC_ReedSolomonGF256Poly *m_one;
};
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp index 6476e4cf80..d59f619e25 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp @@ -23,7 +23,7 @@ #include "../../barcode.h"
#include "BC_ReedSolomonGF256.h"
#include "BC_ReedSolomonGF256Poly.h"
-CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients)
+CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients)
{
if(field == NULL) {
return;
@@ -35,16 +35,16 @@ CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly() {
m_field = NULL;
}
-void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e)
+void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e)
{
if(coefficients == NULL || coefficients->GetSize() == 0) {
e = BCExceptionCoefficientsSizeIsNull;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
m_field = field;
- FX_INT32 coefficientsLength = coefficients->GetSize();
+ int32_t coefficientsLength = coefficients->GetSize();
if((coefficientsLength > 1 && (*coefficients)[0] == 0)) {
- FX_INT32 firstNonZero = 1;
+ int32_t firstNonZero = 1;
while((firstNonZero < coefficientsLength) && ((*coefficients)[firstNonZero] == 0)) {
firstNonZero++;
}
@@ -52,7 +52,7 @@ void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* m_coefficients.Copy( *(m_field->GetZero()->GetCoefficients()));
} else {
m_coefficients.SetSize(coefficientsLength - firstNonZero);
- for(FX_INT32 i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) {
+ for(int32_t i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) {
m_coefficients[j] = coefficients->operator [](i);
}
}
@@ -64,7 +64,7 @@ CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() {
return &m_coefficients;
}
-FX_INT32 CBC_ReedSolomonGF256Poly::GetDegree()
+int32_t CBC_ReedSolomonGF256Poly::GetDegree()
{
return m_coefficients.GetSize() - 1;
}
@@ -72,39 +72,39 @@ FX_BOOL CBC_ReedSolomonGF256Poly::IsZero() {
return m_coefficients[0] == 0;
}
-FX_INT32 CBC_ReedSolomonGF256Poly::GetCoefficients(FX_INT32 degree)
+int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree)
{
return m_coefficients[m_coefficients.GetSize() - 1 - degree];
}
-FX_INT32 CBC_ReedSolomonGF256Poly::EvaluateAt(FX_INT32 a)
+int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a)
{
if(a == 0) {
return GetCoefficients(0);
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
if(a == 1) {
- FX_INT32 result = 0;
- for(FX_INT32 i = 0; i < size; i++) {
+ int32_t result = 0;
+ for(int32_t i = 0; i < size; i++) {
result = CBC_ReedSolomonGF256::AddOrSubtract(result, m_coefficients[i]);
}
return result;
}
- FX_INT32 result = m_coefficients[0];
- for(FX_INT32 j = 1; j < size; j++) {
+ int32_t result = m_coefficients[0];
+ for(int32_t j = 1; j < size; j++) {
result = CBC_ReedSolomonGF256::AddOrSubtract(
m_field->Multiply(a, result),
m_coefficients[j]);
}
return result;
}
-CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(FX_INT32 &e)
+CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(int32_t &e)
{
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &m_coefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e)
{
if(IsZero()) {
return other->Clone(e);
@@ -126,11 +126,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo }
CFX_Int32Array sumDiff;
sumDiff.SetSize(largerCoefficients.GetSize() );
- FX_INT32 lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
- for(FX_INT32 i = 0; i < lengthDiff; i++) {
+ int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
+ for(int32_t i = 0; i < lengthDiff; i++) {
sumDiff[i] = largerCoefficients[i];
}
- for(FX_INT32 j = lengthDiff; j < largerCoefficients.GetSize(); j++) {
+ for(int32_t j = lengthDiff; j < largerCoefficients.GetSize(); j++) {
sumDiff[j] = (CBC_ReedSolomonGF256::AddOrSubtract(smallerCoefficients[j - lengthDiff],
largerCoefficients[j]));
}
@@ -139,7 +139,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e)
{
if(IsZero() || other->IsZero()) {
CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e);
@@ -148,15 +148,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25 }
CFX_Int32Array aCoefficients ;
aCoefficients.Copy(m_coefficients);
- FX_INT32 aLength = m_coefficients.GetSize();
+ int32_t aLength = m_coefficients.GetSize();
CFX_Int32Array bCoefficients;
bCoefficients.Copy(*(other->GetCoefficients()));
- FX_INT32 bLength = other->GetCoefficients()->GetSize();
+ int32_t bLength = other->GetCoefficients()->GetSize();
CFX_Int32Array product;
product.SetSize(aLength + bLength - 1);
- for(FX_INT32 i = 0; i < aLength; i++) {
- FX_INT32 aCoeff = m_coefficients[i];
- for(FX_INT32 j = 0; j < bLength; j++) {
+ for(int32_t i = 0; i < aLength; i++) {
+ int32_t aCoeff = m_coefficients[i];
+ for(int32_t j = 0; j < bLength; j++) {
product[i + j] = CBC_ReedSolomonGF256::AddOrSubtract(
product[i + j],
m_field->Multiply(aCoeff, other->GetCoefficients()->operator [](j)));
@@ -167,7 +167,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25 BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, int32_t &e)
{
if(scalar == 0) {
CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e);
@@ -178,10 +178,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX return this->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size);
- for(FX_INT32 i = 0; i < size; i++) {
+ for(int32_t i = 0; i < size; i++) {
product[i] = m_field->Multiply(m_coefficients[i], scalar);
}
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
@@ -189,7 +189,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if(degree < 0) {
e = BCExceptionDegreeIsNegative;
@@ -200,10 +200,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size + degree);
- for(FX_INT32 i = 0; i < size; i++) {
+ for(int32_t i = 0; i < size; i++) {
product[i] = (m_field->Multiply(m_coefficients[i], coefficient));
}
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
@@ -211,7 +211,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e)
+CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e)
{
if(other->IsZero()) {
e = BCExceptionDivideByZero;
@@ -223,13 +223,13 @@ CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, CBC_ReedSolomonGF256Poly* rsg2 = this->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> remainder(rsg2);
- FX_INT32 denominatorLeadingTerm = other->GetCoefficients(other->GetDegree());
- FX_INT32 inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = other->GetCoefficients(other->GetDegree());
+ int32_t inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
FX_BOOL bFirst = TRUE;
while(remainder->GetDegree() >= other->GetDegree() && !remainder->IsZero()) {
- FX_INT32 degreeDifference = remainder->GetDegree() - other->GetDegree();
- FX_INT32 scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())),
+ int32_t degreeDifference = remainder->GetDegree() - other->GetDegree();
+ int32_t scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())),
inverseDenominatorLeadingTeam);
CBC_ReedSolomonGF256Poly* rsg3 = other->MultiplyByMonomial(degreeDifference, scale, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h index 5c9ae6cce6..d7f1508b40 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h @@ -10,21 +10,21 @@ class CBC_ReedSolomonGF256; class CBC_ReedSolomonGF256Poly
{
public:
- CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients);
+ CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients);
CBC_ReedSolomonGF256Poly();
virtual ~CBC_ReedSolomonGF256Poly();
- FX_INT32 GetCoefficients(FX_INT32 degree);
+ int32_t GetCoefficients(int32_t degree);
CFX_Int32Array* GetCoefficients();
- FX_INT32 GetDegree();
+ int32_t GetDegree();
FX_BOOL IsZero();
- FX_INT32 EvaluateAt(FX_INT32 a);
- CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Multiply(FX_INT32 scalar, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Clone(FX_INT32 &e);
- virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e);
+ int32_t EvaluateAt(int32_t a);
+ CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Multiply(int32_t scalar, int32_t &e);
+ CBC_ReedSolomonGF256Poly* MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Clone(int32_t &e);
+ virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e);
private:
CBC_ReedSolomonGF256* m_field;
CFX_Int32Array m_coefficients;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp index bc29b7d6ce..df58f15212 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp @@ -34,13 +34,13 @@ CBC_ASCIIEncoder::CBC_ASCIIEncoder() CBC_ASCIIEncoder::~CBC_ASCIIEncoder()
{
}
-FX_INT32 CBC_ASCIIEncoder::getEncodingMode()
+int32_t CBC_ASCIIEncoder::getEncodingMode()
{
return ASCII_ENCODATION;
}
-void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e)
+void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, int32_t &e)
{
- FX_INT32 n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos);
+ int32_t n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos);
if (n >= 2) {
FX_WCHAR code = encodeASCIIDigits(context.m_msg.GetAt(context.m_pos), context.m_msg.GetAt(context.m_pos + 1), e);
if (e != BCExceptionNO) {
@@ -50,7 +50,7 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) context.m_pos += 2;
} else {
FX_WCHAR c = context.getCurrentChar();
- FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
+ int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
switch (newMode) {
case BASE256_ENCODATION:
@@ -87,10 +87,10 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) }
}
}
-FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e)
+FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e)
{
if (CBC_HighLevelEncoder::isDigit(digit1) && CBC_HighLevelEncoder::isDigit(digit2)) {
- FX_INT32 num = (digit1 - 48) * 10 + (digit2 - 48);
+ int32_t num = (digit1 - 48) * 10 + (digit2 - 48);
FX_WCHAR a = (FX_WCHAR) (num + 130);
return (FX_WCHAR) (num + 130);
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h index 9a48b8762f..3c05a41d7b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h @@ -14,9 +14,9 @@ class CBC_ASCIIEncoder : public CBC_Encoder public:
CBC_ASCIIEncoder();
virtual ~CBC_ASCIIEncoder();
- FX_INT32 getEncodingMode();
- void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ int32_t getEncodingMode();
+ void Encode(CBC_EncoderContext &context, int32_t &e);
private:
- static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e);
+ static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp index d896cf6445..7a68fcaef6 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -34,11 +34,11 @@ CBC_Base256Encoder::CBC_Base256Encoder() CBC_Base256Encoder::~CBC_Base256Encoder()
{
}
-FX_INT32 CBC_Base256Encoder::getEncodingMode()
+int32_t CBC_Base256Encoder::getEncodingMode()
{
return BASE256_ENCODATION;
}
-void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e)
+void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, int32_t &e)
{
CFX_WideString buffer;
buffer += (FX_WCHAR)'\0';
@@ -46,13 +46,13 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FX_WCHAR c = context.getCurrentChar();
buffer += c;
context.m_pos++;
- FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
+ int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(newMode);
break;
}
}
- FX_INT32 dataCount = buffer.GetLength() - 1;
+ int32_t dataCount = buffer.GetLength() - 1;
FX_CHAR buf[128];
#if defined(_FX_WINAPI_PARTITION_APP_)
memset(buf, 0, sizeof(FX_CHAR) * 128);
@@ -61,8 +61,8 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FXSYS_itoa(dataCount, buf, 10);
#endif
buffer.SetAt(0, FX_WCHAR(*buf) - '0');
- FX_INT32 lengthFieldSize = 1;
- FX_INT32 currentSize = context.getCodewordCount() + dataCount + lengthFieldSize;
+ int32_t lengthFieldSize = 1;
+ int32_t currentSize = context.getCodewordCount() + dataCount + lengthFieldSize;
context.updateSymbolInfo(currentSize, e);
if (e != BCExceptionNO) {
return;
@@ -79,14 +79,14 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return;
}
}
- for (FX_INT32 i = 0, c = buffer.GetLength(); i < c; i++) {
+ for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) {
context.writeCodeword(randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1));
}
}
-FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition)
+FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, int32_t codewordPosition)
{
- FX_INT32 pseudoRandom = ((149 * codewordPosition) % 255) + 1;
- FX_INT32 tempVariable = ch + pseudoRandom;
+ int32_t pseudoRandom = ((149 * codewordPosition) % 255) + 1;
+ int32_t tempVariable = ch + pseudoRandom;
if (tempVariable <= 255) {
return (FX_WCHAR) tempVariable;
} else {
diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h index 96110b1d08..61e6c8085f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h @@ -13,9 +13,9 @@ class CBC_Base256Encoder : public CBC_Encoder public:
CBC_Base256Encoder();
virtual ~CBC_Base256Encoder();
- FX_INT32 getEncodingMode();
- void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ int32_t getEncodingMode();
+ void Encode(CBC_EncoderContext &context, int32_t &e);
private:
- static FX_WCHAR randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition);
+ static FX_WCHAR randomize255State(FX_WCHAR ch, int32_t codewordPosition);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp index 4c3b458afa..0afd018558 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp @@ -35,27 +35,27 @@ CBC_C40Encoder::CBC_C40Encoder() CBC_C40Encoder::~CBC_C40Encoder()
{
}
-FX_INT32 CBC_C40Encoder::getEncodingMode()
+int32_t CBC_C40Encoder::getEncodingMode()
{
return C40_ENCODATION;
}
-void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e)
+void CBC_C40Encoder::Encode(CBC_EncoderContext &context, int32_t &e)
{
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
FX_WCHAR c = context.getCurrentChar();
context.m_pos++;
- FX_INT32 lastCharSize = encodeChar(c, buffer, e);
+ int32_t lastCharSize = encodeChar(c, buffer, e);
if (e != BCExceptionNO) {
return;
}
- FX_INT32 unwritten = (buffer.GetLength() / 3) * 2;
- FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten;
+ int32_t unwritten = (buffer.GetLength() / 3) * 2;
+ int32_t curCodewordCount = context.getCodewordCount() + unwritten;
context.updateSymbolInfo(curCodewordCount, e);
if (e != BCExceptionNO) {
return;
}
- FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount;
+ int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount;
if (!context.hasMoreCharacters()) {
CFX_WideString removed;
if ((buffer.GetLength() % 3) == 2) {
@@ -75,9 +75,9 @@ void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) }
break;
}
- FX_INT32 count = buffer.GetLength();
+ int32_t count = buffer.GetLength();
if ((count % 3) == 0) {
- FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
+ int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(newMode);
break;
@@ -91,16 +91,16 @@ void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext &context, CFX_WideStrin context.writeCodewords(encodeToCodewords(buffer, 0));
buffer.Delete(0, 3);
}
-void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e)
+void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e)
{
- FX_INT32 unwritten = (buffer.GetLength() / 3) * 2;
- FX_INT32 rest = buffer.GetLength() % 3;
- FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten;
+ int32_t unwritten = (buffer.GetLength() / 3) * 2;
+ int32_t rest = buffer.GetLength() % 3;
+ int32_t curCodewordCount = context.getCodewordCount() + unwritten;
context.updateSymbolInfo(curCodewordCount, e);
if (e != BCExceptionNO) {
return;
}
- FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount;
+ int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount;
if (rest == 2) {
buffer += (FX_WCHAR)'\0';
while (buffer.GetLength() >= 3) {
@@ -130,7 +130,7 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff }
context.signalEncoderChange(ASCII_ENCODATION);
}
-FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e)
+int32_t CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e)
{
if (c == ' ') {
sb += (FX_WCHAR)'\3';
@@ -164,7 +164,7 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) } else if (c >= 80) {
sb += (FX_WCHAR)'\1';
sb += (FX_WCHAR)0x001e;
- FX_INT32 len = 2;
+ int32_t len = 2;
len += encodeChar((c - 128), sb, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
return len;
@@ -173,9 +173,9 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) return 0;
}
}
-FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e)
+int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e)
{
- FX_INT32 count = buffer.GetLength();
+ int32_t count = buffer.GetLength();
buffer.Delete(count - lastCharSize, count);
context.m_pos--;
FX_WCHAR c = context.getCurrentChar();
@@ -184,12 +184,12 @@ FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_ context.resetSymbolInfo();
return lastCharSize;
}
-CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos)
+CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, int32_t startPos)
{
FX_WCHAR c1 = sb.GetAt(startPos);
FX_WCHAR c2 = sb.GetAt(startPos + 1);
FX_WCHAR c3 = sb.GetAt(startPos + 2);
- FX_INT32 v = (1600 * c1) + (40 * c2) + c3 + 1;
+ int32_t v = (1600 * c1) + (40 * c2) + c3 + 1;
FX_WCHAR cw1 = (FX_WCHAR) (v / 256);
FX_WCHAR cw2 = (FX_WCHAR) (v % 256);
CFX_WideString b1(cw1);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h index 7f2d2f7e79..2ab7f4e29b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h @@ -12,13 +12,13 @@ class CBC_C40Encoder : public CBC_Encoder public:
CBC_C40Encoder();
virtual ~CBC_C40Encoder();
- virtual FX_INT32 getEncodingMode();
- virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ virtual int32_t getEncodingMode();
+ virtual void Encode(CBC_EncoderContext &context, int32_t &e);
static void writeNextTriplet(CBC_EncoderContext &context, CFX_WideString &buffer);
- virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e);
- virtual FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+ virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e);
+ virtual int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e);
private:
- FX_INT32 backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e);
- static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos);
+ int32_t backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e);
+ static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp index cfb676b0a7..4fb82f1034 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp @@ -30,9 +30,9 @@ CBC_DataMatrixBitMatrixParser::CBC_DataMatrixBitMatrixParser() m_version = NULL;
m_readMappingMatrix = NULL;
}
-void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e)
+void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e)
{
- FX_INT32 dimension = bitMatrix->GetHeight();
+ int32_t dimension = bitMatrix->GetHeight();
if (dimension < 8 || dimension > 144 || (dimension & 0x01) != 0) {
e = BCExceptionFormatException;
return;
@@ -59,45 +59,45 @@ CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::GetVersion() {
return m_version;
}
-CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e)
+CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e)
{
- FX_INT32 rows = bitMatrix->GetHeight();
- FX_INT32 columns = bitMatrix->GetWidth();
+ int32_t rows = bitMatrix->GetHeight();
+ int32_t columns = bitMatrix->GetWidth();
CBC_DataMatrixVersion *temp = CBC_DataMatrixVersion::GetVersionForDimensions(rows, columns, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e)
+CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(int32_t &e)
{
CBC_AutoPtr<CFX_ByteArray> result(FX_NEW CFX_ByteArray());
result->SetSize(m_version->GetTotalCodewords());
- FX_INT32 resultOffset = 0;
- FX_INT32 row = 4;
- FX_INT32 column = 0;
- FX_INT32 numRows = m_mappingBitMatrix->GetHeight();
- FX_INT32 numColumns = m_mappingBitMatrix->GetWidth();
+ int32_t resultOffset = 0;
+ int32_t row = 4;
+ int32_t column = 0;
+ int32_t numRows = m_mappingBitMatrix->GetHeight();
+ int32_t numColumns = m_mappingBitMatrix->GetWidth();
FX_BOOL corner1Read = FALSE;
FX_BOOL corner2Read = FALSE;
FX_BOOL corner3Read = FALSE;
FX_BOOL corner4Read = FALSE;
do {
if ((row == numRows) && (column == 0) && !corner1Read) {
- (*result)[resultOffset++] = (FX_BYTE) ReadCorner1(numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadCorner1(numRows, numColumns);
row -= 2;
column += 2;
corner1Read = TRUE;
} else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) {
- (*result)[resultOffset++] = (FX_BYTE) ReadCorner2(numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadCorner2(numRows, numColumns);
row -= 2;
column += 2;
corner2Read = TRUE;
} else if ((row == numRows + 4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) {
- (*result)[resultOffset++] = (FX_BYTE) ReadCorner3(numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadCorner3(numRows, numColumns);
row -= 2;
column += 2;
corner3Read = TRUE;
} else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) {
- (*result)[resultOffset++] = (FX_BYTE) ReadCorner4(numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadCorner4(numRows, numColumns);
row -= 2;
column += 2;
corner4Read = TRUE;
@@ -105,7 +105,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do {
if ((row < numRows) && (column >= 0) && !m_readMappingMatrix->Get(column, row)) {
if (resultOffset < (*result).GetSize() ) {
- (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns);
}
}
row -= 2;
@@ -116,7 +116,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do {
if ((row >= 0) && (column < numColumns) && !m_readMappingMatrix->Get(column, row)) {
if (resultOffset < (*result).GetSize() ) {
- (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns);
+ (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns);
}
}
row += 2;
@@ -132,7 +132,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) }
return result.release();
}
-FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns)
+FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns)
{
if (row < 0) {
row += numRows;
@@ -145,9 +145,9 @@ FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, m_readMappingMatrix->Set(column, row);
return m_mappingBitMatrix->Get(column, row);
}
-FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns)
+int32_t CBC_DataMatrixBitMatrixParser::ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns)
{
- FX_INT32 currentByte = 0;
+ int32_t currentByte = 0;
if (ReadModule(row - 2, column - 2, numRows, numColumns)) {
currentByte |= 1;
}
@@ -181,9 +181,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, }
return currentByte;
}
-FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns)
+int32_t CBC_DataMatrixBitMatrixParser::ReadCorner1(int32_t numRows, int32_t numColumns)
{
- FX_INT32 currentByte = 0;
+ int32_t currentByte = 0;
if (ReadModule(numRows - 1, 0, numRows, numColumns)) {
currentByte |= 1;
}
@@ -217,9 +217,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 n }
return currentByte;
}
-FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns)
+int32_t CBC_DataMatrixBitMatrixParser::ReadCorner2(int32_t numRows, int32_t numColumns)
{
- FX_INT32 currentByte = 0;
+ int32_t currentByte = 0;
if (ReadModule(numRows - 3, 0, numRows, numColumns)) {
currentByte |= 1;
}
@@ -253,9 +253,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 n }
return currentByte;
}
-FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns)
+int32_t CBC_DataMatrixBitMatrixParser::ReadCorner3(int32_t numRows, int32_t numColumns)
{
- FX_INT32 currentByte = 0;
+ int32_t currentByte = 0;
if (ReadModule(numRows - 1, 0, numRows, numColumns)) {
currentByte |= 1;
}
@@ -289,9 +289,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 n }
return currentByte;
}
-FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns)
+int32_t CBC_DataMatrixBitMatrixParser::ReadCorner4(int32_t numRows, int32_t numColumns)
{
- FX_INT32 currentByte = 0;
+ int32_t currentByte = 0;
if (ReadModule(numRows - 3, 0, numRows, numColumns)) {
currentByte |= 1;
}
@@ -325,37 +325,37 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 n }
return currentByte;
}
-CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , FX_INT32 &e)
+CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , int32_t &e)
{
- FX_INT32 symbolSizeRows = m_version->GetSymbolSizeRows();
- FX_INT32 symbolSizeColumns = m_version->GetSymbolSizeColumns();
+ int32_t symbolSizeRows = m_version->GetSymbolSizeRows();
+ int32_t symbolSizeColumns = m_version->GetSymbolSizeColumns();
if (bitMatrix->GetHeight() != symbolSizeRows) {
e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix;
return NULL;
}
- FX_INT32 dataRegionSizeRows = m_version->GetDataRegionSizeRows();
- FX_INT32 dataRegionSizeColumns = m_version->GetDataRegionSizeColumns();
- FX_INT32 numDataRegionsRow = symbolSizeRows / dataRegionSizeRows;
- FX_INT32 numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns;
- FX_INT32 sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows;
- FX_INT32 sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns;
+ int32_t dataRegionSizeRows = m_version->GetDataRegionSizeRows();
+ int32_t dataRegionSizeColumns = m_version->GetDataRegionSizeColumns();
+ int32_t numDataRegionsRow = symbolSizeRows / dataRegionSizeRows;
+ int32_t numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns;
+ int32_t sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows;
+ int32_t sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns;
CBC_CommonBitMatrix *bitMatrixWithoutAlignment = FX_NEW CBC_CommonBitMatrix();
bitMatrixWithoutAlignment->Init(sizeDataRegionColumn, sizeDataRegionRow);
- FX_INT32 dataRegionRow;
+ int32_t dataRegionRow;
for (dataRegionRow = 0; dataRegionRow < numDataRegionsRow; ++dataRegionRow) {
- FX_INT32 dataRegionRowOffset = dataRegionRow * dataRegionSizeRows;
- FX_INT32 dataRegionColumn;
+ int32_t dataRegionRowOffset = dataRegionRow * dataRegionSizeRows;
+ int32_t dataRegionColumn;
for (dataRegionColumn = 0; dataRegionColumn < numDataRegionsColumn; ++dataRegionColumn) {
- FX_INT32 dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns;
- FX_INT32 i;
+ int32_t dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns;
+ int32_t i;
for (i = 0; i < dataRegionSizeRows; ++i) {
- FX_INT32 readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i;
- FX_INT32 writeRowOffset = dataRegionRowOffset + i;
- FX_INT32 j;
+ int32_t readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i;
+ int32_t writeRowOffset = dataRegionRowOffset + i;
+ int32_t j;
for (j = 0; j < dataRegionSizeColumns; ++j) {
- FX_INT32 readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j;
+ int32_t readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j;
if (bitMatrix->Get(readColumnOffset, readRowOffset)) {
- FX_INT32 writeColumnOffset = dataRegionColumnOffset + j;
+ int32_t writeColumnOffset = dataRegionColumnOffset + j;
bitMatrixWithoutAlignment->Set(writeColumnOffset, writeRowOffset);
}
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h index 812aa6424f..da9fdc7db5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h @@ -14,17 +14,17 @@ public: CBC_DataMatrixBitMatrixParser();
virtual ~CBC_DataMatrixBitMatrixParser();
CBC_DataMatrixVersion *GetVersion();
- CFX_ByteArray *ReadCodewords(FX_INT32 &e);
- FX_BOOL ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns);
- FX_INT32 ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns);
- FX_INT32 ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns);
- FX_INT32 ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns);
- FX_INT32 ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns);
- FX_INT32 ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns);
- CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
- virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+ CFX_ByteArray *ReadCodewords(int32_t &e);
+ FX_BOOL ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns);
+ int32_t ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns);
+ int32_t ReadCorner1(int32_t numRows, int32_t numColumns);
+ int32_t ReadCorner2(int32_t numRows, int32_t numColumns);
+ int32_t ReadCorner3(int32_t numRows, int32_t numColumns);
+ int32_t ReadCorner4(int32_t numRows, int32_t numColumns);
+ CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, int32_t &e);
+ virtual void Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e);
private:
- static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+ static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e);
CBC_CommonBitMatrix *m_mappingBitMatrix;
CBC_CommonBitMatrix *m_readMappingMatrix;
CBC_DataMatrixVersion *m_version;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp index c884834fa9..fcf2804ef2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp @@ -26,40 +26,40 @@ CBC_DataMatrixDataBlock::~CBC_DataMatrixDataBlock()
{
}
-CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords)
+CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords)
{
m_codewords.Copy(*codewords);
m_numDataCodewords = numDataCodewords;
}
-CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e)
+CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e)
{
ECBlocks *ecBlocks = version->GetECBlocks();
- FX_INT32 totalBlocks = 0;
+ int32_t totalBlocks = 0;
const CFX_PtrArray &ecBlockArray = ecBlocks->GetECBlocks();
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < ecBlockArray.GetSize(); i++) {
totalBlocks += ((ECB*)ecBlockArray[i])->GetCount();
}
CBC_AutoPtr<CFX_PtrArray>result(FX_NEW CFX_PtrArray());
result->SetSize(totalBlocks);
- FX_INT32 numResultBlocks = 0;
- FX_INT32 j;
+ int32_t numResultBlocks = 0;
+ int32_t j;
for (j = 0; j < ecBlockArray.GetSize(); j++) {
for (i = 0; i < ((ECB*)ecBlockArray[j])->GetCount(); i++) {
- FX_INT32 numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords();
- FX_INT32 numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords;
+ int32_t numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords();
+ int32_t numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords;
CFX_ByteArray codewords;
codewords.SetSize(numBlockCodewords);
(*result)[numResultBlocks++] = FX_NEW CBC_DataMatrixDataBlock(numDataCodewords, &codewords);
codewords.SetSize(0);
}
}
- FX_INT32 longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize();
- FX_INT32 longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords();
- FX_INT32 shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1;
- FX_INT32 rawCodewordsOffset = 0;
+ int32_t longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize();
+ int32_t longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords();
+ int32_t shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1;
+ int32_t rawCodewordsOffset = 0;
for (i = 0; i < shorterBlocksNumDataCodewords; i++) {
- FX_INT32 j;
+ int32_t j;
for (j = 0; j < numResultBlocks; j++) {
if (rawCodewordsOffset < rawCodewords->GetSize()) {
((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](i) = (*rawCodewords)[rawCodewordsOffset++];
@@ -67,17 +67,17 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords }
}
FX_BOOL specialVersion = version->GetVersionNumber() == 24;
- FX_INT32 numLongerBlocks = specialVersion ? 8 : numResultBlocks;
+ int32_t numLongerBlocks = specialVersion ? 8 : numResultBlocks;
for (j = 0; j < numLongerBlocks; j++) {
if (rawCodewordsOffset < rawCodewords->GetSize()) {
((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](longerBlocksNumDataCodewords - 1) = (*rawCodewords)[rawCodewordsOffset++];
}
}
- FX_INT32 max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize();
+ int32_t max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize();
for (i = longerBlocksNumDataCodewords; i < max; i++) {
- FX_INT32 j;
+ int32_t j;
for (j = 0; j < numResultBlocks; j++) {
- FX_INT32 iOffset = specialVersion && j > 7 ? i - 1 : i;
+ int32_t iOffset = specialVersion && j > 7 ? i - 1 : i;
if (rawCodewordsOffset < rawCodewords->GetSize()) {
((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](iOffset) = (*rawCodewords)[rawCodewordsOffset++];
}
@@ -89,7 +89,7 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords }
return result.release();
}
-FX_INT32 CBC_DataMatrixDataBlock::GetNumDataCodewords()
+int32_t CBC_DataMatrixDataBlock::GetNumDataCodewords()
{
return m_numDataCodewords;
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h index d0f4af036e..21be66549c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h @@ -12,14 +12,14 @@ class CBC_DataMatrixDataBlock public:
virtual ~CBC_DataMatrixDataBlock();
- FX_INT32 GetNumDataCodewords();
+ int32_t GetNumDataCodewords();
CFX_ByteArray* GetCodewords();
- static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e);
+ static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e);
private:
- FX_INT32 m_numDataCodewords;
+ int32_t m_numDataCodewords;
CFX_ByteArray m_codewords;
- CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords);
+ CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp index e934d9313d..07393c0fec 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp @@ -42,26 +42,26 @@ const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (FX_CHAR) 127
};
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5;
-const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5;
+const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6;
CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser()
{
}
CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser()
{
}
-CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, FX_INT32 &e)
+CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, int32_t &e)
{
CBC_CommonBitSource bits(&bytes);
CFX_ByteString result;
CFX_ByteString resultTrailer;
CFX_Int32Array byteSegments;
- FX_INT32 mode = ASCII_ENCODE;
+ int32_t mode = ASCII_ENCODE;
do {
if (mode == 1) {
mode = DecodeAsciiSegment(&bits, result, resultTrailer, e);
@@ -104,12 +104,12 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteAr BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return tempCp;
}
-FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e)
+int32_t CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e)
{
FX_CHAR buffer[128];
FX_BOOL upperShift = FALSE;
do {
- FX_INT32 oneByte = bits->ReadBits(8, e);
+ int32_t oneByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
if (oneByte == 0) {
e = BCExceptionFormatException;
@@ -122,7 +122,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } else if (oneByte == 129) {
return PAD_ENCODE;
} else if (oneByte <= 229) {
- FX_INT32 value = oneByte - 130;
+ int32_t value = oneByte - 130;
#if defined(_FX_WINAPI_PARTITION_APP_)
memset(buffer, 0, sizeof(FX_CHAR) * 128);
_itoa_s(value, buffer, 128, 10);
@@ -174,7 +174,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } while (bits->Available() > 0);
return ASCII_ENCODE;
}
-void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e)
+void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e)
{
FX_BOOL upperShift = FALSE;
CFX_Int32Array cValues;
@@ -183,18 +183,18 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource if (bits->Available() == 8) {
return;
}
- FX_INT32 firstByte = bits->ReadBits(8, e);
+ int32_t firstByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if (firstByte == 254) {
return;
}
- FX_INT32 tempp = bits->ReadBits(8, e);
+ int32_t tempp = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
ParseTwoBytes(firstByte, tempp, cValues);
- FX_INT32 shift = 0;
- FX_INT32 i;
+ int32_t shift = 0;
+ int32_t i;
for (i = 0; i < 3; i++) {
- FX_INT32 cValue = cValues[i];
+ int32_t cValue = cValues[i];
switch (shift) {
case 0:
if (cValue < 3) {
@@ -258,26 +258,26 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource }
} while (bits->Available() > 0);
}
-void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e)
+void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e)
{
FX_BOOL upperShift = FALSE;
CFX_Int32Array cValues;
cValues.SetSize(3);
- FX_INT32 shift = 0;
+ int32_t shift = 0;
do {
if (bits->Available() == 8) {
return;
}
- FX_INT32 firstByte = bits->ReadBits(8, e);
+ int32_t firstByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if (firstByte == 254) {
return;
}
- FX_INT32 inTp = bits->ReadBits(8, e);
+ int32_t inTp = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
ParseTwoBytes(firstByte, inTp, cValues);
- for (FX_INT32 i = 0; i < 3; i++) {
- FX_INT32 cValue = cValues[i];
+ for (int32_t i = 0; i < 3; i++) {
+ int32_t cValue = cValues[i];
switch (shift) {
case 0:
if (cValue < 3) {
@@ -347,7 +347,7 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource }
} while (bits->Available() > 0);
}
-void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e)
+void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e)
{
CFX_Int32Array cValues;
cValues.SetSize(3);
@@ -355,17 +355,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou if (bits->Available() == 8) {
return;
}
- FX_INT32 firstByte = bits->ReadBits(8, e);
+ int32_t firstByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if (firstByte == 254) {
return;
}
- FX_INT32 iTemp1 = bits->ReadBits(8, e);
+ int32_t iTemp1 = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
ParseTwoBytes(firstByte, iTemp1, cValues);
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < 3; i++) {
- FX_INT32 cValue = cValues[i];
+ int32_t cValue = cValues[i];
if (cValue == 0) {
BC_FX_ByteString_Append(result, 1, '\r');
} else if (cValue == 1) {
@@ -385,17 +385,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou }
} while (bits->Available() > 0);
}
-void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result)
+void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result)
{
- FX_INT32 fullBitValue = (firstByte << 8) + secondByte - 1;
- FX_INT32 temp = fullBitValue / 1600;
+ int32_t fullBitValue = (firstByte << 8) + secondByte - 1;
+ int32_t temp = fullBitValue / 1600;
result[0] = temp;
fullBitValue -= temp * 1600;
temp = fullBitValue / 40;
result[1] = temp;
result[2] = fullBitValue - temp * 40;
}
-void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e)
+void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e)
{
FX_CHAR buffer[128];
FX_BOOL unlatch = FALSE;
@@ -403,9 +403,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou if (bits->Available() <= 16) {
return;
}
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < 4; i++) {
- FX_INT32 edifactValue = bits->ReadBits(6, e);
+ int32_t edifactValue = bits->ReadBits(6, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if (edifactValue == 0x1F) {
unlatch = TRUE;
@@ -425,19 +425,19 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou }
} while (!unlatch && bits->Available() > 0);
}
-void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e)
+void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e)
{
- FX_INT32 codewordPosition = 1 + bits->getByteOffset();
- FX_INT32 iTmp = bits->ReadBits(8, e);
+ int32_t codewordPosition = 1 + bits->getByteOffset();
+ int32_t iTmp = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 d1 = Unrandomize255State(iTmp, codewordPosition++);
- FX_INT32 count;
+ int32_t d1 = Unrandomize255State(iTmp, codewordPosition++);
+ int32_t count;
if (d1 == 0) {
count = bits->Available() / 8;
} else if (d1 < 250) {
count = d1;
} else {
- FX_INT32 iTmp3 = bits->ReadBits(8, e);
+ int32_t iTmp3 = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
count = 250 * (d1 - 249) + Unrandomize255State(iTmp3, codewordPosition++);
}
@@ -447,14 +447,14 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou }
CFX_ByteArray *bytes = FX_NEW CFX_ByteArray();
bytes->SetSize(count);
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < count; i++) {
if (bits->Available() < 8) {
e = BCExceptionFormatException;
delete bytes;
return;
}
- FX_INT32 iTemp5 = bits->ReadBits(8, e);
+ int32_t iTemp5 = bits->ReadBits(8, e);
if (e != BCExceptionNO) {
delete bytes;
return;
@@ -464,9 +464,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou BC_FX_ByteString_Append(result, *bytes);
delete bytes;
}
-FX_BYTE CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition)
+uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition)
{
- FX_INT32 pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1;
- FX_INT32 tempVariable = randomizedBase256Codeword - pseudoRandomNumber;
- return (FX_BYTE) (tempVariable >= 0 ? tempVariable : tempVariable + 256);
+ int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1;
+ int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber;
+ return (uint8_t) (tempVariable >= 0 ? tempVariable : tempVariable + 256);
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h index 45db800176..4fa5407fb5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h @@ -13,17 +13,17 @@ class CBC_DataMatrixDecodedBitStreamParser public:
CBC_DataMatrixDecodedBitStreamParser();
virtual ~CBC_DataMatrixDecodedBitStreamParser();
- static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, FX_INT32 &e);
+ static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, int32_t &e);
private:
- static FX_INT32 DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e);
- static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
- static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
- static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
- static void ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result);
- static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
- static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e);
- static FX_BYTE Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition);
+ static int32_t DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e);
+ static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e);
+ static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e);
+ static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e);
+ static void ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result);
+ static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e);
+ static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e);
+ static uint8_t Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition);
const static FX_CHAR C40_BASIC_SET_CHARS[];
const static FX_CHAR C40_SHIFT2_SET_CHARS[];
@@ -31,12 +31,12 @@ private: const static FX_CHAR TEXT_BASIC_SET_CHARS[];
const static FX_CHAR TEXT_SHIFT3_SET_CHARS[];
- const static FX_INT32 PAD_ENCODE;
- const static FX_INT32 ASCII_ENCODE;
- const static FX_INT32 C40_ENCODE;
- const static FX_INT32 TEXT_ENCODE;
- const static FX_INT32 ANSIX12_ENCODE;
- const static FX_INT32 EDIFACT_ENCODE;
- const static FX_INT32 BASE256_ENCODE;
+ const static int32_t PAD_ENCODE;
+ const static int32_t ASCII_ENCODE;
+ const static int32_t C40_ENCODE;
+ const static int32_t TEXT_ENCODE;
+ const static int32_t ANSIX12_ENCODE;
+ const static int32_t EDIFACT_ENCODE;
+ const static int32_t BASE256_ENCODE;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp index e9eb32cf84..8dfdea81c1 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixDecoder::~CBC_DataMatrixDecoder() }
m_rsDecoder = NULL;
}
-CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e)
+CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, int32_t &e)
{
CBC_DataMatrixBitMatrixParser parser;
parser.Init(bits, e);
@@ -55,9 +55,9 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits CBC_AutoPtr<CFX_ByteArray> codewords(byteTemp);
CFX_PtrArray *dataBlocks = CBC_DataMatrixDataBlock::GetDataBlocks(codewords.get(), version, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 dataBlocksCount = dataBlocks->GetSize();
- FX_INT32 totalBytes = 0;
- FX_INT32 i, j;
+ int32_t dataBlocksCount = dataBlocks->GetSize();
+ int32_t totalBytes = 0;
+ int32_t i, j;
for (i = 0; i < dataBlocksCount; i++) {
totalBytes += ((CBC_DataMatrixDataBlock*)(*dataBlocks)[i])->GetNumDataCodewords();
}
@@ -65,17 +65,17 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits resultBytes.SetSize(totalBytes);
for (j = 0; j < dataBlocksCount; j++) {
CFX_ByteArray *codewordBytes = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetCodewords();
- FX_INT32 numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords();
+ int32_t numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords();
CorrectErrors(*codewordBytes, numDataCodewords, e);
if (e != BCExceptionNO) {
- for(FX_INT32 i = 0; i < dataBlocks->GetSize(); i++) {
+ for(int32_t i = 0; i < dataBlocks->GetSize(); i++) {
delete (CBC_DataMatrixDataBlock*)(*dataBlocks)[i];
}
delete dataBlocks;
dataBlocks = NULL;
return NULL;
}
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < numDataCodewords; i++) {
resultBytes[i * dataBlocksCount + j] = (*codewordBytes)[i];
}
@@ -89,22 +89,22 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return resultR;
}
-void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e)
+void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e)
{
- FX_INT32 numCodewords = codewordBytes.GetSize();
+ int32_t numCodewords = codewordBytes.GetSize();
CFX_Int32Array codewordsInts;
codewordsInts.SetSize(numCodewords);
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < numCodewords; i++) {
codewordsInts[i] = codewordBytes[i] & 0xFF;
}
- FX_INT32 numECCodewords = codewordBytes.GetSize() - numDataCodewords;
+ int32_t numECCodewords = codewordBytes.GetSize() - numDataCodewords;
m_rsDecoder->Decode(&codewordsInts, numECCodewords, e);
if (e != BCExceptionNO) {
e = BCExceptionChecksumException;
return ;
}
for (i = 0; i < numDataCodewords; i++) {
- codewordBytes[i] = (FX_BYTE) codewordsInts[i];
+ codewordBytes[i] = (uint8_t) codewordsInts[i];
}
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h index 1d6059379b..d4d2cc7bb9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h @@ -14,10 +14,10 @@ class CBC_DataMatrixDecoder public:
CBC_DataMatrixDecoder();
virtual ~CBC_DataMatrixDecoder();
- CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e);
+ CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, int32_t &e);
virtual void Init();
private:
- void CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e);
+ void CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e);
CBC_ReedSolomonDecoder *m_rsDecoder;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp index 12877c5c3a..bdcbc4c418 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp @@ -28,12 +28,12 @@ #include "../qrcode/BC_QRDetectorResult.h"
#include "../qrcode/BC_QRGridSampler.h"
#include "BC_DataMatrixDetector.h"
-const FX_INT32 CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4};
+const int32_t CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4};
CBC_DataMatrixDetector::CBC_DataMatrixDetector(CBC_CommonBitMatrix *image):
m_image(image), m_rectangleDetector(NULL)
{
}
-void CBC_DataMatrixDetector::Init(FX_INT32 &e)
+void CBC_DataMatrixDetector::Init(int32_t &e)
{
m_rectangleDetector = FX_NEW CBC_WhiteRectangleDetector(m_image);
m_rectangleDetector->Init(e);
@@ -50,7 +50,7 @@ inline FX_BOOL ResultPointsAndTransitionsComparator(FX_LPVOID a, FX_LPVOID b) {
return ((CBC_ResultPointsAndTransitions *)b)->GetTransitions() > ((CBC_ResultPointsAndTransitions *)a)->GetTransitions();
}
-CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e)
+CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(int32_t &e)
{
CFX_PtrArray* cornerPoints = m_rectangleDetector->Detect(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -70,7 +70,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete ( (CBC_ResultPointsAndTransitions *)transitions[3] );
CBC_ResultPointsAndTransitions *lSideOne = (CBC_ResultPointsAndTransitions*)transitions[0];
CBC_ResultPointsAndTransitions *lSideTwo = (CBC_ResultPointsAndTransitions*)transitions[1];
- CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> pointCount;
+ CFX_MapPtrTemplate<CBC_ResultPoint*, int32_t> pointCount;
Increment(pointCount, lSideOne->GetFrom());
Increment(pointCount, lSideOne->GetTo());
Increment(pointCount, lSideTwo->GetFrom());
@@ -84,7 +84,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) FX_POSITION itBegin = pointCount.GetStartPosition();
while(itBegin != NULL) {
CBC_ResultPoint *key = 0;
- FX_INT32 value = 0;
+ int32_t value = 0;
pointCount.GetNextAssoc(itBegin, key, value);
if(value == 2) {
bottomLeft = key;
@@ -114,7 +114,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) bottomLeft = (CBC_ResultPoint*)corners[1];
CBC_ResultPoint *topLeft = (CBC_ResultPoint*)corners[2];
CBC_ResultPoint *topRight = NULL;
- FX_INT32 value;
+ int32_t value;
if (!pointCount.Lookup(pointA, value)) {
topRight = pointA;
} else if (!pointCount.Lookup(pointB, value)) {
@@ -124,8 +124,8 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) } else {
topRight = pointD;
}
- FX_INT32 dimensionTop = CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, topRight))->GetTransitions();
- FX_INT32 dimensionRight = CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, topRight))->GetTransitions();
+ int32_t dimensionTop = CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, topRight))->GetTransitions();
+ int32_t dimensionRight = CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, topRight))->GetTransitions();
if ((dimensionTop & 0x01) == 1) {
dimensionTop++;
}
@@ -158,7 +158,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) correctedTopRight.get(), dimensionTop, dimensionRight, e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
} else {
- FX_INT32 dimension = FX_MIN(dimensionRight, dimensionTop);
+ int32_t dimension = FX_MIN(dimensionRight, dimensionTop);
correctedTopRight = CBC_AutoPtr<CBC_ResultPoint>(CorrectTopRight(bottomLeft, bottomRight,
topLeft, topRight, dimension));
if (correctedTopRight.get() == NULL) {
@@ -167,7 +167,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete topRight;
topRight = NULL;
}
- FX_INT32 dimensionCorrected = FX_MAX(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(),
+ int32_t dimensionCorrected = FX_MAX(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(),
CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, correctedTopRight.get()))->GetTransitions());
dimensionCorrected++;
if ((dimensionCorrected & 0x01) == 1) {
@@ -190,10 +190,10 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) result->Add(correctedTopRight.release());
return FX_NEW CBC_QRDetectorResult(bits.release(), result);
}
-CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimensionTop, FX_INT32 dimensionRight)
+CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimensionTop, int32_t dimensionRight)
{
FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT)dimensionTop;
- FX_INT32 norm = Distance(topLeft, topRight);
+ int32_t norm = Distance(topLeft, topRight);
FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm;
FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm;
CBC_AutoPtr<CBC_ResultPoint> c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin));
@@ -210,19 +210,19 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPo } else if (!IsValid(c2.get())) {
return c1.release();
}
- FX_INT32 l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) +
+ int32_t l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) +
FXSYS_abs(dimensionRight - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, c1.get()))->GetTransitions());
- FX_INT32 l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) +
+ int32_t l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) +
FXSYS_abs(dimensionRight - CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, c2.get()))->GetTransitions());
if (l1 <= l2) {
return c1.release();
}
return c2.release();
}
-CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimension)
+CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimension)
{
FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT) dimension;
- FX_INT32 norm = Distance(topLeft, topRight);
+ int32_t norm = Distance(topLeft, topRight);
FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm;
FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm;
CBC_AutoPtr<CBC_ResultPoint> c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin));
@@ -239,9 +239,9 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottom } else if (!IsValid(c2.get())) {
return c1.release();
}
- FX_INT32 l1 = FXSYS_abs(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c1.get()))->GetTransitions() -
+ int32_t l1 = FXSYS_abs(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c1.get()))->GetTransitions() -
CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, c1.get()))->GetTransitions());
- FX_INT32 l2 = FXSYS_abs(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c2.get()))->GetTransitions() -
+ int32_t l2 = FXSYS_abs(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(topLeft, c2.get()))->GetTransitions() -
CBC_AutoPtr<CBC_ResultPointsAndTransitions>(TransitionsBetween(bottomRight, c2.get()))->GetTransitions());
return l1 <= l2 ? c1.release() : c2.release();
}
@@ -249,19 +249,19 @@ FX_BOOL CBC_DataMatrixDetector::IsValid(CBC_ResultPoint *p) {
return p->GetX() >= 0 && p->GetX() < m_image->GetWidth() && p->GetY() > 0 && p->GetY() < m_image->GetHeight();
}
-FX_INT32 CBC_DataMatrixDetector::Round(FX_FLOAT d)
+int32_t CBC_DataMatrixDetector::Round(FX_FLOAT d)
{
- return (FX_INT32) (d + 0.5f);
+ return (int32_t) (d + 0.5f);
}
-FX_INT32 CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b)
+int32_t CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b)
{
return Round((FX_FLOAT) sqrt((a->GetX() - b->GetX())
* (a->GetX() - b->GetX()) + (a->GetY() - b->GetY())
* (a->GetY() - b->GetY())));
}
-void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> &table, CBC_ResultPoint *key)
+void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, int32_t> &table, CBC_ResultPoint *key)
{
- FX_INT32 value;
+ int32_t value;
if(table.Lookup(key, value)) {
table.SetAt(key, INTEGERS[value + 1]);
} else {
@@ -273,7 +273,7 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima CBC_ResultPoint *bottomLeft,
CBC_ResultPoint *bottomRight,
CBC_ResultPoint *topRight,
- FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e)
+ int32_t dimensionX, int32_t dimensionY, int32_t &e)
{
CBC_QRGridSampler &sampler = CBC_QRGridSampler::GetInstance();
CBC_CommonBitMatrix* cbm = sampler.SampleGrid(image,
@@ -300,27 +300,27 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima }
CBC_ResultPointsAndTransitions *CBC_DataMatrixDetector::TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to)
{
- FX_INT32 fromX = (FX_INT32) from->GetX();
- FX_INT32 fromY = (FX_INT32) from->GetY();
- FX_INT32 toX = (FX_INT32) to->GetX();
- FX_INT32 toY = (FX_INT32) to->GetY();
+ int32_t fromX = (int32_t) from->GetX();
+ int32_t fromY = (int32_t) from->GetY();
+ int32_t toX = (int32_t) to->GetX();
+ int32_t toY = (int32_t) to->GetY();
FX_BOOL steep = FXSYS_abs(toY - fromY) > FXSYS_abs(toX - fromX);
if (steep) {
- FX_INT32 temp = fromX;
+ int32_t temp = fromX;
fromX = fromY;
fromY = temp;
temp = toX;
toX = toY;
toY = temp;
}
- FX_INT32 dx = FXSYS_abs(toX - fromX);
- FX_INT32 dy = FXSYS_abs(toY - fromY);
- FX_INT32 error = -dx >> 1;
- FX_INT32 ystep = fromY < toY ? 1 : -1;
- FX_INT32 xstep = fromX < toX ? 1 : -1;
- FX_INT32 transitions = 0;
+ int32_t dx = FXSYS_abs(toX - fromX);
+ int32_t dy = FXSYS_abs(toY - fromY);
+ int32_t error = -dx >> 1;
+ int32_t ystep = fromY < toY ? 1 : -1;
+ int32_t xstep = fromX < toX ? 1 : -1;
+ int32_t transitions = 0;
FX_BOOL inBlack = m_image->Get(steep ? fromY : fromX, steep ? fromX : fromY);
- for (FX_INT32 x = fromX, y = fromY; x != toX; x += xstep) {
+ for (int32_t x = fromX, y = fromY; x != toX; x += xstep) {
FX_BOOL isBlack = m_image->Get(steep ? y : x, steep ? x : y);
if (isBlack != inBlack) {
transitions++;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h index a9e244c5f4..e36ef678cd 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h @@ -15,7 +15,7 @@ class ResultPointsAndTransitions; class CBC_ResultPointsAndTransitions
{
public:
- CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, FX_INT32 transitions)
+ CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, int32_t transitions)
{
m_from = from;
m_to = to;
@@ -32,47 +32,47 @@ public: {
return m_to;
}
- FX_INT32 GetTransitions()
+ int32_t GetTransitions()
{
return m_transitions;
}
private:
CBC_ResultPoint *m_from;
CBC_ResultPoint *m_to;
- FX_INT32 m_transitions;
+ int32_t m_transitions;
};
class CBC_DataMatrixDetector
{
public:
CBC_DataMatrixDetector(CBC_CommonBitMatrix *image);
virtual ~CBC_DataMatrixDetector();
- CBC_QRDetectorResult *Detect(FX_INT32 &e);
+ CBC_QRDetectorResult *Detect(int32_t &e);
CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft,
CBC_ResultPoint *bottomRight,
CBC_ResultPoint *topLeft,
CBC_ResultPoint *topRight,
- FX_INT32 dimensionTop, FX_INT32 dimensionRight);
+ int32_t dimensionTop, int32_t dimensionRight);
CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft,
CBC_ResultPoint *bottomRight,
CBC_ResultPoint *topLeft,
CBC_ResultPoint *topRight,
- FX_INT32 dimension);
+ int32_t dimension);
CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image,
CBC_ResultPoint *topLeft,
CBC_ResultPoint *bottomLeft,
CBC_ResultPoint *bottomRight,
CBC_ResultPoint *topRight,
- FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e);
+ int32_t dimensionX, int32_t dimensionY, int32_t &e);
CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to);
FX_BOOL IsValid(CBC_ResultPoint *p);
- FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b);
- void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> &table, CBC_ResultPoint *key);
- FX_INT32 Round(FX_FLOAT d);
+ int32_t Distance(CBC_ResultPoint *a, CBC_ResultPoint *b);
+ void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, int32_t> &table, CBC_ResultPoint *key);
+ int32_t Round(FX_FLOAT d);
void OrderBestPatterns(CFX_PtrArray *patterns);
- virtual void Init(FX_INT32 &e);
+ virtual void Init(int32_t &e);
private:
CBC_CommonBitMatrix *m_image;
CBC_WhiteRectangleDetector *m_rectangleDetector;
- const static FX_INT32 INTEGERS[5];
+ const static int32_t INTEGERS[5];
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index cf076cd313..1b9f55dc9f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixReader::~CBC_DataMatrixReader() }
m_decoder = NULL;
}
-CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
CBC_CommonBitMatrix *cdr = image->GetBlackMatrix(e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -59,7 +59,7 @@ CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hi CBC_AutoPtr<CBC_CommonDecoderResult> decodeResult(ResultTemp);
return decodeResult->GetText();
}
-CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e)
+CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t &e)
{
CFX_ByteString bs = Decode(image, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h index 4301512d70..6ba17a89e3 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h @@ -15,8 +15,8 @@ class CBC_DataMatrixReader : public CBC_Reader public:
CBC_DataMatrixReader();
virtual ~CBC_DataMatrixReader();
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, int32_t &e);
virtual void Init();
private:
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp index 256117883d..dfe0e11f1c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp @@ -33,11 +33,11 @@ CBC_DataMatrixSymbolInfo144::CBC_DataMatrixSymbolInfo144() : CBC_SymbolInfo(FALS CBC_DataMatrixSymbolInfo144::~CBC_DataMatrixSymbolInfo144()
{
}
-FX_INT32 CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount()
+int32_t CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount()
{
return 10;
}
-FX_INT32 CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(FX_INT32 index)
+int32_t CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(int32_t index)
{
return (index <= 8) ? 156 : 155;
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h index e749b27d86..2c13551145 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h @@ -13,7 +13,7 @@ class CBC_DataMatrixSymbolInfo144 : public CBC_SymbolInfo public:
CBC_DataMatrixSymbolInfo144();
virtual ~CBC_DataMatrixSymbolInfo144();
- FX_INT32 getInterleavedBlockCount();
- FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index);
+ int32_t getInterleavedBlockCount();
+ int32_t getDataLengthForInterleavedBlock(int32_t index);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp index 1a4e59864e..bbbf4bdee5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp @@ -29,17 +29,17 @@ void CBC_DataMatrixVersion::Initialize() }
void CBC_DataMatrixVersion::Finalize()
{
- for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) {
+ for (int32_t i = 0; i < VERSIONS->GetSize(); i++) {
delete ( (CBC_DataMatrixVersion*)(VERSIONS->GetAt(i)) );
}
VERSIONS->RemoveAll();
delete VERSIONS;
}
-CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber,
- FX_INT32 symbolSizeRows,
- FX_INT32 symbolSizeColumns,
- FX_INT32 dataRegionSizeRows,
- FX_INT32 dataRegionSizeColumns,
+CBC_DataMatrixVersion::CBC_DataMatrixVersion(int32_t versionNumber,
+ int32_t symbolSizeRows,
+ int32_t symbolSizeColumns,
+ int32_t dataRegionSizeRows,
+ int32_t dataRegionSizeColumns,
ECBlocks *ecBlocks)
{
m_versionNumber = versionNumber;
@@ -48,10 +48,10 @@ CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber, m_dataRegionSizeRows = dataRegionSizeRows;
m_dataRegionSizeColumns = dataRegionSizeColumns;
m_ecBlocks = ecBlocks;
- FX_INT32 total = 0;
- FX_INT32 ecCodewords = ecBlocks->GetECCodewords();
+ int32_t total = 0;
+ int32_t ecCodewords = ecBlocks->GetECCodewords();
const CFX_PtrArray &ecbArray = ecBlocks->GetECBlocks();
- for (FX_INT32 i = 0; i < ecbArray.GetSize(); i++) {
+ for (int32_t i = 0; i < ecbArray.GetSize(); i++) {
total += ((ECB*)ecbArray[i])->GetCount() * (((ECB*)ecbArray[i])->GetDataCodewords() + ecCodewords);
}
m_totalCodewords = total;
@@ -63,27 +63,27 @@ CBC_DataMatrixVersion::~CBC_DataMatrixVersion() }
m_ecBlocks = NULL;
}
-FX_INT32 CBC_DataMatrixVersion::GetVersionNumber()
+int32_t CBC_DataMatrixVersion::GetVersionNumber()
{
return m_versionNumber;
}
-FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeRows()
+int32_t CBC_DataMatrixVersion::GetSymbolSizeRows()
{
return m_symbolSizeRows;
}
-FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeColumns()
+int32_t CBC_DataMatrixVersion::GetSymbolSizeColumns()
{
return m_symbolSizeColumns;
}
-FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeRows()
+int32_t CBC_DataMatrixVersion::GetDataRegionSizeRows()
{
return m_dataRegionSizeRows;
}
-FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeColumns()
+int32_t CBC_DataMatrixVersion::GetDataRegionSizeColumns()
{
return m_dataRegionSizeColumns;
}
-FX_INT32 CBC_DataMatrixVersion::GetTotalCodewords()
+int32_t CBC_DataMatrixVersion::GetTotalCodewords()
{
return m_totalCodewords;
}
@@ -93,12 +93,12 @@ ECBlocks *CBC_DataMatrixVersion::GetECBlocks() }
void CBC_DataMatrixVersion::ReleaseAll()
{
- for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) {
+ for (int32_t i = 0; i < VERSIONS->GetSize(); i++) {
delete (CBC_DataMatrixVersion*)VERSIONS->GetAt(i);
}
VERSIONS->RemoveAll();
}
-CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e)
+CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e)
{
if ((numRows & 0x01) != 0 || (numColumns & 0x01) != 0) {
e = BCExceptionNotFound;
@@ -136,8 +136,8 @@ CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 n VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(29, 16, 36, 14, 16, FX_NEW ECBlocks(24, FX_NEW ECB(1, 32))));
VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(30, 16, 48, 14, 22, FX_NEW ECBlocks(28, FX_NEW ECB(1, 49))));
}
- FX_INT32 numVersions = VERSIONS->GetSize();
- for (FX_INT32 i = 0; i < numVersions; ++i) {
+ int32_t numVersions = VERSIONS->GetSize();
+ for (int32_t i = 0; i < numVersions; ++i) {
if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows == numRows && ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns == numColumns) {
return (CBC_DataMatrixVersion*)(*VERSIONS)[i];
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h index 9661834bd8..90f6509f0f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h @@ -11,35 +11,35 @@ class CBC_DataMatrixVersion; class ECB
{
public:
- ECB(FX_INT32 count, FX_INT32 dataCodewords)
+ ECB(int32_t count, int32_t dataCodewords)
{
m_count = count;
m_dataCodewords = dataCodewords;
}
- FX_INT32 GetCount()
+ int32_t GetCount()
{
return m_count;
}
- FX_INT32 GetDataCodewords()
+ int32_t GetDataCodewords()
{
return m_dataCodewords;
}
private:
- FX_INT32 m_count;
- FX_INT32 m_dataCodewords;
+ int32_t m_count;
+ int32_t m_dataCodewords;
};
class ECBlocks
{
public:
- ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks)
+ ECBlocks(int32_t ecCodewords, ECB *ecBlocks)
{
m_ecCodewords = ecCodewords;
m_ecBlocks.Add(ecBlocks);
}
- ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2)
+ ECBlocks(int32_t ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2)
{
m_ecCodewords = ecCodewords;
m_ecBlocks.Add(ecBlocks1);
@@ -47,13 +47,13 @@ public: }
~ECBlocks()
{
- for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) {
+ for(int32_t i = 0; i < m_ecBlocks.GetSize(); i++) {
delete (ECB*)m_ecBlocks[i];
}
m_ecBlocks.RemoveAll();
}
- FX_INT32 GetECCodewords()
+ int32_t GetECCodewords()
{
return m_ecCodewords;
}
@@ -63,38 +63,38 @@ public: return m_ecBlocks;
}
private:
- FX_INT32 m_ecCodewords;
+ int32_t m_ecCodewords;
CFX_PtrArray m_ecBlocks;
};
class CBC_DataMatrixVersion
{
public:
- CBC_DataMatrixVersion(FX_INT32 versionNumber,
- FX_INT32 symbolSizeRows,
- FX_INT32 symbolSizeColumns,
- FX_INT32 dataRegionSizeRows,
- FX_INT32 dataRegionSizeColumns,
+ CBC_DataMatrixVersion(int32_t versionNumber,
+ int32_t symbolSizeRows,
+ int32_t symbolSizeColumns,
+ int32_t dataRegionSizeRows,
+ int32_t dataRegionSizeColumns,
ECBlocks *ecBlocks);
virtual ~CBC_DataMatrixVersion();
static void Initialize();
static void Finalize();
- FX_INT32 GetVersionNumber();
- FX_INT32 GetSymbolSizeRows();
- FX_INT32 GetSymbolSizeColumns();
- FX_INT32 GetDataRegionSizeRows();
- FX_INT32 GetDataRegionSizeColumns();
- FX_INT32 GetTotalCodewords();
+ int32_t GetVersionNumber();
+ int32_t GetSymbolSizeRows();
+ int32_t GetSymbolSizeColumns();
+ int32_t GetDataRegionSizeRows();
+ int32_t GetDataRegionSizeColumns();
+ int32_t GetTotalCodewords();
ECBlocks *GetECBlocks();
- static CBC_DataMatrixVersion *GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e);
+ static CBC_DataMatrixVersion *GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e);
static void ReleaseAll();
private:
- FX_INT32 m_versionNumber;
- FX_INT32 m_symbolSizeRows;
- FX_INT32 m_symbolSizeColumns;
- FX_INT32 m_dataRegionSizeRows;
- FX_INT32 m_dataRegionSizeColumns;
+ int32_t m_versionNumber;
+ int32_t m_symbolSizeRows;
+ int32_t m_symbolSizeColumns;
+ int32_t m_dataRegionSizeRows;
+ int32_t m_dataRegionSizeColumns;
ECBlocks *m_ecBlocks;
- FX_INT32 m_totalCodewords;
+ int32_t m_totalCodewords;
static CFX_PtrArray* VERSIONS;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 652758a635..4bccdd0bf8 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -49,12 +49,12 @@ CBC_DataMatrixWriter::CBC_DataMatrixWriter() CBC_DataMatrixWriter::~CBC_DataMatrixWriter()
{
}
-FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (FX_INT32 level)
+FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (int32_t level)
{
m_iCorrectLevel = level;
return TRUE;
}
-FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
if (outWidth < 0 || outHeight < 0) {
e = BCExceptionHeightAndWidthMustBeAtLeast1;
@@ -77,42 +77,42 @@ FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 & BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
outWidth = bytematrix->GetWidth();
outHeight = bytematrix->GetHeight();
- FX_BYTE* result = FX_Alloc(FX_BYTE, outWidth * outHeight);
+ uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight);
FXSYS_memcpy32(result, bytematrix->GetArray(), outWidth * outHeight);
delete bytematrix;
delete placement;
return result;
}
-FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
return NULL;
}
-FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
return NULL;
}
-CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e)
+CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e)
{
- FX_INT32 symbolWidth = symbolInfo->getSymbolDataWidth(e);
+ int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 symbolHeight = symbolInfo->getSymbolDataHeight(e);
+ int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_CommonByteMatrix* matrix = FX_NEW CBC_CommonByteMatrix(symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
matrix->Init();
- FX_INT32 matrixY = 0;
- for (FX_INT32 y = 0; y < symbolHeight; y++) {
- FX_INT32 matrixX;
+ int32_t matrixY = 0;
+ for (int32_t y = 0; y < symbolHeight; y++) {
+ int32_t matrixX;
if ((y % symbolInfo->m_matrixHeight) == 0) {
matrixX = 0;
- for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) {
+ for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) {
matrix->Set(matrixX, matrixY, (x % 2) == 0);
matrixX++;
}
matrixY++;
}
matrixX = 0;
- for (FX_INT32 x = 0; x < symbolWidth; x++) {
+ for (int32_t x = 0; x < symbolWidth; x++) {
if ((x % symbolInfo->m_matrixWidth) == 0) {
matrix->Set(matrixX, matrixY, TRUE);
matrixX++;
@@ -127,7 +127,7 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* matrixY++;
if ((y % symbolInfo->m_matrixHeight) == symbolInfo->m_matrixHeight - 1) {
matrixX = 0;
- for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) {
+ for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) {
matrix->Set(matrixX, matrixY, TRUE);
matrixX++;
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h index c8a6bdd823..241229b467 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h @@ -18,13 +18,13 @@ class CBC_DataMatrixWriter : public CBC_TwoDimWriter public:
CBC_DataMatrixWriter();
virtual ~CBC_DataMatrixWriter();
- FX_BYTE* Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BOOL SetErrorCorrectionLevel (FX_INT32 level);
+ uint8_t* Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ FX_BOOL SetErrorCorrectionLevel (int32_t level);
private:
- static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e);
- FX_INT32 m_iCorrectLevel;
+ static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e);
+ int32_t m_iCorrectLevel;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp index e6bab5a65e..57c6cc92d2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp @@ -23,25 +23,25 @@ #include "../barcode.h"
#include "BC_Encoder.h"
#include "BC_DefaultPlacement.h"
-CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows)
+CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows)
{
m_codewords = codewords;
m_numcols = numcols;
m_numrows = numrows;
m_bits.SetSize(numcols * numrows);
- for (FX_INT32 i = 0; i < numcols * numrows; i++) {
- m_bits[i] = (FX_BYTE) 2;
+ for (int32_t i = 0; i < numcols * numrows; i++) {
+ m_bits[i] = (uint8_t) 2;
}
}
CBC_DefaultPlacement::~CBC_DefaultPlacement()
{
m_bits.RemoveAll();
}
-FX_INT32 CBC_DefaultPlacement::getNumrows()
+int32_t CBC_DefaultPlacement::getNumrows()
{
return m_numrows;
}
-FX_INT32 CBC_DefaultPlacement::getNumcols()
+int32_t CBC_DefaultPlacement::getNumcols()
{
return m_numcols;
}
@@ -49,23 +49,23 @@ CFX_ByteArray& CBC_DefaultPlacement::getBits() {
return m_bits;
}
-FX_BOOL CBC_DefaultPlacement::getBit(FX_INT32 col, FX_INT32 row)
+FX_BOOL CBC_DefaultPlacement::getBit(int32_t col, int32_t row)
{
return m_bits[row * m_numcols + col] == 1;
}
-void CBC_DefaultPlacement::setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit)
+void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, FX_BOOL bit)
{
- m_bits[row * m_numcols + col] = bit ? (FX_BYTE) 1 : (FX_BYTE) 0;
+ m_bits[row * m_numcols + col] = bit ? (uint8_t) 1 : (uint8_t) 0;
}
-FX_BOOL CBC_DefaultPlacement::hasBit(FX_INT32 col, FX_INT32 row)
+FX_BOOL CBC_DefaultPlacement::hasBit(int32_t col, int32_t row)
{
return m_bits[row * m_numcols + col] != 2;
}
void CBC_DefaultPlacement::place()
{
- FX_INT32 pos = 0;
- FX_INT32 row = 4;
- FX_INT32 col = 0;
+ int32_t pos = 0;
+ int32_t row = 4;
+ int32_t col = 0;
do {
if ((row == m_numrows) && (col == 0)) {
corner1(pos++);
@@ -103,7 +103,7 @@ void CBC_DefaultPlacement::place() setBit(m_numcols - 2, m_numrows - 2, TRUE);
}
}
-void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit)
+void CBC_DefaultPlacement::module(int32_t row, int32_t col, int32_t pos, int32_t bit)
{
if (row < 0) {
row += m_numrows;
@@ -113,11 +113,11 @@ void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_I col += m_numcols;
row += 4 - ((m_numcols + 4) % 8);
}
- FX_INT32 v = m_codewords.GetAt(pos);
+ int32_t v = m_codewords.GetAt(pos);
v &= 1 << (8 - bit);
setBit(col, row, v != 0);
}
-void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos)
+void CBC_DefaultPlacement::utah(int32_t row, int32_t col, int32_t pos)
{
module(row - 2, col - 2, pos, 1);
module(row - 2, col - 1, pos, 2);
@@ -128,7 +128,7 @@ void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos) module(row, col - 1, pos, 7);
module(row, col, pos, 8);
}
-void CBC_DefaultPlacement::corner1(FX_INT32 pos)
+void CBC_DefaultPlacement::corner1(int32_t pos)
{
module(m_numrows - 1, 0, pos, 1);
module(m_numrows - 1, 1, pos, 2);
@@ -139,7 +139,7 @@ void CBC_DefaultPlacement::corner1(FX_INT32 pos) module(2, m_numcols - 1, pos, 7);
module(3, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner2(FX_INT32 pos)
+void CBC_DefaultPlacement::corner2(int32_t pos)
{
module(m_numrows - 3, 0, pos, 1);
module(m_numrows - 2, 0, pos, 2);
@@ -150,7 +150,7 @@ void CBC_DefaultPlacement::corner2(FX_INT32 pos) module(0, m_numcols - 1, pos, 7);
module(1, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner3(FX_INT32 pos)
+void CBC_DefaultPlacement::corner3(int32_t pos)
{
module(m_numrows - 3, 0, pos, 1);
module(m_numrows - 2, 0, pos, 2);
@@ -161,7 +161,7 @@ void CBC_DefaultPlacement::corner3(FX_INT32 pos) module(2, m_numcols - 1, pos, 7);
module(3, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner4(FX_INT32 pos)
+void CBC_DefaultPlacement::corner4(int32_t pos)
{
module(m_numrows - 1, 0, pos, 1);
module(m_numrows - 1, m_numcols - 1, pos, 2);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h index 2194e9f18a..dec26a6c70 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h @@ -9,26 +9,26 @@ class CBC_DefaultPlacement
{
public:
- CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows);
+ CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows);
virtual ~CBC_DefaultPlacement();
- FX_INT32 getNumrows();
- FX_INT32 getNumcols();
+ int32_t getNumrows();
+ int32_t getNumcols();
CFX_ByteArray& getBits();
- FX_BOOL getBit(FX_INT32 col, FX_INT32 row);
- void setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit);
- FX_BOOL hasBit(FX_INT32 col, FX_INT32 row);
+ FX_BOOL getBit(int32_t col, int32_t row);
+ void setBit(int32_t col, int32_t row, FX_BOOL bit);
+ FX_BOOL hasBit(int32_t col, int32_t row);
void place();
private:
CFX_WideString m_codewords;
- FX_INT32 m_numrows;
- FX_INT32 m_numcols;
+ int32_t m_numrows;
+ int32_t m_numcols;
CFX_ByteArray m_bits;
- void module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit);
- void utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos);
- void corner1(FX_INT32 pos);
- void corner2(FX_INT32 pos);
- void corner3(FX_INT32 pos);
- void corner4(FX_INT32 pos);
+ void module(int32_t row, int32_t col, int32_t pos, int32_t bit);
+ void utah(int32_t row, int32_t col, int32_t pos);
+ void corner1(int32_t pos);
+ void corner2(int32_t pos);
+ void corner3(int32_t pos);
+ void corner4(int32_t pos);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp index d1e84af73e..8a0271f1a0 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp @@ -35,11 +35,11 @@ CBC_EdifactEncoder::CBC_EdifactEncoder() CBC_EdifactEncoder::~CBC_EdifactEncoder()
{
}
-FX_INT32 CBC_EdifactEncoder::getEncodingMode()
+int32_t CBC_EdifactEncoder::getEncodingMode()
{
return EDIFACT_ENCODATION;
}
-void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e)
+void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, int32_t &e)
{
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
@@ -49,14 +49,14 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return;
}
context.m_pos++;
- FX_INT32 count = buffer.GetLength();
+ int32_t count = buffer.GetLength();
if (count >= 4) {
context.writeCodewords(encodeToCodewords(buffer, 0, e));
if (e != BCExceptionNO) {
return;
}
buffer.Delete(0, 4);
- FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
+ int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(ASCII_ENCODATION);
break;
@@ -66,9 +66,9 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) buffer += (FX_WCHAR)31;
handleEOD(context, buffer, e);
}
-void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e)
+void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e)
{
- FX_INT32 count = buffer.GetLength();
+ int32_t count = buffer.GetLength();
if (count == 0) {
return;
}
@@ -77,8 +77,8 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) {
return;
}
- FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
- FX_INT32 remaining = context.getRemainingCharacters();
+ int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
+ int32_t remaining = context.getRemainingCharacters();
if (remaining == 0 && available <= 2) {
return;
}
@@ -87,7 +87,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b e = BCExceptionIllegalStateCountMustNotExceed4;
return;
}
- FX_INT32 restChars = count - 1;
+ int32_t restChars = count - 1;
CFX_WideString encoded = encodeToCodewords(buffer, 0, e);
if (e != BCExceptionNO) {
return;
@@ -99,7 +99,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) {
return;
}
- FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
+ int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
if (available >= 3) {
restInAscii = FALSE;
context.updateSymbolInfo(context.getCodewordCount() + encoded.GetLength(), e);
@@ -116,7 +116,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b }
context.signalEncoderChange(ASCII_ENCODATION);
}
-void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e)
+void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e)
{
if (c >= ' ' && c <= '?') {
sb += c;
@@ -126,9 +126,9 @@ void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) CBC_HighLevelEncoder::illegalCharacter(c, e);
}
}
-CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e)
+CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e)
{
- FX_INT32 len = sb.GetLength() - startPos;
+ int32_t len = sb.GetLength() - startPos;
if (len == 0) {
e = BCExceptionNoContents;
return (FX_LPWSTR)"";
@@ -137,7 +137,7 @@ CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 FX_WCHAR c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0;
FX_WCHAR c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0;
FX_WCHAR c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0;
- FX_INT32 v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4;
+ int32_t v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4;
FX_WCHAR cw1 = (FX_WCHAR) ((v >> 16) & 255);
FX_WCHAR cw2 = (FX_WCHAR) ((v >> 8) & 255);
FX_WCHAR cw3 = (FX_WCHAR) (v & 255);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h index 7e2453a71d..6b102c689c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h @@ -13,11 +13,11 @@ class CBC_EdifactEncoder : public CBC_Encoder public:
CBC_EdifactEncoder();
virtual ~CBC_EdifactEncoder();
- FX_INT32 getEncodingMode();
- void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ int32_t getEncodingMode();
+ void Encode(CBC_EncoderContext &context, int32_t &e);
private:
- static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e);
- static void encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
- static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e);
+ static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e);
+ static void encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e);
+ static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h index 7d1a1b5b62..9a51af06e9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h @@ -12,7 +12,7 @@ class CBC_Encoder public:
CBC_Encoder();
virtual ~CBC_Encoder();
- virtual FX_INT32 getEncodingMode() = 0;
- virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e) = 0;
+ virtual int32_t getEncodingMode() = 0;
+ virtual void Encode(CBC_EncoderContext &context, int32_t &e) = 0;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp index f65c9f29bc..066b4b2037 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp @@ -28,13 +28,13 @@ #include "BC_SymbolShapeHint.h"
#include "BC_SymbolInfo.h"
#include "BC_EncoderContext.h"
-CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e)
+CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e)
{
CFX_ByteString dststr;
CBC_UtilCodingConvert::UnicodeToUTF8(msg, dststr);
CFX_WideString sb;
- FX_INT32 c = dststr.GetLength();
- for (FX_INT32 i = 0; i < c; i++) {
+ int32_t c = dststr.GetLength();
+ for (int32_t i = 0; i < c; i++) {
FX_WCHAR ch = (FX_WCHAR)(dststr.GetAt(i) & 0xff);
if (ch == '?' && dststr.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
@@ -66,7 +66,7 @@ CFX_WideString CBC_EncoderContext::getMessage() {
return m_msg;
}
-void CBC_EncoderContext::setSkipAtEnd(FX_INT32 count)
+void CBC_EncoderContext::setSkipAtEnd(int32_t count)
{
m_skipAtEnd = count;
}
@@ -86,11 +86,11 @@ void CBC_EncoderContext::writeCodeword(FX_WCHAR codeword) {
m_codewords += codeword;
}
-FX_INT32 CBC_EncoderContext::getCodewordCount()
+int32_t CBC_EncoderContext::getCodewordCount()
{
return m_codewords.GetLength();
}
-void CBC_EncoderContext::signalEncoderChange(FX_INT32 encoding)
+void CBC_EncoderContext::signalEncoderChange(int32_t encoding)
{
m_newEncoding = encoding;
}
@@ -102,15 +102,15 @@ FX_BOOL CBC_EncoderContext::hasMoreCharacters() {
return m_pos < getTotalMessageCharCount();
}
-FX_INT32 CBC_EncoderContext::getRemainingCharacters()
+int32_t CBC_EncoderContext::getRemainingCharacters()
{
return getTotalMessageCharCount() - m_pos;
}
-void CBC_EncoderContext::updateSymbolInfo(FX_INT32 &e)
+void CBC_EncoderContext::updateSymbolInfo(int32_t &e)
{
updateSymbolInfo(getCodewordCount(), e);
}
-void CBC_EncoderContext::updateSymbolInfo(FX_INT32 len, FX_INT32 &e)
+void CBC_EncoderContext::updateSymbolInfo(int32_t len, int32_t &e)
{
if (m_symbolInfo == NULL || len > m_symbolInfo->m_dataCapacity) {
m_symbolInfo = CBC_SymbolInfo::lookup(len, m_shape, m_minSize, m_maxSize, true, e);
@@ -121,7 +121,7 @@ void CBC_EncoderContext::resetSymbolInfo() {
m_shape = FORCE_NONE;
}
-FX_INT32 CBC_EncoderContext::getTotalMessageCharCount()
+int32_t CBC_EncoderContext::getTotalMessageCharCount()
{
return m_msg.GetLength() - m_skipAtEnd;
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h index 0099dbc9f0..e2dd0b35bb 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h @@ -13,36 +13,36 @@ class CBC_EncoderContext; class CBC_EncoderContext : public CBC_SymbolShapeHint
{
public:
- CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e);
+ CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e);
virtual ~CBC_EncoderContext();
void setSymbolShape(SymbolShapeHint shape);
void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize);
CFX_WideString getMessage();
- void setSkipAtEnd(FX_INT32 count);
+ void setSkipAtEnd(int32_t count);
FX_WCHAR getCurrentChar();
FX_WCHAR getCurrent();
void writeCodewords(CFX_WideString codewords);
void writeCodeword(FX_WCHAR codeword);
- FX_INT32 getCodewordCount();
- void signalEncoderChange(FX_INT32 encoding);
+ int32_t getCodewordCount();
+ void signalEncoderChange(int32_t encoding);
void resetEncoderSignal();
FX_BOOL hasMoreCharacters();
- FX_INT32 getRemainingCharacters();
- void updateSymbolInfo(FX_INT32 &e);
- void updateSymbolInfo(FX_INT32 len, FX_INT32 &e);
+ int32_t getRemainingCharacters();
+ void updateSymbolInfo(int32_t &e);
+ void updateSymbolInfo(int32_t len, int32_t &e);
void resetSymbolInfo();
public:
CFX_WideString m_msg;
CFX_WideString m_codewords;
- FX_INT32 m_pos;
- FX_INT32 m_newEncoding;
+ int32_t m_pos;
+ int32_t m_newEncoding;
CBC_SymbolInfo* m_symbolInfo;
private:
- FX_INT32 getTotalMessageCharCount();
+ int32_t getTotalMessageCharCount();
private:
SymbolShapeHint m_shape;
CBC_Dimension* m_minSize;
CBC_Dimension* m_maxSize;
- FX_INT32 m_skipAtEnd;
+ int32_t m_skipAtEnd;
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index f346072499..e574742b54 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -25,8 +25,8 @@ #include "BC_SymbolShapeHint.h"
#include "BC_SymbolInfo.h"
#include "BC_ErrorCorrection.h"
-FX_INT32 CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68};
-FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = {
+int32_t CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68};
+int32_t CBC_ErrorCorrection::FACTORS[][100] = {
{228, 48, 15, 111, 62},
{23, 68, 144, 134, 240, 92, 254},
{28, 24, 185, 166, 223, 248, 116, 255, 110, 61},
@@ -78,13 +78,13 @@ FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = { 96, 103, 82, 186
}
};
-FX_INT32 CBC_ErrorCorrection::MODULO_VALUE = 0x12D;
-FX_INT32 CBC_ErrorCorrection::LOG[256] = {0};
-FX_INT32 CBC_ErrorCorrection::ALOG[256] = {0};
+int32_t CBC_ErrorCorrection::MODULO_VALUE = 0x12D;
+int32_t CBC_ErrorCorrection::LOG[256] = {0};
+int32_t CBC_ErrorCorrection::ALOG[256] = {0};
void CBC_ErrorCorrection::Initialize()
{
- FX_INT32 p = 1;
- for (FX_INT32 i = 0; i < 255; i++) {
+ int32_t p = 1;
+ for (int32_t i = 0; i < 255; i++) {
ALOG[i] = p;
LOG[p] = i;
p <<= 1;
@@ -102,7 +102,7 @@ CBC_ErrorCorrection::CBC_ErrorCorrection() CBC_ErrorCorrection::~CBC_ErrorCorrection()
{
}
-CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e)
+CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e)
{
if (codewords.GetLength() != symbolInfo->m_dataCapacity) {
e = BCExceptionIllegalArgument;
@@ -110,7 +110,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S }
CFX_WideString sb;
sb += codewords;
- FX_INT32 blockCount = symbolInfo->getInterleavedBlockCount();
+ int32_t blockCount = symbolInfo->getInterleavedBlockCount();
if (blockCount == 1) {
CFX_WideString ecc = createECCBlock(codewords, symbolInfo->m_errorCodewords, e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)"");
@@ -122,7 +122,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S errorSizes.SetSize(blockCount);
CFX_Int32Array startPos;
startPos.SetSize(blockCount);
- for (FX_INT32 i = 0; i < blockCount; i++) {
+ for (int32_t i = 0; i < blockCount; i++) {
dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1);
errorSizes[i] = symbolInfo->getErrorLengthForInterleavedBlock(i + 1);
startPos[i] = 0;
@@ -130,29 +130,29 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S startPos[i] = startPos[i - 1] + dataSizes[i];
}
}
- for (FX_INT32 block = 0; block < blockCount; block++) {
+ for (int32_t block = 0; block < blockCount; block++) {
CFX_WideString temp;
- for (FX_INT32 d = block; d < symbolInfo->m_dataCapacity; d += blockCount) {
+ for (int32_t d = block; d < symbolInfo->m_dataCapacity; d += blockCount) {
temp += (FX_WCHAR)codewords.GetAt(d);
}
CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)"");
- FX_INT32 pos = 0;
- for (FX_INT32 l = block; l < errorSizes[block] * blockCount; l += blockCount) {
+ int32_t pos = 0;
+ for (int32_t l = block; l < errorSizes[block] * blockCount; l += blockCount) {
sb.SetAt(symbolInfo->m_dataCapacity + l, ecc.GetAt(pos++));
}
}
}
return sb;
}
-CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e)
+CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e)
{
return createECCBlock(codewords, 0, codewords.GetLength(), numECWords, e);
}
-CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e)
+CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e)
{
- FX_INT32 table = -1;
- for (FX_INT32 i = 0; i < sizeof(FACTOR_SETS) / sizeof(FX_INT32); i++) {
+ int32_t table = -1;
+ for (int32_t i = 0; i < sizeof(FACTOR_SETS) / sizeof(int32_t); i++) {
if (FACTOR_SETS[i] == numECWords) {
table = i;
break;
@@ -164,14 +164,14 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ }
FX_WORD* ecc = FX_Alloc(FX_WORD, numECWords);
FXSYS_memset32(ecc, 0, numECWords * sizeof(FX_WORD));
- for (FX_INT32 l = start; l < start + len; l++) {
- FX_BYTE A = (FX_BYTE)codewords.GetAt(l);
+ for (int32_t l = start; l < start + len; l++) {
+ uint8_t A = (uint8_t)codewords.GetAt(l);
FX_WORD B = ecc[numECWords - 1];
FX_WORD m = ecc[numECWords - 1] ^ codewords.GetAt(l);
- for (FX_INT32 k = numECWords - 1; k > 0; k--) {
+ for (int32_t k = numECWords - 1; k > 0; k--) {
if (m != 0 && FACTORS[table][k] != 0) {
- FX_INT32 a = LOG[FACTORS[table][k]];
- FX_INT32 b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255];
+ int32_t a = LOG[FACTORS[table][k]];
+ int32_t b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255];
FX_WORD c = ecc[k - 1];
FX_WORD D = (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]);
ecc[k] = (FX_WORD ) (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]);
@@ -186,7 +186,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ }
}
CFX_WideString strecc;
- for (FX_INT32 j = 0; j < numECWords; j++) {
+ for (int32_t j = 0; j < numECWords; j++) {
strecc += (FX_WCHAR)ecc[numECWords - j - 1];
}
FX_Free(ecc);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h index 0bc71cdeb5..2ec7b27aaa 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h @@ -14,15 +14,15 @@ public: virtual ~CBC_ErrorCorrection();
static void Initialize();
static void Finalize();
- static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e);
+ static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e);
private:
- static FX_INT32 FACTOR_SETS[];
- static FX_INT32 FACTORS[][100];
- static FX_INT32 MODULO_VALUE;
- static FX_INT32 LOG[256];
- static FX_INT32 ALOG[256];
+ static int32_t FACTOR_SETS[];
+ static int32_t FACTORS[][100];
+ static int32_t MODULO_VALUE;
+ static int32_t LOG[256];
+ static int32_t ALOG[256];
private:
- static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e);
- static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e);
+ static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e);
+ static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 5b46612d62..3866f45a5e 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -60,16 +60,16 @@ CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) {
CFX_ByteString bytestr;
CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr);
- for (FX_INT32 i = 0; i < bytestr.GetLength(); i++) {
+ for (int32_t i = 0; i < bytestr.GetLength(); i++) {
m_bytearray.Add(bytestr.GetAt(i));
}
return m_bytearray;
}
-CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e)
+CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e)
{
return encodeHighLevel(msg, ecLevel, FORCE_NONE, NULL, NULL, e);
}
-CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e)
+CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e)
{
CBC_EncoderContext context(msg, ecLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)"");
@@ -91,11 +91,11 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi encoders.Add(FX_NEW CBC_X12Encoder());
encoders.Add(FX_NEW CBC_EdifactEncoder());
encoders.Add(FX_NEW CBC_Base256Encoder());
- FX_INT32 encodingMode = ASCII_ENCODATION;
+ int32_t encodingMode = ASCII_ENCODATION;
while (context.hasMoreCharacters()) {
((CBC_Encoder*)encoders.GetAt(encodingMode))->Encode(context, e);
if (e != BCExceptionNO) {
- for (FX_INT32 i = 0; i < encoders.GetSize(); i++) {
+ for (int32_t i = 0; i < encoders.GetSize(); i++) {
delete (CBC_Encoder*)encoders.GetAt(i);
}
encoders.RemoveAll();
@@ -106,16 +106,16 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi context.resetEncoderSignal();
}
}
- FX_INT32 len = context.m_codewords.GetLength();
+ int32_t len = context.m_codewords.GetLength();
context.updateSymbolInfo(e);
if (e != BCExceptionNO) {
- for (FX_INT32 i = 0; i < encoders.GetSize(); i++) {
+ for (int32_t i = 0; i < encoders.GetSize(); i++) {
delete (CBC_Encoder*)encoders.GetAt(i);
}
encoders.RemoveAll();
return (FX_LPWSTR)"";
}
- FX_INT32 capacity = context.m_symbolInfo->m_dataCapacity;
+ int32_t capacity = context.m_symbolInfo->m_dataCapacity;
if (len < capacity) {
if (encodingMode != ASCII_ENCODATION && encodingMode != BASE256_ENCODATION) {
context.writeCodeword(0x00fe);
@@ -128,13 +128,13 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi while (codewords.GetLength() < capacity) {
codewords += (randomize253State(PAD, codewords.GetLength() + 1));
}
- for (FX_INT32 i = 0; i < encoders.GetSize(); i++) {
+ for (int32_t i = 0; i < encoders.GetSize(); i++) {
delete (CBC_Encoder*)encoders.GetAt(i);
}
encoders.RemoveAll();
return codewords;
}
-FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode)
+int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, int32_t startpos, int32_t currentMode)
{
if (startpos >= msg.GetLength()) {
return currentMode;
@@ -156,7 +156,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp charCounts.Add(2.25f);
charCounts[currentMode] = 0;
}
- FX_INT32 charsProcessed = 0;
+ int32_t charsProcessed = 0;
while (TRUE) {
if ((startpos + charsProcessed) == msg.GetLength()) {
FX_DWORD min = Integer_MAX_VALUE;
@@ -165,7 +165,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_Int32Array intCharCounts;
intCharCounts.SetSize(6);
min = findMinimums(charCounts, intCharCounts, min, mins);
- FX_INT32 minCount = getMinimumCount(mins);
+ int32_t minCount = getMinimumCount(mins);
if (intCharCounts[ASCII_ENCODATION] == min) {
return ASCII_ENCODATION;
}
@@ -233,7 +233,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_ByteArray mins;
mins.SetSize(6);
findMinimums(charCounts, intCharCounts, Integer_MAX_VALUE, mins);
- FX_INT32 minCount = getMinimumCount(mins);
+ int32_t minCount = getMinimumCount(mins);
if (intCharCounts[ASCII_ENCODATION] < intCharCounts[BASE256_ENCODATION]
&& intCharCounts[ASCII_ENCODATION] < intCharCounts[C40_ENCODATION]
&& intCharCounts[ASCII_ENCODATION] < intCharCounts[TEXT_ENCODATION]
@@ -262,7 +262,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp return C40_ENCODATION;
}
if (intCharCounts[C40_ENCODATION] == intCharCounts[X12_ENCODATION]) {
- FX_INT32 p = startpos + charsProcessed + 1;
+ int32_t p = startpos + charsProcessed + 1;
while (p < msg.GetLength()) {
FX_WCHAR tc = msg.GetAt(p);
if (isX12TermSep(tc)) {
@@ -287,11 +287,11 @@ FX_BOOL CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) {
return ch >= 128 && ch <= 255;
}
-FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos)
+int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos)
{
- FX_INT32 count = 0;
- FX_INT32 len = msg.GetLength();
- FX_INT32 idx = startpos;
+ int32_t count = 0;
+ int32_t len = msg.GetLength();
+ int32_t idx = startpos;
if (idx < len) {
FX_WCHAR ch = msg.GetAt(idx);
while (isDigit(ch) && idx < len) {
@@ -304,28 +304,28 @@ FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg }
return count;
}
-void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, FX_INT32 &e)
+void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, int32_t &e)
{
e = BCExceptionIllegalArgument;
}
-FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition)
+FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, int32_t codewordPosition)
{
- FX_INT32 pseudoRandom = ((149 * codewordPosition) % 253) + 1;
- FX_INT32 tempVariable = ch + pseudoRandom;
+ int32_t pseudoRandom = ((149 * codewordPosition) % 253) + 1;
+ int32_t tempVariable = ch + pseudoRandom;
return tempVariable <= 254 ? (FX_WCHAR) tempVariable : (FX_WCHAR) (tempVariable - 254);
}
-FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins)
+int32_t CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, int32_t min, CFX_ByteArray &mins)
{
- for (FX_INT32 l = 0; l < mins.GetSize(); l++) {
- mins[l] = (FX_BYTE)0;
+ for (int32_t l = 0; l < mins.GetSize(); l++) {
+ mins[l] = (uint8_t)0;
}
- for (FX_INT32 i = 0; i < 6; i++) {
- intCharCounts[i] = (FX_INT32)ceil(charCounts[i]);
- FX_INT32 current = intCharCounts[i];
+ for (int32_t i = 0; i < 6; i++) {
+ intCharCounts[i] = (int32_t)ceil(charCounts[i]);
+ int32_t current = intCharCounts[i];
if (min > current) {
min = current;
- for (FX_INT32 j = 0; j < mins.GetSize(); j++) {
- mins[j] = (FX_BYTE)0;
+ for (int32_t j = 0; j < mins.GetSize(); j++) {
+ mins[j] = (uint8_t)0;
}
}
if (min == current) {
@@ -334,10 +334,10 @@ FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int3 }
return min;
}
-FX_INT32 CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins)
+int32_t CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins)
{
- FX_INT32 minCount = 0;
- for (FX_INT32 i = 0; i < 6; i++) {
+ int32_t minCount = 0;
+ for (int32_t i = 0; i < 6; i++) {
minCount += mins[i];
}
return minCount;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 170ca9f8fa..c2bfdccb1b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -20,13 +20,13 @@ public: CBC_HighLevelEncoder();
virtual ~CBC_HighLevelEncoder();
CFX_ByteArray& getBytesForMessage(CFX_WideString msg);
- static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e);
- static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e);
- static FX_INT32 lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode);
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e);
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e);
+ static int32_t lookAheadTest(CFX_WideString msg, int32_t startpos, int32_t currentMode);
static FX_BOOL isDigit(FX_WCHAR ch);
static FX_BOOL isExtendedASCII(FX_WCHAR ch);
- static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos);
- static void illegalCharacter(FX_WCHAR c, FX_INT32 &e);
+ static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos);
+ static void illegalCharacter(FX_WCHAR c, int32_t &e);
public:
static FX_WCHAR LATCH_TO_C40;
@@ -46,9 +46,9 @@ private: static const wchar_t MACRO_TRAILER;
CFX_ByteArray m_bytearray;
private:
- static FX_WCHAR randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition);
- static FX_INT32 findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins);
- static FX_INT32 getMinimumCount(CFX_ByteArray &mins);
+ static FX_WCHAR randomize253State(FX_WCHAR ch, int32_t codewordPosition);
+ static int32_t findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, int32_t min, CFX_ByteArray &mins);
+ static int32_t getMinimumCount(CFX_ByteArray &mins);
static FX_BOOL isNativeC40(FX_WCHAR ch);
static FX_BOOL isNativeText(FX_WCHAR ch);
static FX_BOOL isNativeX12(FX_WCHAR ch);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp index 415cbd6b3c..0044683a5c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp @@ -62,19 +62,19 @@ void CBC_SymbolInfo::Initialize() m_PROD_SYMBOLS[27] = FX_NEW CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68);
m_PROD_SYMBOLS[28] = FX_NEW CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62);
m_PROD_SYMBOLS[29] = FX_NEW CBC_DataMatrixSymbolInfo144();
- for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) {
+ for (int32_t i = 0; i < SYMBOLS_COUNT; i++) {
m_symbols[i] = m_PROD_SYMBOLS[i];
}
}
void CBC_SymbolInfo::Finalize()
{
- for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) {
+ for (int32_t i = 0; i < SYMBOLS_COUNT; i++) {
delete m_PROD_SYMBOLS[i];
m_PROD_SYMBOLS[i] = NULL;
m_symbols[i] = NULL;
}
}
-CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions)
+CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions)
{
m_rectangular = rectangular;
m_dataCapacity = dataCapacity;
@@ -85,8 +85,8 @@ CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_IN m_rsBlockData = dataCapacity;
m_rsBlockError = errorCodewords;
}
-CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions,
- FX_INT32 rsBlockData, FX_INT32 rsBlockError)
+CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions,
+ int32_t rsBlockData, int32_t rsBlockError)
{
m_rectangular = rectangular;
m_dataCapacity = dataCapacity;
@@ -101,26 +101,26 @@ CBC_SymbolInfo::~CBC_SymbolInfo() {
}
-CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_INT32 &e)
+CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, int32_t &e)
{
return lookup(dataCodewords, FORCE_NONE, TRUE, e);
}
-CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e)
+CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e)
{
return lookup(dataCodewords, shape, TRUE, e);
}
-CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e)
+CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e)
{
SymbolShapeHint shape = allowRectangular ? FORCE_NONE : FORCE_SQUARE;
return lookup(dataCodewords, shape, fail, e);
}
-CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e)
+CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e)
{
return lookup(dataCodewords, shape, NULL, NULL, fail, e);
}
-CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e)
+CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e)
{
- for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) {
+ for (int32_t i = 0; i < SYMBOLS_COUNT; i++) {
CBC_SymbolInfo* symbol = m_symbols[i];
if (shape == FORCE_SQUARE && symbol->m_rectangular) {
continue;
@@ -146,7 +146,7 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint s }
return NULL;
}
-FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getHorizontalDataRegions(int32_t &e)
{
switch (m_dataRegions) {
case 1:
@@ -164,7 +164,7 @@ FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e) return 0;
}
}
-FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getVerticalDataRegions(int32_t &e)
{
switch (m_dataRegions) {
case 1:
@@ -182,39 +182,39 @@ FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e) return 0;
}
}
-FX_INT32 CBC_SymbolInfo::getSymbolDataWidth(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getSymbolDataWidth(int32_t &e)
{
return getHorizontalDataRegions(e) * m_matrixWidth;
}
-FX_INT32 CBC_SymbolInfo::getSymbolDataHeight(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getSymbolDataHeight(int32_t &e)
{
return getVerticalDataRegions(e) * m_matrixHeight;
}
-FX_INT32 CBC_SymbolInfo::getSymbolWidth(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getSymbolWidth(int32_t &e)
{
return getSymbolDataWidth(e) + (getHorizontalDataRegions(e) * 2);
}
-FX_INT32 CBC_SymbolInfo::getSymbolHeight(FX_INT32 &e)
+int32_t CBC_SymbolInfo::getSymbolHeight(int32_t &e)
{
return getSymbolDataHeight(e) + (getVerticalDataRegions(e) * 2);
}
-FX_INT32 CBC_SymbolInfo::getCodewordCount()
+int32_t CBC_SymbolInfo::getCodewordCount()
{
return m_dataCapacity + m_errorCodewords;
}
-FX_INT32 CBC_SymbolInfo::getInterleavedBlockCount()
+int32_t CBC_SymbolInfo::getInterleavedBlockCount()
{
return m_dataCapacity / m_rsBlockData;
}
-FX_INT32 CBC_SymbolInfo::getDataLengthForInterleavedBlock(FX_INT32 index)
+int32_t CBC_SymbolInfo::getDataLengthForInterleavedBlock(int32_t index)
{
return m_rsBlockData;
}
-FX_INT32 CBC_SymbolInfo::getErrorLengthForInterleavedBlock(FX_INT32 index)
+int32_t CBC_SymbolInfo::getErrorLengthForInterleavedBlock(int32_t index)
{
return m_rsBlockError;
}
-CFX_WideString CBC_SymbolInfo::toString(FX_INT32 &e)
+CFX_WideString CBC_SymbolInfo::toString(int32_t &e)
{
CFX_WideString sb;
sb += (FX_LPWSTR)(m_rectangular ? "Rectangular Symbol:" : "Square Symbol:");
diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h index 0450a28725..5ace547442 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -12,42 +12,42 @@ class CBC_SymbolInfo; class CBC_SymbolInfo : public CBC_SymbolShapeHint
{
public:
- CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords,
- FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions);
+ CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords,
+ int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions);
virtual ~CBC_SymbolInfo();
static void Initialize();
static void Finalize();
static void overrideSymbolSet(CBC_SymbolInfo* override);
- static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_INT32 &e);
- static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e);
- static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e);
- static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e);
- static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e);
- FX_INT32 getHorizontalDataRegions(FX_INT32 &e);
- FX_INT32 getVerticalDataRegions(FX_INT32 &e);
- FX_INT32 getSymbolDataWidth(FX_INT32 &e);
- FX_INT32 getSymbolDataHeight(FX_INT32 &e);
- FX_INT32 getSymbolWidth(FX_INT32 &e);
- FX_INT32 getSymbolHeight(FX_INT32 &e);
- FX_INT32 getCodewordCount();
- FX_INT32 getInterleavedBlockCount();
- FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index);
- FX_INT32 getErrorLengthForInterleavedBlock(FX_INT32 index);
- CFX_WideString toString(FX_INT32 &e);
+ static CBC_SymbolInfo* lookup(int32_t dataCodewords, int32_t &e);
+ static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e);
+ static CBC_SymbolInfo* lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e);
+ static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e);
+ static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e);
+ int32_t getHorizontalDataRegions(int32_t &e);
+ int32_t getVerticalDataRegions(int32_t &e);
+ int32_t getSymbolDataWidth(int32_t &e);
+ int32_t getSymbolDataHeight(int32_t &e);
+ int32_t getSymbolWidth(int32_t &e);
+ int32_t getSymbolHeight(int32_t &e);
+ int32_t getCodewordCount();
+ int32_t getInterleavedBlockCount();
+ int32_t getDataLengthForInterleavedBlock(int32_t index);
+ int32_t getErrorLengthForInterleavedBlock(int32_t index);
+ CFX_WideString toString(int32_t &e);
public:
- FX_INT32 m_dataCapacity;
- FX_INT32 m_errorCodewords;
- FX_INT32 m_matrixWidth;
- FX_INT32 m_matrixHeight;
- FX_INT32 m_rsBlockData;
- FX_INT32 m_rsBlockError;
+ int32_t m_dataCapacity;
+ int32_t m_errorCodewords;
+ int32_t m_matrixWidth;
+ int32_t m_matrixHeight;
+ int32_t m_rsBlockData;
+ int32_t m_rsBlockError;
static CBC_SymbolInfo* m_PROD_SYMBOLS[30];
private:
static CBC_SymbolInfo* m_symbols[30];
FX_BOOL m_rectangular;
- FX_INT32 m_dataRegions;
+ int32_t m_dataRegions;
private:
- CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions,
- FX_INT32 rsBlockData, FX_INT32 rsBlockError);
+ CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions,
+ int32_t rsBlockData, int32_t rsBlockError);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp index 45abec4d4a..afccce598f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp @@ -36,11 +36,11 @@ CBC_TextEncoder::CBC_TextEncoder() CBC_TextEncoder::~CBC_TextEncoder()
{
}
-FX_INT32 CBC_TextEncoder::getEncodingMode()
+int32_t CBC_TextEncoder::getEncodingMode()
{
return TEXT_ENCODATION;
}
-FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e)
+int32_t CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e)
{
if (c == ' ') {
sb += (FX_WCHAR)'\3';
@@ -92,7 +92,7 @@ FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e if (c >= 0x0080) {
sb += (FX_WCHAR)'\1';
sb += (FX_WCHAR)0x001e;
- FX_INT32 len = 2;
+ int32_t len = 2;
len += encodeChar((FX_WCHAR) (c - 128), sb, e);
BC_EXCEPTION_CHECK_ReturnValue(e, -1);
return len;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h index f1168679a6..7d46e92d5d 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h @@ -12,7 +12,7 @@ class CBC_TextEncoder : public CBC_C40Encoder public:
CBC_TextEncoder();
virtual ~CBC_TextEncoder();
- FX_INT32 getEncodingMode();
- FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+ int32_t getEncodingMode();
+ int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp index f6263f6777..7f56de7aed 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp @@ -36,11 +36,11 @@ CBC_X12Encoder::CBC_X12Encoder() CBC_X12Encoder::~CBC_X12Encoder()
{
}
-FX_INT32 CBC_X12Encoder::getEncodingMode()
+int32_t CBC_X12Encoder::getEncodingMode()
{
return X12_ENCODATION;
}
-void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e)
+void CBC_X12Encoder::Encode(CBC_EncoderContext &context, int32_t &e)
{
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
@@ -50,10 +50,10 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) if (e != BCExceptionNO) {
return;
}
- FX_INT32 count = buffer.GetLength();
+ int32_t count = buffer.GetLength();
if ((count % 3) == 0) {
writeNextTriplet(context, buffer);
- FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
+ int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(newMode);
break;
@@ -62,14 +62,14 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) }
handleEOD(context, buffer, e);
}
-void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e)
+void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e)
{
context.updateSymbolInfo(e);
if (e != BCExceptionNO) {
return;
}
- FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
- FX_INT32 count = buffer.GetLength();
+ int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
+ int32_t count = buffer.GetLength();
if (count == 2) {
context.writeCodeword(CBC_HighLevelEncoder::X12_UNLATCH);
context.m_pos -= 2;
@@ -82,7 +82,7 @@ void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff context.signalEncoderChange(ASCII_ENCODATION);
}
}
-FX_INT32 CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e)
+int32_t CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e)
{
if (c == '\r') {
sb += (FX_WCHAR)'\0';
diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h index 21111bc5cc..210f07a5d9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h @@ -13,9 +13,9 @@ class CBC_X12Encoder : public CBC_C40Encoder public:
CBC_X12Encoder();
virtual ~CBC_X12Encoder();
- FX_INT32 getEncodingMode();
- void Encode(CBC_EncoderContext &context, FX_INT32 &e);
- void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e);
- FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+ int32_t getEncodingMode();
+ void Encode(CBC_EncoderContext &context, int32_t &e);
+ void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e);
+ int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp index 1079c348d0..810b2c70c7 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp @@ -25,44 +25,44 @@ #include "../BC_BinaryBitmap.h"
#include "../common/BC_CommonBitArray.h"
#include "BC_OneDReader.h"
-const FX_INT32 CBC_OneDReader::INTEGER_MATH_SHIFT = 8;
-const FX_INT32 CBC_OneDReader::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8;
+const int32_t CBC_OneDReader::INTEGER_MATH_SHIFT = 8;
+const int32_t CBC_OneDReader::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8;
CBC_OneDReader::CBC_OneDReader()
{
}
CBC_OneDReader::~CBC_OneDReader()
{
}
-CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e)
+CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, int32_t &e)
{
CFX_ByteString strtemp = Decode(image, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
return strtemp;
}
-CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
CFX_ByteString strtemp = DeDecode(image, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
return strtemp;
}
-CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
- FX_INT32 width = image->GetWidth();
- FX_INT32 height = image->GetHeight();
+ int32_t width = image->GetWidth();
+ int32_t height = image->GetHeight();
CBC_CommonBitArray *row = NULL;
- FX_INT32 middle = height >> 1;
+ int32_t middle = height >> 1;
FX_BOOL tryHarder = FALSE;
- FX_INT32 rowStep = FX_MAX(1, height >> (tryHarder ? 8 : 5));
- FX_INT32 maxLines;
+ int32_t rowStep = FX_MAX(1, height >> (tryHarder ? 8 : 5));
+ int32_t maxLines;
if (tryHarder) {
maxLines = height;
} else {
maxLines = 15;
}
- for (FX_INT32 x = 0; x < maxLines; x++) {
- FX_INT32 rowStepsAboveOrBelow = (x + 1) >> 1;
+ for (int32_t x = 0; x < maxLines; x++) {
+ int32_t rowStepsAboveOrBelow = (x + 1) >> 1;
FX_BOOL isAbove = (x & 0x01) == 0;
- FX_INT32 rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow);
+ int32_t rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow);
if (rowNumber < 0 || rowNumber >= height) {
break;
}
@@ -75,7 +75,7 @@ CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, }
continue;
}
- for (FX_INT32 attempt = 0; attempt < 2; attempt++) {
+ for (int32_t attempt = 0; attempt < 2; attempt++) {
if (attempt == 1) {
row->Reverse();
}
@@ -98,20 +98,20 @@ CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, e = BCExceptionNotFound;
return "";
}
-void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e)
+void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e)
{
- FX_INT32 numCounters = counters->GetSize();
- for (FX_INT32 i = 0; i < numCounters; i++) {
+ int32_t numCounters = counters->GetSize();
+ for (int32_t i = 0; i < numCounters; i++) {
(*counters)[i] = 0;
}
- FX_INT32 end = row->GetSize();
+ int32_t end = row->GetSize();
if (start >= end) {
e = BCExceptionNotFound;
return;
}
FX_BOOL isWhite = !row->Get(start);
- FX_INT32 counterPosition = 0;
- FX_INT32 j = start;
+ int32_t counterPosition = 0;
+ int32_t j = start;
while (j < end) {
FX_BOOL pixel = row->Get(j);
if (pixel ^ isWhite) {
@@ -132,9 +132,9 @@ void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_ return;
}
}
-void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e)
+void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e)
{
- FX_INT32 numTransitionsLeft = counters->GetSize();
+ int32_t numTransitionsLeft = counters->GetSize();
FX_BOOL last = row->Get(start);
while (start > 0 && numTransitionsLeft >= 0) {
if (row->Get(--start) != last) {
@@ -149,12 +149,12 @@ void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 st RecordPattern(row, start + 1, counters, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-FX_INT32 CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const FX_INT32 *pattern, FX_INT32 maxIndividualVariance)
+int32_t CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const int32_t *pattern, int32_t maxIndividualVariance)
{
- FX_INT32 numCounters = counters->GetSize();
- FX_INT32 total = 0;
- FX_INT32 patternLength = 0;
- for (FX_INT32 i = 0; i < numCounters; i++) {
+ int32_t numCounters = counters->GetSize();
+ int32_t total = 0;
+ int32_t patternLength = 0;
+ for (int32_t i = 0; i < numCounters; i++) {
total += (*counters)[i];
patternLength += pattern[i];
}
@@ -162,13 +162,13 @@ FX_INT32 CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const FX #undef max
return FXSYS_IntMax;
}
- FX_INT32 unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
+ int32_t unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT;
- FX_INT32 totalVariance = 0;
- for (FX_INT32 x = 0; x < numCounters; x++) {
- FX_INT32 counter = (*counters)[x] << INTEGER_MATH_SHIFT;
- FX_INT32 scaledPattern = pattern[x] * unitBarWidth;
- FX_INT32 variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;
+ int32_t totalVariance = 0;
+ for (int32_t x = 0; x < numCounters; x++) {
+ int32_t counter = (*counters)[x] << INTEGER_MATH_SHIFT;
+ int32_t scaledPattern = pattern[x] * unitBarWidth;
+ int32_t variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;
if (variance > maxIndividualVariance) {
#undef max
return FXSYS_IntMax;
diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.h b/xfa/src/fxbarcode/oned/BC_OneDReader.h index 8645c9edf9..064f5edae0 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDReader.h @@ -15,20 +15,20 @@ class CBC_OneDReader : public CBC_Reader public:
CBC_OneDReader();
virtual ~CBC_OneDReader();
- virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
- virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
- virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e);
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e);
+ virtual CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
return "";
}
private:
- CFX_ByteString DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DeDecode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e);
protected:
- const static FX_INT32 INTEGER_MATH_SHIFT;
- const static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR;
- void RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e);
- void RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e);
- FX_INT32 PatternMatchVariance(CFX_Int32Array *counters, const FX_INT32 *pattern, FX_INT32 maxIndividualVariance);
+ const static int32_t INTEGER_MATH_SHIFT;
+ const static int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR;
+ void RecordPattern(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e);
+ void RecordPatternInReverse(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e);
+ int32_t PatternMatchVariance(CFX_Int32Array *counters, const int32_t *pattern, int32_t maxIndividualVariance);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp index f1db94a6a1..a2dd7a1972 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp @@ -25,11 +25,11 @@ #include "../common/BC_CommonBitArray.h"
#include "BC_OneDReader.h"
#include "BC_OneDimReader.h"
-const FX_INT32 CBC_OneDimReader::MAX_AVG_VARIANCE = (FX_INT32)(256 * 0.48f);
-const FX_INT32 CBC_OneDimReader::MAX_INDIVIDUAL_VARIANCE = (FX_INT32)(256 * 0.7f);
-const FX_INT32 CBC_OneDimReader::START_END_PATTERN[3] = {1, 1, 1};
-const FX_INT32 CBC_OneDimReader::MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1};
-const FX_INT32 CBC_OneDimReader::L_PATTERNS[10][4] = {
+const int32_t CBC_OneDimReader::MAX_AVG_VARIANCE = (int32_t)(256 * 0.48f);
+const int32_t CBC_OneDimReader::MAX_INDIVIDUAL_VARIANCE = (int32_t)(256 * 0.7f);
+const int32_t CBC_OneDimReader::START_END_PATTERN[3] = {1, 1, 1};
+const int32_t CBC_OneDimReader::MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1};
+const int32_t CBC_OneDimReader::L_PATTERNS[10][4] = {
{3, 2, 1, 1},
{2, 2, 2, 1},
{2, 1, 2, 2},
@@ -41,7 +41,7 @@ const FX_INT32 CBC_OneDimReader::L_PATTERNS[10][4] = { {1, 2, 1, 3},
{3, 1, 1, 2}
};
-const FX_INT32 CBC_OneDimReader::L_AND_G_PATTERNS[20][4] = {
+const int32_t CBC_OneDimReader::L_AND_G_PATTERNS[20][4] = {
{3, 2, 1, 1},
{2, 2, 2, 1},
{2, 1, 2, 2},
@@ -69,7 +69,7 @@ CBC_OneDimReader::CBC_OneDimReader() CBC_OneDimReader::~CBC_OneDimReader()
{
}
-CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e)
+CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, int32_t &e)
{
FX_BOOL foundStart = FALSE;
CFX_Int32Array *startRange = NULL;
@@ -78,7 +78,7 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, startEndPattern[0] = START_END_PATTERN[0];
startEndPattern[1] = START_END_PATTERN[1];
startEndPattern[2] = START_END_PATTERN[2];
- FX_INT32 nextStart = 0;
+ int32_t nextStart = 0;
while (!foundStart) {
if(startRange != NULL) {
delete startRange;
@@ -86,12 +86,12 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, }
startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 start = (*startRange)[0];
+ int32_t start = (*startRange)[0];
nextStart = (*startRange)[1];
if (start <= 1) {
break;
}
- FX_INT32 quietStart = start - (nextStart - start);
+ int32_t quietStart = start - (nextStart - start);
if (quietStart >= 0) {
FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -100,7 +100,7 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, }
return startRange;
}
-CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OneDimReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
CFX_Int32Array* StartPattern = FindStartGuardPattern(row, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -109,10 +109,10 @@ CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArra BC_EXCEPTION_CHECK_ReturnValue(e, "");
return temp;
}
-CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OneDimReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e)
{
CFX_ByteString result;
- FX_INT32 endStart = DecodeMiddle(row, startGuardRange, result, e);
+ int32_t endStart = DecodeMiddle(row, startGuardRange, result, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
FX_BOOL b = CheckChecksum(result, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -122,21 +122,21 @@ CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArra }
return result;
}
-FX_BOOL CBC_OneDimReader::CheckChecksum(CFX_ByteString &s, FX_INT32 &e)
+FX_BOOL CBC_OneDimReader::CheckChecksum(CFX_ByteString &s, int32_t &e)
{
FX_BOOL temp = CheckStandardUPCEANChecksum(s, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return temp;
}
-FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e)
+FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, int32_t &e)
{
- FX_INT32 length = s.GetLength();
+ int32_t length = s.GetLength();
if (length == 0) {
return FALSE;
}
- FX_INT32 sum = 0;
- for (FX_INT32 i = length - 2; i >= 0; i -= 2) {
- FX_INT32 digit = (FX_INT32) s[i] - (FX_INT32) '0';
+ int32_t sum = 0;
+ for (int32_t i = length - 2; i >= 0; i -= 2) {
+ int32_t digit = (int32_t) s[i] - (int32_t) '0';
if (digit < 0 || digit > 9) {
e = BCExceptionFormatException;
return FALSE;
@@ -144,8 +144,8 @@ FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT3 sum += digit;
}
sum *= 3;
- for (FX_INT32 j = length - 1; j >= 0; j -= 2) {
- FX_INT32 digit = (FX_INT32) s[j] - (FX_INT32) '0';
+ for (int32_t j = length - 1; j >= 0; j -= 2) {
+ int32_t digit = (int32_t) s[j] - (int32_t) '0';
if (digit < 0 || digit > 9) {
e = BCExceptionFormatException;
return FALSE;
@@ -154,7 +154,7 @@ FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT3 }
return sum % 10 == 0;
}
-CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, FX_INT32 endStart, FX_INT32 &e)
+CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, int32_t endStart, int32_t &e)
{
CFX_Int32Array startEndPattern;
startEndPattern.Add(START_END_PATTERN[0]);
@@ -164,12 +164,12 @@ CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, FX_INT32 en BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return FindGuard;
}
-CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e)
+CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, int32_t rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, int32_t &e)
{
- FX_INT32 patternLength = pattern->GetSize();
+ int32_t patternLength = pattern->GetSize();
CFX_Int32Array counters;
counters.SetSize(patternLength);
- FX_INT32 width = row->GetSize();
+ int32_t width = row->GetSize();
FX_BOOL isWhite = FALSE;
while (rowOffset < width) {
isWhite = !row->Get(rowOffset);
@@ -178,9 +178,9 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I }
rowOffset++;
}
- FX_INT32 counterPosition = 0;
- FX_INT32 patternStart = rowOffset;
- for (FX_INT32 x = rowOffset; x < width; x++) {
+ int32_t counterPosition = 0;
+ int32_t patternStart = rowOffset;
+ for (int32_t x = rowOffset; x < width; x++) {
FX_BOOL pixel = row->Get(x);
if (pixel ^ isWhite) {
counters[counterPosition]++;
@@ -194,7 +194,7 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I return result;
}
patternStart += counters[0] + counters[1];
- for (FX_INT32 y = 2; y < patternLength; y++) {
+ for (int32_t y = 2; y < patternLength; y++) {
counters[y - 2] = counters[y];
}
counters[patternLength - 2] = 0;
@@ -211,15 +211,15 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return NULL;
}
-FX_INT32 CBC_OneDimReader::DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e)
+int32_t CBC_OneDimReader::DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, const int32_t* patterns, int32_t patternLength, int32_t &e)
{
RecordPattern(row, rowOffset, counters, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
- FX_INT32 bestVariance = MAX_AVG_VARIANCE;
- FX_INT32 bestMatch = -1;
- FX_INT32 max = patternLength;
- for (FX_INT32 i = 0; i < max; i++) {
- FX_INT32 variance = PatternMatchVariance(counters, &patterns[i * 4], MAX_INDIVIDUAL_VARIANCE);
+ int32_t bestVariance = MAX_AVG_VARIANCE;
+ int32_t bestMatch = -1;
+ int32_t max = patternLength;
+ for (int32_t i = 0; i < max; i++) {
+ int32_t variance = PatternMatchVariance(counters, &patterns[i * 4], MAX_INDIVIDUAL_VARIANCE);
if (variance < bestVariance) {
bestVariance = variance;
bestMatch = i;
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.h b/xfa/src/fxbarcode/oned/BC_OneDimReader.h index bb10060ba3..2e644de841 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.h @@ -12,28 +12,28 @@ class CBC_OneDimReader; class CBC_OneDimReader : public CBC_OneDReader
{
private:
- const static FX_INT32 MAX_AVG_VARIANCE;
- const static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
+ const static int32_t MAX_AVG_VARIANCE;
+ const static int32_t MAX_INDIVIDUAL_VARIANCE;
- FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e);
+ FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, int32_t &e);
public:
- const static FX_INT32 START_END_PATTERN[3];
- const static FX_INT32 MIDDLE_PATTERN[5];
- const static FX_INT32 L_PATTERNS[10][4];
- const static FX_INT32 L_AND_G_PATTERNS[20][4];
+ const static int32_t START_END_PATTERN[3];
+ const static int32_t MIDDLE_PATTERN[5];
+ const static int32_t L_PATTERNS[10][4];
+ const static int32_t L_AND_G_PATTERNS[20][4];
CBC_OneDimReader();
virtual ~CBC_OneDimReader();
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e);
protected:
- CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e);
- virtual FX_BOOL CheckChecksum(CFX_ByteString &s, FX_INT32 &e);
- CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e);
- FX_INT32 DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e);
- virtual FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, FX_INT32 &e)
+ CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, int32_t &e);
+ virtual FX_BOOL CheckChecksum(CFX_ByteString &s, int32_t &e);
+ CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, int32_t rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, int32_t &e);
+ int32_t DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, const int32_t* patterns, int32_t patternLength, int32_t &e);
+ virtual int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, int32_t &e)
{
return 0;
}
- virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, FX_INT32 endStart, FX_INT32 &e);
+ virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, int32_t endStart, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp index 25f3fa5f6c..a1554a8047 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp @@ -50,11 +50,11 @@ void CBC_OneDimWriter::SetPrintChecksum(FX_BOOL checksum) {
m_bPrintChecksum = checksum;
}
-void CBC_OneDimWriter::SetDataLength(FX_INT32 length)
+void CBC_OneDimWriter::SetDataLength(int32_t length)
{
m_iDataLenth = length;
}
-void CBC_OneDimWriter::SetCalcChecksum(FX_INT32 state)
+void CBC_OneDimWriter::SetCalcChecksum(int32_t state)
{
m_bCalcChecksum = state;
}
@@ -70,7 +70,7 @@ void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) {
m_fFontSize = size;
}
-void CBC_OneDimWriter::SetFontStyle(FX_INT32 style)
+void CBC_OneDimWriter::SetFontStyle(int32_t style)
{
m_iFontStyle = style;
}
@@ -85,10 +85,10 @@ FX_WCHAR CBC_OneDimWriter::Upper(FX_WCHAR ch) }
return ch;
}
-FX_BYTE* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
- FX_BYTE *ret = NULL;
+ uint8_t *ret = NULL;
outHeight = 1;
if (m_Width >= 20) {
ret = Encode(contents, outWidth, e);
@@ -98,23 +98,23 @@ FX_BYTE* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT forma BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_INT32 CBC_OneDimWriter::AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX_INT32* pattern , FX_INT32 patternLength, FX_INT32 startColor, FX_INT32 &e)
+int32_t CBC_OneDimWriter::AppendPattern(uint8_t* target, int32_t pos, const int32_t* pattern , int32_t patternLength, int32_t startColor, int32_t &e)
{
if (startColor != 0 && startColor != 1) {
e = BCExceptionValueMustBeEither0or1;
return 0;
}
- FX_BYTE color = (FX_BYTE) startColor;
- FX_INT32 numAdded = 0;
- for (FX_INT32 i = 0; i < patternLength; i++) {
- for (FX_INT32 j = 0; j < pattern[i]; j++) {
+ uint8_t color = (uint8_t) startColor;
+ int32_t numAdded = 0;
+ for (int32_t i = 0; i < patternLength; i++) {
+ for (int32_t j = 0; j < pattern[i]; j++) {
target[pos] = color;
pos += 1;
numAdded += 1;
@@ -123,20 +123,20 @@ FX_INT32 CBC_OneDimWriter::AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX }
return numAdded;
}
-void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, FX_INT32 fontSize, FX_FLOAT &charsLen)
+void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, int32_t fontSize, FX_FLOAT &charsLen)
{
#ifdef FXFM_ENCODING_NONE
IFX_FontEncodingEx* encoding = FX_CreateFontEncodingEx(cFont);
#else
IFX_FontEncoding * encoding = FXGE_CreateUnicodeEncoding(cFont);
#endif
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_DWORD *pCharCode = FX_Alloc(FX_DWORD, text.GetLength());
FX_FLOAT charWidth = 0;
- for (FX_INT32 j = 0; j < text.GetLength(); j++) {
+ for (int32_t j = 0; j < text.GetLength(); j++) {
pCharCode[j] = encoding->CharCodeFromUnicode(text[j]);
- FX_INT32 glyp_code = encoding->GlyphFromCharCode(pCharCode[j]);
- FX_INT32 glyp_value = cFont->GetGlyphWidth(glyp_code);
+ int32_t glyp_code = encoding->GlyphFromCharCode(pCharCode[j]);
+ int32_t glyp_value = cFont->GetGlyphWidth(glyp_code);
FX_FLOAT temp = (FX_FLOAT)((glyp_value) * fontSize / 1000.0);
charWidth += temp;
}
@@ -157,7 +157,7 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS * charPos[0].m_ExtGID = charPos[0].m_GlyphIndex;
#endif
penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * (FX_FLOAT)fontSize / 1000.0f;
- for (FX_INT32 i = 1; i < length; i++) {
+ for (int32_t i = 1; i < length; i++) {
charPos[i].m_OriginX = penX + left;
charPos[i].m_OriginY = penY + top;
charPos[i].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[i]);
@@ -171,10 +171,10 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS * delete encoding;
encoding = NULL;
}
-void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth)
+void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth)
{
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
CFX_FloatRect rect((FX_FLOAT)locX, (FX_FLOAT)locY, (FX_FLOAT)(locX + geWidth), (FX_FLOAT)(locY + iTextHeight));
if (geWidth != m_Width) {
rect.right -= 1;
@@ -194,10 +194,10 @@ void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matri (CFX_AffineMatrix *) &affine_matrix,
m_fontColor, FXTEXT_CLEARTYPE);
}
-void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth)
+void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth)
{
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
CFX_FxgeDevice ge;
ge.Create((int)geWidth, iTextHeight , m_colorSpace);
FX_RECT geRect(0, 0, (int)geWidth, iTextHeight);
@@ -214,7 +214,7 @@ void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteS geBitmap.Attach(pOutBitmap);
geBitmap.SetDIBits(ge.GetBitmap(), (int)locX, (int)locY);
}
-void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e)
+void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e)
{
if (device == NULL && pOutBitmap == NULL) {
e = BCExceptionIllegalArgument;
@@ -225,7 +225,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX return;
}
CFX_ByteString str = FX_UTF8Encode(contents);
- FX_INT32 iLen = str.GetLength();
+ int32_t iLen = str.GetLength();
FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen);
if (!pCharPos) {
return;
@@ -240,17 +240,17 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX m_locTextLoc == BC_TEXT_LOC_BELOW ) {
geWidth = (FX_FLOAT)barWidth;
}
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
CalcTextInfo(str, pCharPos, m_pFont, geWidth, iFontSize, charsLen);
if (charsLen < 1) {
return;
}
- FX_INT32 locX = 0;
- FX_INT32 locY = 0;
+ int32_t locX = 0;
+ int32_t locY = 0;
switch (m_locTextLoc) {
case BC_TEXT_LOC_ABOVEEMBED:
- locX = (FX_INT32)(barWidth - charsLen) / 2;
+ locX = (int32_t)(barWidth - charsLen) / 2;
locY = 0;
geWidth = charsLen;
break;
@@ -260,7 +260,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX geWidth = (FX_FLOAT)barWidth;
break;
case BC_TEXT_LOC_BELOWEMBED:
- locX = (FX_INT32)(barWidth - charsLen) / 2;
+ locX = (int32_t)(barWidth - charsLen) / 2;
locY = m_Height - iTextHeight;
geWidth = charsLen;
break;
@@ -278,7 +278,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX }
FX_Free(pCharPos);
}
-void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, FX_INT32 &e)
+void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, int32_t &e)
{
if (m_output == NULL) {
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -289,14 +289,14 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR con e = BCExceptionFailToCreateBitmap;
return;
}
- for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {
- for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {
+ for (int32_t x = 0; x < m_output->GetWidth(); x++) {
+ for (int32_t y = 0; y < m_output->GetHeight(); y++) {
if (m_output->Get(x, y)) {
pOutBitmap->SetPixel(x, y, m_barColor);
}
}
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < contents.GetLength(); i++)
if (contents.GetAt(i) != ' ') {
break;
@@ -311,7 +311,7 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR con }
pOutBitmap = pStretchBitmap;
}
-void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, FX_INT32 &e)
+void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, int32_t &e)
{
if (m_output == NULL) {
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -322,8 +322,8 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE);
CFX_Matrix matri(m_outputHScale, 0.0, 0.0, (FX_FLOAT)m_Height, 0.0, 0.0);
matri.Concat(*matrix);
- for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {
- for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {
+ for (int32_t x = 0; x < m_output->GetWidth(); x++) {
+ for (int32_t y = 0; y < m_output->GetHeight(); y++) {
CFX_PathData rect;
rect.AppendRect((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)(x + 1), (FX_FLOAT)(y + 1));
CFX_GraphStateData stateData;
@@ -332,7 +332,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma }
}
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < contents.GetLength(); i++)
if (contents.GetAt(i) != ' ') {
break;
@@ -342,7 +342,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OneDimWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
if (codeLength < 1) {
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -350,9 +350,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co if (m_ModuleHeight < 20.0) {
m_ModuleHeight = 20;
}
- FX_INT32 codeOldLength = codeLength;
- FX_INT32 leftPadding = 0;
- FX_INT32 rightPadding = 0;
+ int32_t codeOldLength = codeLength;
+ int32_t leftPadding = 0;
+ int32_t rightPadding = 0;
if (m_bLeftPadding) {
leftPadding = 7;
}
@@ -377,9 +377,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co }
m_multiple = 1;
if (!isDevice) {
- m_multiple = (FX_INT32)ceil(m_outputHScale * dataLengthScale);
+ m_multiple = (int32_t)ceil(m_outputHScale * dataLengthScale);
}
- FX_INT32 outputHeight = 1;
+ int32_t outputHeight = 1;
if (!isDevice) {
if (m_Height == 0) {
outputHeight = FX_MAX(20, m_ModuleHeight);
@@ -387,9 +387,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co outputHeight = m_Height;
}
}
- FX_INT32 outputWidth = codeLength;
+ int32_t outputWidth = codeLength;
if (!isDevice) {
- outputWidth = (FX_INT32)(codeLength * m_multiple / dataLengthScale);
+ outputWidth = (int32_t)(codeLength * m_multiple / dataLengthScale);
}
m_barWidth = m_Width;
if (!isDevice) {
@@ -397,8 +397,8 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co }
m_output = FX_NEW CBC_CommonBitMatrix;
m_output->Init(outputWidth, outputHeight);
- FX_INT32 outputX = leftPadding * m_multiple;
- for (FX_INT32 inputX = 0; inputX < codeOldLength; inputX++) {
+ int32_t outputX = leftPadding * m_multiple;
+ for (int32_t inputX = 0; inputX < codeOldLength; inputX++) {
if (code[inputX] == 1) {
if (outputX >= outputWidth ) {
break;
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.h b/xfa/src/fxbarcode/oned/BC_OneDimWriter.h index cd5d937aca..aeb19e0081 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.h @@ -14,17 +14,17 @@ class CBC_OneDimWriter : public CBC_Writer public:
CBC_OneDimWriter();
virtual ~CBC_OneDimWriter();
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- virtual FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e)
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ virtual uint8_t *Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e)
{
return NULL;
};
- virtual void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
- virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, FX_INT32 &e);
- virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, FX_INT32 &e);
+ virtual void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
+ virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, int32_t &e);
+ virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, int32_t &e);
virtual FX_BOOL CheckContentValidity(FX_WSTR contents)
{
return TRUE;
@@ -38,33 +38,33 @@ public: return CFX_WideString();
}
virtual void SetPrintChecksum(FX_BOOL checksum);
- virtual void SetDataLength(FX_INT32 length);
- virtual void SetCalcChecksum(FX_INT32 state);
+ virtual void SetDataLength(int32_t length);
+ virtual void SetCalcChecksum(int32_t state);
virtual void SetFontSize(FX_FLOAT size);
- virtual void SetFontStyle(FX_INT32 style);
+ virtual void SetFontStyle(int32_t style);
virtual void SetFontColor(FX_ARGB color);
virtual FX_BOOL SetFont(CFX_Font * cFont);
protected:
FX_BOOL m_bPrintChecksum;
- FX_INT32 m_iDataLenth;
+ int32_t m_iDataLenth;
FX_BOOL m_bCalcChecksum;
CFX_Font* m_pFont;
FX_FLOAT m_fFontSize;
- FX_INT32 m_iFontStyle;
+ int32_t m_iFontStyle;
FX_DWORD m_fontColor;
BC_TEXT_LOC m_locTextLoc;
- FX_INT32 m_iContentLen;
+ int32_t m_iContentLen;
FX_BOOL m_bLeftPadding;
FX_BOOL m_bRightPadding;
CBC_CommonBitMatrix* m_output;
- FX_INT32 m_barWidth;
- FX_INT32 m_multiple;
+ int32_t m_barWidth;
+ int32_t m_multiple;
FX_FLOAT m_outputHScale;
- void CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, FX_INT32 fontSize, FX_FLOAT &charsLen);
- virtual void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
- virtual void ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth);
- virtual void ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth);
- FX_INT32 AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX_INT32* pattern, FX_INT32 patternLength, FX_INT32 startColor, FX_INT32 &e);
+ void CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, int32_t fontSize, FX_FLOAT &charsLen);
+ virtual void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e);
+ virtual void ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth);
+ virtual void ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth);
+ int32_t AppendPattern(uint8_t* target, int32_t pos, const int32_t* pattern, int32_t patternLength, int32_t startColor, int32_t &e);
FX_WCHAR Upper(FX_WCHAR ch);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp index 5d94d7ac06..ca115391ef 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp @@ -27,12 +27,12 @@ #include "../oned/BC_OnedCode39Reader.h"
#include "../oned/BC_OnedCodaBarReader.h"
FX_LPCSTR CBC_OnedCodaBarReader::ALPHABET_STRING = "0123456789-$:/.+ABCDTN";
-const FX_INT32 CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = {
+const int32_t CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = {
0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, 0x030, 0x048,
0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, 0x01A, 0x029, 0x00B, 0x00E,
0x01A, 0x029
};
-const FX_INT32 CBC_OnedCodaBarReader::minCharacterLength = 3;
+const int32_t CBC_OnedCodaBarReader::minCharacterLength = 3;
const FX_CHAR CBC_OnedCodaBarReader::STARTEND_ENCODING[8] = {'E', '*', 'A', 'B', 'C', 'D', 'T', 'N'};
CBC_OnedCodaBarReader::CBC_OnedCodaBarReader()
{
@@ -40,14 +40,14 @@ CBC_OnedCodaBarReader::CBC_OnedCodaBarReader() CBC_OnedCodaBarReader::~CBC_OnedCodaBarReader()
{
}
-CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
CFX_Int32Array *int32Ptr = FindAsteriskPattern(row, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
CBC_AutoPtr<CFX_Int32Array> start(int32Ptr);
(*start)[1] = 0;
- FX_INT32 nextStart = (*start)[1];
- FX_INT32 end = row->GetSize();
+ int32_t nextStart = (*start)[1];
+ int32_t end = row->GetSize();
while (nextStart < end && !row->Get(nextStart)) {
nextStart++;
}
@@ -55,7 +55,7 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi CFX_Int32Array counters;
counters.SetSize(7);
FX_CHAR decodedChar;
- FX_INT32 lastStart;
+ int32_t lastStart;
do {
RecordPattern(row, nextStart, &counters, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -66,18 +66,18 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi }
result += decodedChar;
lastStart = nextStart;
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
nextStart += counters[i];
}
while (nextStart < end && !row->Get(nextStart)) {
nextStart++;
}
} while (nextStart < end);
- FX_INT32 lastPatternSize = 0;
- for (FX_INT32 j = 0; j < counters.GetSize(); j++) {
+ int32_t lastPatternSize = 0;
+ for (int32_t j = 0; j < counters.GetSize(); j++) {
lastPatternSize += counters[j];
}
- FX_INT32 whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
+ int32_t whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
if (nextStart != end && (whiteSpaceAfterEnd / 2 < lastPatternSize)) {
e = BCExceptionNotFound;
return "";
@@ -91,9 +91,9 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi e = BCExceptionNotFound;
return "";
}
- FX_INT32 len = result.GetLength();
+ int32_t len = result.GetLength();
CFX_ByteString temp = result;
- for (FX_INT32 k = 1; k < result.GetLength(); k++) {
+ for (int32_t k = 1; k < result.GetLength(); k++) {
if (ArrayContains(STARTEND_ENCODING, result[k])) {
if ((k + 1) != result.GetLength()) {
result.Delete(1, k);
@@ -102,7 +102,7 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi }
}
if (result.GetLength() < 5) {
- FX_INT32 index = temp.Find(result.Mid(1, result.GetLength() - 1));
+ int32_t index = temp.Find(result.Mid(1, result.GetLength() - 1));
if (index == len - (result.GetLength() - 1)) {
e = BCExceptionNotFound;
return "";
@@ -116,23 +116,23 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi }
return result;
}
-CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e)
+CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e)
{
- FX_INT32 width = row->GetSize();
- FX_INT32 rowOffset = 0;
+ int32_t width = row->GetSize();
+ int32_t rowOffset = 0;
while (rowOffset < width) {
if (row->Get(rowOffset)) {
break;
}
rowOffset++;
}
- FX_INT32 counterPosition = 0;
+ int32_t counterPosition = 0;
CFX_Int32Array counters;
counters.SetSize(7);
- FX_INT32 patternStart = rowOffset;
+ int32_t patternStart = rowOffset;
FX_BOOL isWhite = FALSE;
- FX_INT32 patternLength = counters.GetSize();
- for (FX_INT32 i = rowOffset; i < width; i++) {
+ int32_t patternLength = counters.GetSize();
+ for (int32_t i = rowOffset; i < width; i++) {
FX_BOOL pixel = row->Get(i);
if (pixel ^ isWhite) {
counters[counterPosition]++;
@@ -150,7 +150,7 @@ CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *r }
}
patternStart += counters[0] + counters[1];
- for (FX_INT32 y = 2; y < patternLength; y++) {
+ for (int32_t y = 2; y < patternLength; y++) {
counters[y - 2] = counters[y];
}
counters[patternLength - 2] = 0;
@@ -168,7 +168,7 @@ CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *r }
FX_BOOL CBC_OnedCodaBarReader::ArrayContains(const FX_CHAR array[], FX_CHAR key)
{
- for(FX_INT32 i = 0; i < 8; i++) {
+ for(int32_t i = 0; i < 8; i++) {
if(array[i] == key) {
return TRUE;
}
@@ -177,26 +177,26 @@ FX_BOOL CBC_OnedCodaBarReader::ArrayContains(const FX_CHAR array[], FX_CHAR key) }
FX_CHAR CBC_OnedCodaBarReader::ToNarrowWidePattern(CFX_Int32Array *counter)
{
- FX_INT32 numCounters = counter->GetSize();
+ int32_t numCounters = counter->GetSize();
if (numCounters < 1) {
return '!';
}
- FX_INT32 averageCounter = 0;
- FX_INT32 totalCounters = 0;
- for (FX_INT32 i = 0; i < numCounters; i++) {
+ int32_t averageCounter = 0;
+ int32_t totalCounters = 0;
+ for (int32_t i = 0; i < numCounters; i++) {
totalCounters += (*counter)[i];
}
averageCounter = totalCounters / numCounters;
- FX_INT32 pattern = 0;
- FX_INT32 wideCounters = 0;
- for (FX_INT32 j = 0; j < numCounters; j++) {
+ int32_t pattern = 0;
+ int32_t wideCounters = 0;
+ for (int32_t j = 0; j < numCounters; j++) {
if ((*counter)[j] > averageCounter) {
pattern |= 1 << (numCounters - 1 - j);
wideCounters++;
}
}
if ((wideCounters == 2) || (wideCounters == 3)) {
- for (FX_INT32 k = 0; k < 22; k++) {
+ for (int32_t k = 0; k < 22; k++) {
if (CHARACTER_ENCODINGS[k] == pattern) {
return (ALPHABET_STRING)[k];
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h index 1d03491841..18aab8ba8d 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h @@ -14,16 +14,16 @@ class CBC_OnedCodaBarReader : public CBC_OneDReader public:
CBC_OnedCodaBarReader();
virtual ~CBC_OnedCodaBarReader();
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
- CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e);
+ CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e);
FX_BOOL ArrayContains(const FX_CHAR array[], FX_CHAR key);
FX_CHAR ToNarrowWidePattern(CFX_Int32Array *counter);
static FX_LPCSTR ALPHABET_STRING;
- const static FX_INT32 CHARACTER_ENCODINGS[22];
+ const static int32_t CHARACTER_ENCODINGS[22];
- const static FX_INT32 minCharacterLength;
+ const static int32_t minCharacterLength;
const static FX_CHAR STARTEND_ENCODING[8];
};
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp index 059d2d7df5..0049a54f7c 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp @@ -42,7 +42,7 @@ CBC_OnedCodaBarWriter::~CBC_OnedCodaBarWriter() }
FX_BOOL CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start)
{
- for (FX_INT32 i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) {
+ for (int32_t i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) {
if (START_END_CHARS[i] == start) {
m_chStart = start;
return TRUE;
@@ -52,7 +52,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) }
FX_BOOL CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end)
{
- for (FX_INT32 i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) {
+ for (int32_t i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) {
if (START_END_CHARS[i] == end) {
m_chEnd = end;
return TRUE;
@@ -60,7 +60,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) }
return FALSE;
}
-void CBC_OnedCodaBarWriter::SetDataLength(FX_INT32 length)
+void CBC_OnedCodaBarWriter::SetDataLength(int32_t length)
{
m_iDataLenth = length + 2;
}
@@ -72,7 +72,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location;
return TRUE;
}
-FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(FX_INT32 ratio)
+FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(int32_t ratio)
{
if(ratio < 2 || ratio > 3) {
return FALSE;
@@ -83,19 +83,19 @@ FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(FX_INT32 ratio) FX_BOOL CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, FX_BOOL isContent)
{
if(isContent) {
- for(FX_INT32 i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) {
+ for(int32_t i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) {
if(ch == (FX_WCHAR)CONTENT_CHARS[i]) {
return TRUE;
}
}
- for(FX_INT32 j = 0 ; j < sizeof(START_END_CHARS) / sizeof(FX_CHAR) ; j++) {
+ for(int32_t j = 0 ; j < sizeof(START_END_CHARS) / sizeof(FX_CHAR) ; j++) {
if(ch == (FX_WCHAR)START_END_CHARS[j]) {
return TRUE;
}
}
return FALSE;
} else {
- for(FX_INT32 i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) {
+ for(int32_t i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) {
if(ch == (FX_WCHAR)CONTENT_CHARS[i]) {
return TRUE;
}
@@ -106,7 +106,7 @@ FX_BOOL CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, FX_BOOL isContent) FX_BOOL CBC_OnedCodaBarWriter::CheckContentValidity(FX_WSTR contents)
{
FX_WCHAR ch;
- FX_INT32 index = 0;
+ int32_t index = 0;
for (index = 0; index < contents.GetLength(); index++) {
ch = contents.GetAt(index);
if (FindChar(ch, FALSE)) {
@@ -121,7 +121,7 @@ CFX_WideString CBC_OnedCodaBarWriter::FilterContents(FX_WSTR contents) {
CFX_WideString filtercontents;
FX_WCHAR ch;
- for (FX_INT32 index = 0; index < contents.GetLength(); index ++) {
+ for (int32_t index = 0; index < contents.GetLength(); index ++) {
ch = contents.GetAt(index);
if(ch > 175) {
index++;
@@ -135,31 +135,31 @@ CFX_WideString CBC_OnedCodaBarWriter::FilterContents(FX_WSTR contents) }
return filtercontents;
}
-FX_BYTE *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0 , e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0 , e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
if(format != BCFORMAT_CODABAR) {
e = BCExceptionOnlyEncodeCODEBAR;
return NULL;
}
- FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
+ uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e)
+uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e)
{
CBC_OnedCodaBarReader CodaBarR;
CFX_ByteString data = m_chStart + contents + m_chEnd;
m_iContentLen = data.GetLength();
- FX_BYTE *result = FX_Alloc(FX_BYTE, m_iWideNarrRatio * 7 * data.GetLength());
+ uint8_t *result = FX_Alloc(uint8_t, m_iWideNarrRatio * 7 * data.GetLength());
FX_CHAR ch;
- FX_INT32 position = 0;
- for (FX_INT32 index = 0; index < data.GetLength(); index++) {
+ int32_t position = 0;
+ for (int32_t index = 0; index < data.GetLength(); index++) {
ch = data.GetAt(index);
if (((ch >= 'a') && (ch <= 'z'))) {
ch = ch - 32;
@@ -180,17 +180,17 @@ FX_BYTE* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, FX_INT32 default:
break;
}
- FX_INT32 code = 0;
- FX_INT32 len = (FX_INT32)strlen(CodaBarR.ALPHABET_STRING);
- for (FX_INT32 i = 0; i < len; i++) {
+ int32_t code = 0;
+ int32_t len = (int32_t)strlen(CodaBarR.ALPHABET_STRING);
+ for (int32_t i = 0; i < len; i++) {
if (ch == CodaBarR.ALPHABET_STRING[i]) {
code = CodaBarR.CHARACTER_ENCODINGS[i];
break;
}
}
- FX_BYTE color = 1;
- FX_INT32 counter = 0;
- FX_INT32 bit = 0;
+ uint8_t color = 1;
+ int32_t counter = 0;
+ int32_t bit = 0;
while (bit < 7) {
result[position] = color;
position++;
@@ -216,7 +216,7 @@ CFX_WideString CBC_OnedCodaBarWriter::encodedContents(FX_WSTR contents) CFX_WideString strEnd(m_chEnd);
return strStart + contents + strEnd;
}
-void CBC_OnedCodaBarWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OnedCodaBarWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
CBC_OneDimWriter::RenderResult(encodedContents(contents), code, codeLength, isDevice, e);
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h index b81839ca4a..c5c54b849f 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h @@ -14,25 +14,25 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter public:
CBC_OnedCodaBarWriter();
virtual ~CBC_OnedCodaBarWriter();
- FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ uint8_t* Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e);
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
CFX_WideString encodedContents(FX_WSTR contents);
FX_BOOL CheckContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
FX_BOOL SetStartChar(FX_CHAR start);
FX_BOOL SetEndChar(FX_CHAR end);
- void SetDataLength(FX_INT32 length);
+ void SetDataLength(int32_t length);
FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ FX_BOOL SetWideNarrowRatio(int32_t ratio);
FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent);
private:
- void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
const static FX_CHAR START_END_CHARS[];
const static FX_CHAR CONTENT_CHARS[];
FX_CHAR m_chStart;
FX_CHAR m_chEnd;
- FX_INT32 m_iWideNarrRatio;
+ int32_t m_iWideNarrRatio;
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp index 9dd9f629cf..d1f453345b 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp @@ -25,7 +25,7 @@ #include "../common/BC_CommonBitArray.h"
#include "BC_OneDReader.h"
#include "BC_OnedCode128Reader.h"
-const FX_INT32 CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = {
+const int32_t CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = {
{2, 1, 2, 2, 2, 2, 0},
{2, 2, 2, 1, 2, 2, 0},
{2, 2, 2, 2, 2, 1, 0},
@@ -134,53 +134,53 @@ const FX_INT32 CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = { {2, 1, 1, 2, 3, 2, 0},
{2, 3, 3, 1, 1, 1, 2}
};
-const FX_INT32 CBC_OnedCode128Reader::MAX_AVG_VARIANCE = (FX_INT32) (256 * 0.25f);
-const FX_INT32 CBC_OnedCode128Reader::MAX_INDIVIDUAL_VARIANCE = (FX_INT32) (256 * 0.7f);
-const FX_INT32 CBC_OnedCode128Reader::CODE_SHIFT = 98;
-const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_C = 99;
-const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_B = 100;
-const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_A = 101;
-const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_1 = 102;
-const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_2 = 97;
-const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_3 = 96;
-const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_4_A = 101;
-const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_4_B = 100;
-const FX_INT32 CBC_OnedCode128Reader::CODE_START_A = 103;
-const FX_INT32 CBC_OnedCode128Reader::CODE_START_B = 104;
-const FX_INT32 CBC_OnedCode128Reader::CODE_START_C = 105;
-const FX_INT32 CBC_OnedCode128Reader::CODE_STOP = 106;
+const int32_t CBC_OnedCode128Reader::MAX_AVG_VARIANCE = (int32_t) (256 * 0.25f);
+const int32_t CBC_OnedCode128Reader::MAX_INDIVIDUAL_VARIANCE = (int32_t) (256 * 0.7f);
+const int32_t CBC_OnedCode128Reader::CODE_SHIFT = 98;
+const int32_t CBC_OnedCode128Reader::CODE_CODE_C = 99;
+const int32_t CBC_OnedCode128Reader::CODE_CODE_B = 100;
+const int32_t CBC_OnedCode128Reader::CODE_CODE_A = 101;
+const int32_t CBC_OnedCode128Reader::CODE_FNC_1 = 102;
+const int32_t CBC_OnedCode128Reader::CODE_FNC_2 = 97;
+const int32_t CBC_OnedCode128Reader::CODE_FNC_3 = 96;
+const int32_t CBC_OnedCode128Reader::CODE_FNC_4_A = 101;
+const int32_t CBC_OnedCode128Reader::CODE_FNC_4_B = 100;
+const int32_t CBC_OnedCode128Reader::CODE_START_A = 103;
+const int32_t CBC_OnedCode128Reader::CODE_START_B = 104;
+const int32_t CBC_OnedCode128Reader::CODE_START_C = 105;
+const int32_t CBC_OnedCode128Reader::CODE_STOP = 106;
CBC_OnedCode128Reader::CBC_OnedCode128Reader()
{
}
CBC_OnedCode128Reader::~CBC_OnedCode128Reader()
{
}
-CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, FX_INT32 &e)
+CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, int32_t &e)
{
- FX_INT32 width = row->GetSize();
- FX_INT32 rowOffset = 0;
+ int32_t width = row->GetSize();
+ int32_t rowOffset = 0;
while (rowOffset < width) {
if (row->Get(rowOffset)) {
break;
}
rowOffset++;
}
- FX_INT32 counterPosition = 0;
+ int32_t counterPosition = 0;
CFX_Int32Array counters;
counters.SetSize(6);
- FX_INT32 patternStart = rowOffset;
+ int32_t patternStart = rowOffset;
FX_BOOL isWhite = FALSE;
- FX_INT32 patternLength = counters.GetSize();
- for (FX_INT32 i = rowOffset; i < width; i++) {
+ int32_t patternLength = counters.GetSize();
+ for (int32_t i = rowOffset; i < width; i++) {
FX_BOOL pixel = row->Get(i);
if (pixel ^ isWhite) {
counters[counterPosition]++;
} else {
if (counterPosition == patternLength - 1) {
- FX_INT32 bestVariance = MAX_AVG_VARIANCE;
- FX_INT32 bestMatch = -1;
- for (FX_INT32 startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) {
- FX_INT32 variance = PatternMatchVariance(&counters, &CODE_PATTERNS[startCode][0], MAX_INDIVIDUAL_VARIANCE);
+ int32_t bestVariance = MAX_AVG_VARIANCE;
+ int32_t bestMatch = -1;
+ for (int32_t startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) {
+ int32_t variance = PatternMatchVariance(&counters, &CODE_PATTERNS[startCode][0], MAX_INDIVIDUAL_VARIANCE);
if (variance < bestVariance) {
bestVariance = variance;
bestMatch = startCode;
@@ -199,7 +199,7 @@ CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, }
}
patternStart += counters[0] + counters[1];
- for (FX_INT32 y = 2; y < patternLength; y++) {
+ for (int32_t y = 2; y < patternLength; y++) {
counters[y - 2] = counters[y];
}
counters[patternLength - 2] = 0;
@@ -215,14 +215,14 @@ CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, e = BCExceptionNotFound;
return NULL;
}
-FX_INT32 CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, FX_INT32 &e)
+int32_t CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, int32_t &e)
{
RecordPattern(row, rowOffset, counters, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
- FX_INT32 bestVariance = MAX_AVG_VARIANCE;
- FX_INT32 bestMatch = -1;
- for (FX_INT32 d = 0; d < 107; d++) {
- FX_INT32 variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], MAX_INDIVIDUAL_VARIANCE);
+ int32_t bestVariance = MAX_AVG_VARIANCE;
+ int32_t bestMatch = -1;
+ for (int32_t d = 0; d < 107; d++) {
+ int32_t variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], MAX_INDIVIDUAL_VARIANCE);
if (variance < bestVariance) {
bestVariance = variance;
bestMatch = d;
@@ -236,12 +236,12 @@ FX_INT32 CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Arr }
return 0;
}
-CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
CFX_Int32Array *startPatternInfo = FindStartPattern(row, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- FX_INT32 startCode = (*startPatternInfo)[2];
- FX_INT32 codeSet;
+ int32_t startCode = (*startPatternInfo)[2];
+ int32_t codeSet;
switch (startCode) {
case 103:
codeSet = CODE_CODE_A;
@@ -264,8 +264,8 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi FX_BOOL done = FALSE;
FX_BOOL isNextShifted = FALSE;
CFX_ByteString result;
- FX_INT32 lastStart = (*startPatternInfo)[0];
- FX_INT32 nextStart = (*startPatternInfo)[1];
+ int32_t lastStart = (*startPatternInfo)[0];
+ int32_t nextStart = (*startPatternInfo)[1];
if(startPatternInfo != NULL) {
startPatternInfo->RemoveAll();
delete startPatternInfo;
@@ -273,10 +273,10 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi }
CFX_Int32Array counters;
counters.SetSize(6);
- FX_INT32 lastCode = 0;
- FX_INT32 code = 0;
- FX_INT32 checksumTotal = startCode;
- FX_INT32 multiplier = 0;
+ int32_t lastCode = 0;
+ int32_t code = 0;
+ int32_t checksumTotal = startCode;
+ int32_t multiplier = 0;
FX_BOOL lastCharacterWasPrintable = TRUE;
while (!done) {
FX_BOOL unshift = isNextShifted;
@@ -292,7 +292,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi checksumTotal += multiplier * code;
}
lastStart = nextStart;
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
nextStart += counters[i];
}
switch (code) {
@@ -399,7 +399,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi codeSet = codeSet == CODE_CODE_A ? CODE_CODE_B : CODE_CODE_A;
}
}
- FX_INT32 width = row->GetSize();
+ int32_t width = row->GetSize();
while (nextStart < width && row->Get(nextStart)) {
nextStart++;
}
@@ -414,7 +414,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi e = BCExceptionChecksumException;
return "";
}
- FX_INT32 resultLength = result.GetLength();
+ int32_t resultLength = result.GetLength();
if (resultLength > 0 && lastCharacterWasPrintable) {
if (codeSet == CODE_CODE_C) {
result = result.Mid(0, result.GetLength() - 2);
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h index 94e1a6388b..558b111c22 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h @@ -14,27 +14,27 @@ class CBC_OnedCode128Reader : public CBC_OneDReader public:
CBC_OnedCode128Reader();
virtual ~CBC_OnedCode128Reader();
- virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
- const static FX_INT32 CODE_PATTERNS[107][7];
- const static FX_INT32 MAX_AVG_VARIANCE;
- const static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
+ virtual CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e);
+ const static int32_t CODE_PATTERNS[107][7];
+ const static int32_t MAX_AVG_VARIANCE;
+ const static int32_t MAX_INDIVIDUAL_VARIANCE;
- const static FX_INT32 CODE_SHIFT;
- const static FX_INT32 CODE_CODE_C;
- const static FX_INT32 CODE_CODE_B;
- const static FX_INT32 CODE_CODE_A;
- const static FX_INT32 CODE_FNC_1;
- const static FX_INT32 CODE_FNC_2;
- const static FX_INT32 CODE_FNC_3;
- const static FX_INT32 CODE_FNC_4_A;
- const static FX_INT32 CODE_FNC_4_B ;
+ const static int32_t CODE_SHIFT;
+ const static int32_t CODE_CODE_C;
+ const static int32_t CODE_CODE_B;
+ const static int32_t CODE_CODE_A;
+ const static int32_t CODE_FNC_1;
+ const static int32_t CODE_FNC_2;
+ const static int32_t CODE_FNC_3;
+ const static int32_t CODE_FNC_4_A;
+ const static int32_t CODE_FNC_4_B ;
- const static FX_INT32 CODE_START_A;
- const static FX_INT32 CODE_START_B;
- const static FX_INT32 CODE_START_C;
- const static FX_INT32 CODE_STOP;
+ const static int32_t CODE_START_A;
+ const static int32_t CODE_START_B;
+ const static int32_t CODE_START_C;
+ const static int32_t CODE_STOP;
private:
- CFX_Int32Array *FindStartPattern(CBC_CommonBitArray *row, FX_INT32 &e);
- FX_INT32 DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, FX_INT32 &e);
+ CFX_Int32Array *FindStartPattern(CBC_CommonBitArray *row, int32_t &e);
+ int32_t DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp index 6dd3cbe8a5..5f7b32caa4 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp @@ -27,11 +27,11 @@ #include "BC_OneDimWriter.h"
#include "BC_OnedCode128Reader.h"
#include "BC_OnedCode128Writer.h"
-const FX_INT32 CBC_OnedCode128Writer::CODE_CODE_B = 100;
-const FX_INT32 CBC_OnedCode128Writer::CODE_CODE_C = 99;
-const FX_INT32 CBC_OnedCode128Writer::CODE_START_B = 104;
-const FX_INT32 CBC_OnedCode128Writer::CODE_START_C = 105;
-const FX_INT32 CBC_OnedCode128Writer::CODE_STOP = 106;
+const int32_t CBC_OnedCode128Writer::CODE_CODE_B = 100;
+const int32_t CBC_OnedCode128Writer::CODE_CODE_C = 99;
+const int32_t CBC_OnedCode128Writer::CODE_START_B = 104;
+const int32_t CBC_OnedCode128Writer::CODE_START_C = 105;
+const int32_t CBC_OnedCode128Writer::CODE_STOP = 106;
CBC_OnedCode128Writer::CBC_OnedCode128Writer()
{
m_codeFormat = BC_CODE128_B;
@@ -50,11 +50,11 @@ BC_TYPE CBC_OnedCode128Writer::GetType() FX_BOOL CBC_OnedCode128Writer::CheckContentValidity(FX_WSTR contents)
{
FX_BOOL ret = TRUE;
- FX_INT32 position = 0;
- FX_INT32 patternIndex = -1;
+ int32_t position = 0;
+ int32_t patternIndex = -1;
if (m_codeFormat == BC_CODE128_B || m_codeFormat == BC_CODE128_C) {
while (position < contents.GetLength()) {
- patternIndex = (FX_INT32)contents.GetAt(position);
+ patternIndex = (int32_t)contents.GetAt(position);
if (patternIndex >= 32 && patternIndex <= 126 && patternIndex != 34) {
position++;
continue;
@@ -73,7 +73,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) {
CFX_WideString filterChineseChar;
FX_WCHAR ch;
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if(ch > 175) {
i++;
@@ -83,7 +83,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) }
CFX_WideString filtercontents;
if (m_codeFormat == BC_CODE128_B) {
- for (FX_INT32 i = 0; i < filterChineseChar.GetLength(); i++) {
+ for (int32_t i = 0; i < filterChineseChar.GetLength(); i++) {
ch = filterChineseChar.GetAt(i);
if (ch >= 32 && ch <= 126) {
filtercontents += ch;
@@ -92,7 +92,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) }
}
} else if (m_codeFormat == BC_CODE128_C) {
- for (FX_INT32 i = 0; i < filterChineseChar.GetLength(); i++) {
+ for (int32_t i = 0; i < filterChineseChar.GetLength(); i++) {
ch = filterChineseChar.GetAt(i);
if (ch >= 32 && ch <= 106) {
filtercontents += ch;
@@ -113,41 +113,41 @@ FX_BOOL CBC_OnedCode128Writer::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location;
return TRUE;
}
-FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
if(format != BCFORMAT_CODE_128) {
e = BCExceptionOnlyEncodeCODE_128;
return NULL;
}
- FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
+ uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BOOL CBC_OnedCode128Writer::IsDigits(const CFX_ByteString &contents, FX_INT32 start, FX_INT32 length)
+FX_BOOL CBC_OnedCode128Writer::IsDigits(const CFX_ByteString &contents, int32_t start, int32_t length)
{
- FX_INT32 end = start + length;
- for (FX_INT32 i = start; i < end; i++) {
+ int32_t end = start + length;
+ for (int32_t i = start; i < end; i++) {
if (contents[i] < '0' || contents[i] > '9') {
return FALSE;
}
}
return TRUE;
}
-FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e)
+uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e)
{
- FX_INT32 length = contents.GetLength();
+ int32_t length = contents.GetLength();
if(contents.GetLength() < 1 || contents.GetLength() > 80) {
e = BCExceptionContentsLengthShouldBetween1and80;
return NULL;
}
CFX_PtrArray patterns;
- FX_INT32 checkSum = 0;
+ int32_t checkSum = 0;
if (m_codeFormat == BC_CODE128_B) {
checkSum = Encode128B(contents, patterns);
} else if (m_codeFormat == BC_CODE128_C) {
@@ -157,21 +157,21 @@ FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 return NULL;
}
checkSum %= 103;
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[checkSum]);
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_STOP]);
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[checkSum]);
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_STOP]);
m_iContentLen = contents.GetLength() + 3;
- FX_INT32 codeWidth = 0;
- for(FX_INT32 k = 0; k < patterns.GetSize(); k++) {
- FX_INT32 *pattern = (FX_INT32*)patterns[k];
- for(FX_INT32 j = 0; j < 7; j++) {
+ int32_t codeWidth = 0;
+ for(int32_t k = 0; k < patterns.GetSize(); k++) {
+ int32_t *pattern = (int32_t*)patterns[k];
+ for(int32_t j = 0; j < 7; j++) {
codeWidth += pattern[j];
}
}
outLength = codeWidth;
- FX_BYTE *result = FX_Alloc(FX_BYTE, outLength);
- FX_INT32 pos = 0;
- for(FX_INT32 j = 0; j < patterns.GetSize(); j++) {
- FX_INT32* pattern = (FX_INT32*)patterns[j];
+ uint8_t *result = FX_Alloc(uint8_t, outLength);
+ int32_t pos = 0;
+ for(int32_t j = 0; j < patterns.GetSize(); j++) {
+ int32_t* pattern = (int32_t*)patterns[j];
pos += AppendPattern(result, pos, pattern, 7, 1, e);
if (e != BCExceptionNO) {
FX_Free (result);
@@ -180,18 +180,18 @@ FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 }
return result;
}
-FX_INT32 CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns)
+int32_t CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns)
{
- FX_INT32 checkSum = 0;
- FX_INT32 checkWeight = 1;
- FX_INT32 position = 0;
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_B]);
+ int32_t checkSum = 0;
+ int32_t checkWeight = 1;
+ int32_t position = 0;
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_B]);
checkSum += CODE_START_B * checkWeight;
while (position < contents.GetLength()) {
- FX_INT32 patternIndex = 0;
+ int32_t patternIndex = 0;
patternIndex = contents[position] - ' ';
position += 1;
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
checkSum += patternIndex * checkWeight;
if (position != 0) {
checkWeight++;
@@ -199,18 +199,18 @@ FX_INT32 CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_ }
return checkSum;
}
-FX_INT32 CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns)
+int32_t CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns)
{
- FX_INT32 checkSum = 0;
- FX_INT32 checkWeight = 1;
- FX_INT32 position = 0;
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]);
+ int32_t checkSum = 0;
+ int32_t checkWeight = 1;
+ int32_t position = 0;
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]);
checkSum += CODE_START_C * checkWeight;
while (position < contents.GetLength()) {
- FX_INT32 patternIndex = 0;
+ int32_t patternIndex = 0;
FX_CHAR ch = contents.GetAt(position);
if (ch < '0' || ch > '9') {
- patternIndex = (FX_INT32)ch;
+ patternIndex = (int32_t)ch;
position++;
} else {
patternIndex = FXSYS_atoi(contents.Mid(position, 2));
@@ -220,7 +220,7 @@ FX_INT32 CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_ position += 2;
}
}
- patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
+ patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
checkSum += patternIndex * checkWeight;
if (position != 0) {
checkWeight++;
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h index daa48eca51..f27e2e9f09 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h @@ -14,24 +14,24 @@ public: CBC_OnedCode128Writer();
CBC_OnedCode128Writer(BC_TYPE type);
virtual ~CBC_OnedCode128Writer();
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength , FX_INT32 &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, int32_t &outLength , int32_t &e);
FX_BOOL CheckContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
FX_BOOL SetTextLocation(BC_TEXT_LOC location);
BC_TYPE GetType();
private:
- FX_BOOL IsDigits(const CFX_ByteString &contents, FX_INT32 start, FX_INT32 length);
- FX_INT32 Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns);
- FX_INT32 Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns);
+ FX_BOOL IsDigits(const CFX_ByteString &contents, int32_t start, int32_t length);
+ int32_t Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns);
+ int32_t Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns);
BC_TYPE m_codeFormat;
- const static FX_INT32 CODE_START_B;
- const static FX_INT32 CODE_START_C;
- const static FX_INT32 CODE_CODE_B;
- const static FX_INT32 CODE_CODE_C;
- const static FX_INT32 CODE_STOP;
+ const static int32_t CODE_START_B;
+ const static int32_t CODE_START_C;
+ const static int32_t CODE_CODE_B;
+ const static int32_t CODE_CODE_C;
+ const static int32_t CODE_STOP;
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp index b19343943b..e5e6392c17 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp @@ -27,14 +27,14 @@ #include "BC_OnedCode39Reader.h"
FX_LPCSTR CBC_OnedCode39Reader::ALPHABET_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
FX_LPCSTR CBC_OnedCode39Reader::CHECKSUM_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
-const FX_INT32 CBC_OnedCode39Reader::CHARACTER_ENCODINGS[44] = {
+const int32_t CBC_OnedCode39Reader::CHARACTER_ENCODINGS[44] = {
0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064,
0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C,
0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016,
0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094,
0x0A8, 0x0A2, 0x08A, 0x02A
};
-const FX_INT32 CBC_OnedCode39Reader::ASTERISK_ENCODING = 0x094;
+const int32_t CBC_OnedCode39Reader::ASTERISK_ENCODING = 0x094;
CBC_OnedCode39Reader::CBC_OnedCode39Reader(): m_extendedMode(FALSE), m_usingCheckDigit(FALSE)
{
}
@@ -51,16 +51,16 @@ CBC_OnedCode39Reader::CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL exte CBC_OnedCode39Reader::~CBC_OnedCode39Reader()
{
}
-CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
CFX_Int32Array *start = FindAsteriskPattern(row, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- FX_INT32 nextStart = (*start)[1];
+ int32_t nextStart = (*start)[1];
if(start != NULL) {
delete start;
start = NULL;
}
- FX_INT32 end = row->GetSize();
+ int32_t end = row->GetSize();
while (nextStart < end && !row->Get(nextStart)) {
nextStart++;
}
@@ -68,11 +68,11 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit CFX_Int32Array counters;
counters.SetSize(9);
FX_CHAR decodedChar;
- FX_INT32 lastStart;
+ int32_t lastStart;
do {
RecordPattern(row, nextStart, &counters, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- FX_INT32 pattern = ToNarrowWidePattern(&counters);
+ int32_t pattern = ToNarrowWidePattern(&counters);
if (pattern < 0) {
e = BCExceptionNotFound;
return "";
@@ -81,7 +81,7 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit BC_EXCEPTION_CHECK_ReturnValue(e, "");
result += decodedChar;
lastStart = nextStart;
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
nextStart += counters[i];
}
while (nextStart < end && !row->Get(nextStart)) {
@@ -89,17 +89,17 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit }
} while (decodedChar != '*');
result = result.Mid(0, result.GetLength() - 1);
- FX_INT32 lastPatternSize = 0;
- for (FX_INT32 j = 0; j < counters.GetSize(); j++) {
+ int32_t lastPatternSize = 0;
+ for (int32_t j = 0; j < counters.GetSize(); j++) {
lastPatternSize += counters[j];
}
- FX_INT32 whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
+ int32_t whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
if(m_usingCheckDigit) {
- FX_INT32 max = result.GetLength() - 1;
- FX_INT32 total = 0;
- FX_INT32 len = (FX_INT32)strlen(ALPHABET_STRING);
- for (FX_INT32 k = 0; k < max; k++) {
- for (FX_INT32 j = 0; j < len; j++)
+ int32_t max = result.GetLength() - 1;
+ int32_t total = 0;
+ int32_t len = (int32_t)strlen(ALPHABET_STRING);
+ for (int32_t k = 0; k < max; k++) {
+ for (int32_t j = 0; j < len; j++)
if (ALPHABET_STRING[j] == result[k]) {
total += j;
}
@@ -122,23 +122,23 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit return result;
}
}
-CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e)
+CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e)
{
- FX_INT32 width = row->GetSize();
- FX_INT32 rowOffset = 0;
+ int32_t width = row->GetSize();
+ int32_t rowOffset = 0;
while (rowOffset < width) {
if (row->Get(rowOffset)) {
break;
}
rowOffset++;
}
- FX_INT32 counterPosition = 0;
+ int32_t counterPosition = 0;
CFX_Int32Array counters;
counters.SetSize(9);
- FX_INT32 patternStart = rowOffset;
+ int32_t patternStart = rowOffset;
FX_BOOL isWhite = FALSE;
- FX_INT32 patternLength = counters.GetSize();
- for (FX_INT32 i = rowOffset; i < width; i++) {
+ int32_t patternLength = counters.GetSize();
+ for (int32_t i = rowOffset; i < width; i++) {
FX_BOOL pixel = row->Get(i);
if (pixel ^ isWhite) {
counters[counterPosition]++;
@@ -156,7 +156,7 @@ CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *ro }
}
patternStart += counters[0] + counters[1];
- for (FX_INT32 y = 2; y < patternLength; y++) {
+ for (int32_t y = 2; y < patternLength; y++) {
counters[y - 2] = counters[y];
}
counters[patternLength - 2] = 0;
@@ -172,26 +172,26 @@ CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *ro e = BCExceptionNotFound;
return NULL;
}
-FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters)
+int32_t CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters)
{
- FX_INT32 numCounters = counters->GetSize();
- FX_INT32 maxNarrowCounter = 0;
- FX_INT32 wideCounters;
+ int32_t numCounters = counters->GetSize();
+ int32_t maxNarrowCounter = 0;
+ int32_t wideCounters;
do {
#undef max
- FX_INT32 minCounter = FXSYS_IntMax;
- for (FX_INT32 i = 0; i < numCounters; i++) {
- FX_INT32 counter = (*counters)[i];
+ int32_t minCounter = FXSYS_IntMax;
+ for (int32_t i = 0; i < numCounters; i++) {
+ int32_t counter = (*counters)[i];
if (counter < minCounter && counter > maxNarrowCounter) {
minCounter = counter;
}
}
maxNarrowCounter = minCounter;
wideCounters = 0;
- FX_INT32 totalWideCountersWidth = 0;
- FX_INT32 pattern = 0;
- for (FX_INT32 j = 0; j < numCounters; j++) {
- FX_INT32 counter = (*counters)[j];
+ int32_t totalWideCountersWidth = 0;
+ int32_t pattern = 0;
+ for (int32_t j = 0; j < numCounters; j++) {
+ int32_t counter = (*counters)[j];
if ((*counters)[j] > maxNarrowCounter) {
pattern |= 1 << (numCounters - 1 - j);
wideCounters++;
@@ -199,8 +199,8 @@ FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) }
}
if (wideCounters == 3) {
- for (FX_INT32 k = 0; k < numCounters && wideCounters > 0; k++) {
- FX_INT32 counter = (*counters)[k];
+ for (int32_t k = 0; k < numCounters && wideCounters > 0; k++) {
+ int32_t counter = (*counters)[k];
if ((*counters)[k] > maxNarrowCounter) {
wideCounters--;
if ((counter << 1) >= totalWideCountersWidth) {
@@ -213,9 +213,9 @@ FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) } while (wideCounters > 3);
return -1;
}
-FX_CHAR CBC_OnedCode39Reader::PatternToChar(FX_INT32 pattern, FX_INT32 &e)
+FX_CHAR CBC_OnedCode39Reader::PatternToChar(int32_t pattern, int32_t &e)
{
- for (FX_INT32 i = 0; i < 44; i++) {
+ for (int32_t i = 0; i < 44; i++) {
if (CHARACTER_ENCODINGS[i] == pattern) {
return (ALPHABET_STRING)[i];
}
@@ -223,12 +223,12 @@ FX_CHAR CBC_OnedCode39Reader::PatternToChar(FX_INT32 pattern, FX_INT32 &e) e = BCExceptionNotFound;
return 0;
}
-CFX_ByteString CBC_OnedCode39Reader::DecodeExtended(CFX_ByteString &encoded, FX_INT32 &e)
+CFX_ByteString CBC_OnedCode39Reader::DecodeExtended(CFX_ByteString &encoded, int32_t &e)
{
- FX_INT32 length = encoded.GetLength();
+ int32_t length = encoded.GetLength();
CFX_ByteString decoded;
FX_CHAR c, next;
- for(FX_INT32 i = 0; i < length; i++) {
+ for(int32_t i = 0; i < length; i++) {
c = encoded[i];
if(c == '+' || c == '$' || c == '%' || c == '/') {
next = encoded[i + 1];
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h index 81fd6b79e9..3e7db70f95 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h @@ -14,19 +14,19 @@ class CBC_OnedCode39Reader : public CBC_OneDReader public:
static FX_LPCSTR ALPHABET_STRING;
static FX_LPCSTR CHECKSUM_STRING;
- const static FX_INT32 CHARACTER_ENCODINGS[44];
- const static FX_INT32 ASTERISK_ENCODING;
+ const static int32_t CHARACTER_ENCODINGS[44];
+ const static int32_t ASTERISK_ENCODING;
CBC_OnedCode39Reader();
CBC_OnedCode39Reader(FX_BOOL usingCheckDigit);
CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL extendedMode);
virtual ~CBC_OnedCode39Reader();
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e);
private:
FX_BOOL m_usingCheckDigit;
FX_BOOL m_extendedMode;
- CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e);
- FX_INT32 ToNarrowWidePattern(CFX_Int32Array *counters);
- FX_CHAR PatternToChar(FX_INT32 pattern, FX_INT32 &e);
- CFX_ByteString DecodeExtended(CFX_ByteString &encoded, FX_INT32 &e);
+ CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e);
+ int32_t ToNarrowWidePattern(CFX_Int32Array *counters);
+ FX_CHAR PatternToChar(int32_t pattern, int32_t &e);
+ CFX_ByteString DecodeExtended(CFX_ByteString &encoded, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp index d9c77460ac..8d06ecdfc2 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp @@ -46,7 +46,7 @@ FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(FX_WSTR contents) if (m_extendedMode) {
return CheckExtendedContentValidity(contents);
}
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if ((ch >= (FX_WCHAR)'0' && ch <= (FX_WCHAR)'9') || (ch >= (FX_WCHAR)'A' && ch <= (FX_WCHAR)'Z')
|| ch == (FX_WCHAR)'-' || ch == (FX_WCHAR)'.' || ch == (FX_WCHAR)' ' || ch == (FX_WCHAR)'*'
@@ -59,7 +59,7 @@ FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(FX_WSTR contents) }
FX_BOOL CBC_OnedCode39Writer::CheckExtendedContentValidity(FX_WSTR contents)
{
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if (ch > 127) {
return FALSE;
@@ -73,7 +73,7 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(FX_WSTR contents) return FilterExtendedContents(contents);
}
CFX_WideString filtercontents;
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) {
continue;
@@ -95,7 +95,7 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(FX_WSTR contents) CFX_WideString CBC_OnedCode39Writer::FilterExtendedContents(FX_WSTR contents)
{
CFX_WideString filtercontents;
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) {
continue;
@@ -155,7 +155,7 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(FX_WSTR contents) return RenderExtendedTextContents(contents);
}
CFX_WideString renderContents;
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) {
continue;
@@ -176,7 +176,7 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(FX_WSTR contents) CFX_WideString CBC_OnedCode39Writer::RenderExtendedTextContents(FX_WSTR contents)
{
CFX_WideString renderContents;
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) {
continue;
@@ -200,7 +200,7 @@ FX_BOOL CBC_OnedCode39Writer::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location;
return TRUE;
}
-FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(FX_INT32 ratio)
+FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(int32_t ratio)
{
if ( ratio < 2 || ratio > 3) {
return FALSE;
@@ -208,39 +208,39 @@ FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(FX_INT32 ratio) m_iWideNarrRatio = ratio;
return TRUE;
}
-FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0 , e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0 , e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
if(format != BCFORMAT_CODE_39) {
e = BCExceptionOnlyEncodeCODE_39;
return NULL;
}
- FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
+ uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-void CBC_OnedCode39Writer::ToIntArray(FX_INT32 a, FX_INT32 *toReturn)
+void CBC_OnedCode39Writer::ToIntArray(int32_t a, int32_t *toReturn)
{
- for(FX_INT32 i = 0; i < 9; i++) {
+ for(int32_t i = 0; i < 9; i++) {
toReturn[i] = (a & (1 << i) ) == 0 ? 1 : m_iWideNarrRatio;
}
}
-FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, FX_INT32 &e)
+FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, int32_t &e)
{
- FX_INT32 length = contents.GetLength();
+ int32_t length = contents.GetLength();
if (length > 80) {
e = BCExceptionContentsLengthShouldBetween1and80;
return '*';
}
- FX_INT32 checksum = 0;
- FX_INT32 len = (FX_INT32)strlen(CBC_OnedCode39Reader::ALPHABET_STRING);
- for(FX_INT32 i = 0; i < contents.GetLength(); i++) {
- FX_INT32 j = 0;
+ int32_t checksum = 0;
+ int32_t len = (int32_t)strlen(CBC_OnedCode39Reader::ALPHABET_STRING);
+ for(int32_t i = 0; i < contents.GetLength(); i++) {
+ int32_t j = 0;
for (; j < len; j++) {
if (CBC_OnedCode39Reader::ALPHABET_STRING[j] == contents[i]) {
if(contents[i] != '*') {
@@ -259,48 +259,48 @@ FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, FX_IN checksum = checksum % 43;
return CBC_OnedCode39Reader::CHECKSUM_STRING[checksum];
}
-FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outlength , FX_INT32 &e)
+uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, int32_t &outlength , int32_t &e)
{
FX_CHAR checksum = CalcCheckSum(contents, e);
if (checksum == '*') {
return NULL;
}
- FX_INT32 widths[9] = {0};
- FX_INT32 wideStrideNum = 3;
- FX_INT32 narrStrideNum = 9 - wideStrideNum;
+ int32_t widths[9] = {0};
+ int32_t wideStrideNum = 3;
+ int32_t narrStrideNum = 9 - wideStrideNum;
CFX_ByteString encodedContents = contents;
if ( m_bCalcChecksum ) {
encodedContents += checksum;
}
m_iContentLen = encodedContents.GetLength();
- FX_INT32 codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 + 1 + m_iContentLen;
- FX_INT32 len = (FX_INT32)strlen(CBC_OnedCode39Reader::ALPHABET_STRING);
- for (FX_INT32 j = 0; j < m_iContentLen; j++) {
- for (FX_INT32 i = 0; i < len; i++) {
+ int32_t codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 + 1 + m_iContentLen;
+ int32_t len = (int32_t)strlen(CBC_OnedCode39Reader::ALPHABET_STRING);
+ for (int32_t j = 0; j < m_iContentLen; j++) {
+ for (int32_t i = 0; i < len; i++) {
if (CBC_OnedCode39Reader::ALPHABET_STRING[i] == encodedContents[j]) {
ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[i], widths);
- for(FX_INT32 k = 0; k < 9; k++) {
+ for(int32_t k = 0; k < 9; k++) {
codeWidth += widths[k];
}
}
}
}
outlength = codeWidth;
- FX_BYTE *result = FX_Alloc(FX_BYTE, codeWidth);
+ uint8_t *result = FX_Alloc(uint8_t, codeWidth);
ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[39], widths);
- FX_INT32 pos = AppendPattern(result, 0, widths, 9, 1 , e);
+ int32_t pos = AppendPattern(result, 0, widths, 9, 1 , e);
if (e != BCExceptionNO) {
FX_Free (result);
return NULL;
}
- FX_INT32 narrowWhite[] = {1};
+ int32_t narrowWhite[] = {1};
pos += AppendPattern(result, pos, narrowWhite, 1, 0, e);
if (e != BCExceptionNO) {
FX_Free (result);
return NULL;
}
- for(FX_INT32 l = m_iContentLen - 1; l >= 0; l--) {
- for (FX_INT32 i = 0; i < len; i++) {
+ for(int32_t l = m_iContentLen - 1; l >= 0; l--) {
+ for (int32_t i = 0; i < len; i++) {
if (CBC_OnedCode39Reader::ALPHABET_STRING[i] == encodedContents[l]) {
ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[i], widths);
pos += AppendPattern(result, pos, widths, 9, 1, e);
@@ -322,14 +322,14 @@ FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, FX_INT32 & FX_Free (result);
return NULL;
}
- for (FX_INT32 i = 0; i < codeWidth / 2; i++) {
+ for (int32_t i = 0; i < codeWidth / 2; i++) {
result[i] ^= result[codeWidth - 1 - i];
result[codeWidth - 1 - i] ^= result[i];
result[i] ^= result[codeWidth - 1 - i];
}
return result;
}
-CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, FX_INT32 &e)
+CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, int32_t &e)
{
CFX_WideString encodedContents = contents;
if (m_bCalcChecksum && m_bPrintChecksum) {
@@ -343,7 +343,7 @@ CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, FX_INT32 }
return encodedContents;
}
-void CBC_OnedCode39Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OnedCode39Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
CFX_WideString encodedCon = encodedContents(contents, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h index b37d9d8e19..641d041809 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h @@ -15,11 +15,11 @@ public: CBC_OnedCode39Writer();
CBC_OnedCode39Writer(FX_BOOL extendedMode);
virtual ~CBC_OnedCode39Writer();
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
- void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
- CFX_WideString encodedContents(FX_WSTR contents, FX_INT32 &e);
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ uint8_t *Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e);
+ void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
+ CFX_WideString encodedContents(FX_WSTR contents, int32_t &e);
FX_BOOL CheckContentValidity(FX_WSTR contents);
FX_BOOL CheckExtendedContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
@@ -27,11 +27,11 @@ public: CFX_WideString RenderTextContents(FX_WSTR contents);
CFX_WideString RenderExtendedTextContents(FX_WSTR contents);
FX_BOOL SetTextLocation(BC_TEXT_LOC loction);
- FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ FX_BOOL SetWideNarrowRatio(int32_t ratio);
private:
- void ToIntArray(FX_INT32 a, FX_INT32 *toReturn);
- FX_CHAR CalcCheckSum(const CFX_ByteString &contents, FX_INT32 &e);
- FX_INT32 m_iWideNarrRatio;
+ void ToIntArray(int32_t a, int32_t *toReturn);
+ FX_CHAR CalcCheckSum(const CFX_ByteString &contents, int32_t &e);
+ int32_t m_iWideNarrRatio;
FX_BOOL m_extendedMode;
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp index ddce736bb8..288aace861 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp @@ -26,7 +26,7 @@ #include "BC_OneDReader.h"
#include "BC_OneDimReader.h"
#include "BC_OnedEAN13Reader.h"
-const FX_INT32 CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[10] = {
+const int32_t CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[10] = {
0x00, 0x0B, 0x0D, 0xE, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A
};
CBC_OnedEAN13Reader::CBC_OnedEAN13Reader()
@@ -35,9 +35,9 @@ CBC_OnedEAN13Reader::CBC_OnedEAN13Reader() CBC_OnedEAN13Reader::~CBC_OnedEAN13Reader()
{
}
-void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, FX_INT32 lgPatternFound, FX_INT32 &e)
+void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, int32_t lgPatternFound, int32_t &e)
{
- for (FX_INT32 d = 0; d < 10; d++) {
+ for (int32_t d = 0; d < 10; d++) {
if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) {
result.Insert(0, (FX_CHAR) ('0' + d));
return;
@@ -46,21 +46,21 @@ void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, FX_INT32 l e = BCExceptionNotFound;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-FX_INT32 CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e)
+int32_t CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e)
{
CFX_Int32Array counters;
counters.Add(0);
counters.Add(0);
counters.Add(0);
counters.Add(0);
- FX_INT32 end = row->GetSize();
- FX_INT32 rowOffset = (*startRange)[1];
- FX_INT32 lgPatternFound = 0;
- for (FX_INT32 x = 0; x < 6 && rowOffset < end; x++) {
- FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_AND_G_PATTERNS[0][0]), 20, e);
+ int32_t end = row->GetSize();
+ int32_t rowOffset = (*startRange)[1];
+ int32_t lgPatternFound = 0;
+ for (int32_t x = 0; x < 6 && rowOffset < end; x++) {
+ int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_AND_G_PATTERNS[0][0]), 20, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
resultString += (FX_CHAR) ('0' + bestMatch % 10);
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
rowOffset += counters[i];
}
if (bestMatch >= 10) {
@@ -82,11 +82,11 @@ FX_INT32 CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arr delete middleRange;
middleRange = NULL;
}
- for (FX_INT32 Y = 0; Y < 6 && rowOffset < end; Y++) {
- FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
+ for (int32_t Y = 0; Y < 6 && rowOffset < end; Y++) {
+ int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
resultString += (FX_CHAR) ('0' + bestMatch);
- for (FX_INT32 k = 0; k < counters.GetSize(); k++) {
+ for (int32_t k = 0; k < counters.GetSize(); k++) {
rowOffset += counters[k];
}
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h index 9afb9b6418..7c31fd4f20 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h @@ -12,13 +12,13 @@ class CBC_OnedEAN13Reader; class CBC_OnedEAN13Reader : public CBC_OneDimReader
{
public:
- const static FX_INT32 FIRST_DIGIT_ENCODINGS[10];
+ const static int32_t FIRST_DIGIT_ENCODINGS[10];
CBC_OnedEAN13Reader();
virtual ~CBC_OnedEAN13Reader();
private:
- void DetermineFirstDigit(CFX_ByteString &result, FX_INT32 lgPatternFound, FX_INT32 &e);
+ void DetermineFirstDigit(CFX_ByteString &result, int32_t lgPatternFound, int32_t &e);
protected:
- FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e);
+ int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e);
friend class CBC_OnedUPCAReader;
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 788cd8f7da..4b258a5a9f 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -42,7 +42,7 @@ CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() }
FX_BOOL CBC_OnedEAN13Writer::CheckContentValidity(FX_WSTR contents)
{
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
} else {
@@ -55,7 +55,7 @@ CFX_WideString CBC_OnedEAN13Writer::FilterContents(FX_WSTR contents) {
CFX_WideString filtercontents;
FX_WCHAR ch;
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if(ch > 175) {
i++;
@@ -67,12 +67,12 @@ CFX_WideString CBC_OnedEAN13Writer::FilterContents(FX_WSTR contents) }
return filtercontents;
}
-FX_INT32 CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents)
+int32_t CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents)
{
- FX_INT32 odd = 0;
- FX_INT32 even = 0;
- FX_INT32 j = 1;
- for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) {
+ int32_t odd = 0;
+ int32_t even = 0;
+ int32_t j = 1;
+ for(int32_t i = contents.GetLength() - 1; i >= 0; i--) {
if(j % 2) {
odd += FXSYS_atoi(contents.Mid(i, 1));
} else {
@@ -80,45 +80,45 @@ FX_INT32 CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents) }
j++;
}
- FX_INT32 checksum = (odd * 3 + even) % 10;
+ int32_t checksum = (odd * 3 + even) % 10;
checksum = (10 - checksum) % 10;
return (checksum);
}
-FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
if(format != BCFORMAT_EAN_13) {
e = BCExceptionOnlyEncodeEAN_13;
}
- FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
+ uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e)
+uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e)
{
if (contents.GetLength() != 13) {
e = BCExceptionDigitLengthShould13;
return NULL;
}
m_iDataLenth = 13;
- FX_INT32 firstDigit = FXSYS_atoi(contents.Mid(0, 1));
- FX_INT32 parities = CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[firstDigit];
+ int32_t firstDigit = FXSYS_atoi(contents.Mid(0, 1));
+ int32_t parities = CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[firstDigit];
outLength = m_codeWidth;
- FX_BYTE *result = FX_Alloc(FX_BYTE, m_codeWidth);
- FX_INT32 pos = 0;
+ uint8_t *result = FX_Alloc(uint8_t, m_codeWidth);
+ int32_t pos = 0;
pos += AppendPattern(result, pos, CBC_OneDimReader::START_END_PATTERN, 3, 1, e);
if (e != BCExceptionNO) {
FX_Free (result);
return NULL;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for ( i = 1; i <= 6; i++) {
- FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1));
+ int32_t digit = FXSYS_atoi(contents.Mid(i, 1));
if ((parities >> (6 - i) & 1) == 1) {
digit += 10;
}
@@ -134,7 +134,7 @@ FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &o return NULL;
}
for (i = 7; i <= 12; i++) {
- FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1));
+ int32_t digit = FXSYS_atoi(contents.Mid(i, 1));
pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e);
if (e != BCExceptionNO) {
FX_Free (result);
@@ -148,16 +148,16 @@ FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &o }
return result;
}
-void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e)
+void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e)
{
if (device == NULL && pOutBitmap == NULL) {
e = BCExceptionIllegalArgument;
return;
}
- FX_INT32 leftPadding = 7 * multiple;
- FX_INT32 leftPosition = 3 * multiple + leftPadding;
+ int32_t leftPadding = 7 * multiple;
+ int32_t leftPosition = 3 * multiple + leftPadding;
CFX_ByteString str = FX_UTF8Encode(contents);
- FX_INT32 iLen = str.GetLength();
+ int32_t iLen = str.GetLength();
FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen);
if (!pCharPos) {
return;
@@ -167,10 +167,10 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, if (pOutBitmap != NULL) {
geBitmap.Attach(pOutBitmap);
}
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
CFX_ByteString tempStr = str.Mid(1, 6);
- FX_INT32 strWidth = multiple * 42;
+ int32_t strWidth = multiple * 42;
if (pOutBitmap == NULL) {
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height);
@@ -184,7 +184,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, matr1.TransformRect(rect1);
re = rect1.GetOutterRect();
device->FillRect(&re, m_backgroundColor);
- FX_INT32 strWidth1 = multiple * 7;
+ int32_t strWidth1 = multiple * 7;
CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height);
matr2.Concat(*matrix);
@@ -196,7 +196,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, FX_FLOAT charsWidth = 0;
iLen = tempStr.GetLength();
if (pOutBitmap == NULL) {
- strWidth = (FX_INT32)(strWidth * m_outputHScale);
+ strWidth = (int32_t)(strWidth * m_outputHScale);
}
CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank);
CFX_AffineMatrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize);
@@ -258,7 +258,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, iLen = tempStr.GetLength();
strWidth = multiple * 7;
if (pOutBitmap == NULL) {
- strWidth = (FX_INT32)(strWidth * m_outputHScale);
+ strWidth = (int32_t)(strWidth * m_outputHScale);
}
CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank);
if(pOutBitmap != NULL) {
@@ -288,7 +288,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, }
FX_Free(pCharPos);
}
-void CBC_OnedEAN13Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OnedEAN13Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h index 2353cfda95..df9d635a4e 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h @@ -11,21 +11,21 @@ class CBC_OnedEAN13Writer; class CBC_OnedEAN13Writer : public CBC_OneDimWriter
{
private:
- FX_INT32 m_codeWidth;
+ int32_t m_codeWidth;
public:
CBC_OnedEAN13Writer();
virtual ~CBC_OnedEAN13Writer();
- FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
- void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ uint8_t* Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e);
+ void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
FX_BOOL CheckContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
- FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+ int32_t CalcChecksum(const CFX_ByteString &contents);
protected:
- void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp index 48e24681df..4b5de72939 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp @@ -32,25 +32,25 @@ CBC_OnedEAN8Reader::CBC_OnedEAN8Reader() CBC_OnedEAN8Reader::~CBC_OnedEAN8Reader()
{
}
-FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, FX_INT32 &e)
+int32_t CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, int32_t &e)
{
CFX_Int32Array counters;
counters.Add(0);
counters.Add(0);
counters.Add(0);
counters.Add(0);
- FX_INT32 end = row->GetSize();
- FX_INT32 rowOffset = (*startRange)[1];
- FX_INT32 rowOffsetLeft = rowOffset;
- for (FX_INT32 x = 0; x < 4 && rowOffset < end; x++) {
- FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
+ int32_t end = row->GetSize();
+ int32_t rowOffset = (*startRange)[1];
+ int32_t rowOffsetLeft = rowOffset;
+ for (int32_t x = 0; x < 4 && rowOffset < end; x++) {
+ int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
resultResult += (FX_CHAR) ('0' + bestMatch);
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
rowOffset += counters[i];
}
}
- FX_INT32 RowOffsetLen = (rowOffset - rowOffsetLeft) / 4;
+ int32_t RowOffsetLen = (rowOffset - rowOffsetLeft) / 4;
CFX_Int32Array result;
result.Add(CBC_OneDimReader::MIDDLE_PATTERN[0]);
result.Add(CBC_OneDimReader::MIDDLE_PATTERN[1]);
@@ -59,7 +59,7 @@ FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arra result.Add(CBC_OneDimReader::MIDDLE_PATTERN[4]);
CFX_Int32Array *middleRange = FindGuardPattern(row, rowOffset, TRUE, &result, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
- FX_INT32 rowOffsetMid = rowOffset;
+ int32_t rowOffsetMid = rowOffset;
rowOffset = (*middleRange)[1];
if((rowOffset - rowOffsetMid) > RowOffsetLen) {
e = BCExceptionNotFound;
@@ -69,11 +69,11 @@ FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arra delete middleRange;
middleRange = NULL;
}
- for (FX_INT32 y = 0; y < 4 && rowOffset < end; y++) {
- FX_INT32 bestMatch = DecodeDigit(row, & counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
+ for (int32_t y = 0; y < 4 && rowOffset < end; y++) {
+ int32_t bestMatch = DecodeDigit(row, & counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
resultResult += (FX_CHAR) ('0' + bestMatch);
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
rowOffset += counters[i];
}
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h index a32bb63083..f2aa93c8ea 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h @@ -15,6 +15,6 @@ public: CBC_OnedEAN8Reader();
virtual ~CBC_OnedEAN8Reader();
protected:
- FX_INT32 DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array *startRange, CFX_ByteString &result, FX_INT32 &e);
+ int32_t DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array *startRange, CFX_ByteString &result, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 19f7f7cede..fdf791c686 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -40,7 +40,7 @@ CBC_OnedEAN8Writer::CBC_OnedEAN8Writer() CBC_OnedEAN8Writer::~CBC_OnedEAN8Writer()
{
}
-void CBC_OnedEAN8Writer::SetDataLength(FX_INT32 length)
+void CBC_OnedEAN8Writer::SetDataLength(int32_t length)
{
m_iDataLenth = 8;
}
@@ -54,7 +54,7 @@ FX_BOOL CBC_OnedEAN8Writer::SetTextLocation(BC_TEXT_LOC location) }
FX_BOOL CBC_OnedEAN8Writer::CheckContentValidity(FX_WSTR contents)
{
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
} else {
@@ -67,7 +67,7 @@ CFX_WideString CBC_OnedEAN8Writer::FilterContents(FX_WSTR contents) {
CFX_WideString filtercontents;
FX_WCHAR ch;
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if(ch > 175) {
i++;
@@ -79,12 +79,12 @@ CFX_WideString CBC_OnedEAN8Writer::FilterContents(FX_WSTR contents) }
return filtercontents;
}
-FX_INT32 CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents)
+int32_t CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents)
{
- FX_INT32 odd = 0;
- FX_INT32 even = 0;
- FX_INT32 j = 1;
- for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) {
+ int32_t odd = 0;
+ int32_t even = 0;
+ int32_t j = 1;
+ for(int32_t i = contents.GetLength() - 1; i >= 0; i--) {
if(j % 2) {
odd += FXSYS_atoi(contents.Mid(i, 1));
} else {
@@ -92,44 +92,44 @@ FX_INT32 CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents) }
j++;
}
- FX_INT32 checksum = (odd * 3 + even) % 10;
+ int32_t checksum = (odd * 3 + even) % 10;
checksum = (10 - checksum) % 10;
return (checksum);
}
-FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight , FX_INT32 &e)
+uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight , int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format,
- FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints , FX_INT32 &e)
+uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format,
+ int32_t &outWidth, int32_t &outHeight, int32_t hints , int32_t &e)
{
if (format != BCFORMAT_EAN_8) {
e = BCExceptionOnlyEncodeEAN_8;
return NULL;
}
- FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
+ uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength , FX_INT32 &e)
+uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, int32_t &outLength , int32_t &e)
{
if (contents.GetLength() != 8) {
e = BCExceptionDigitLengthMustBe8;
return NULL;
}
outLength = m_codeWidth;
- FX_BYTE *result = FX_Alloc(FX_BYTE, m_codeWidth);
- FX_INT32 pos = 0;
+ uint8_t *result = FX_Alloc(uint8_t, m_codeWidth);
+ int32_t pos = 0;
pos += AppendPattern(result, pos, CBC_OneDimReader::START_END_PATTERN, 3, 1, e);
if (e != BCExceptionNO) {
FX_Free (result);
return NULL;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i <= 3; i++) {
- FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1));
+ int32_t digit = FXSYS_atoi(contents.Mid(i, 1));
pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 0, e);
if (e != BCExceptionNO) {
FX_Free (result);
@@ -142,7 +142,7 @@ FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &ou return NULL;
}
for (i = 4; i <= 7; i++) {
- FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1));
+ int32_t digit = FXSYS_atoi(contents.Mid(i, 1));
pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e);
if (e != BCExceptionNO) {
FX_Free (result);
@@ -156,31 +156,31 @@ FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &ou }
return result;
}
-void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e)
+void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e)
{
if (device == NULL && pOutBitmap == NULL) {
e = BCExceptionIllegalArgument;
return;
}
- FX_INT32 leftPosition = 3 * multiple;
+ int32_t leftPosition = 3 * multiple;
CFX_ByteString str = FX_UTF8Encode(contents);
- FX_INT32 iLength = str.GetLength();
+ int32_t iLength = str.GetLength();
FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLength);
if (!pCharPos) {
return;
}
FXSYS_memset32(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLength);
CFX_ByteString tempStr = str.Mid(0, 4);
- FX_INT32 iLen = tempStr.GetLength();
- FX_INT32 strWidth = 7 * multiple * 4;
+ int32_t iLen = tempStr.GetLength();
+ int32_t strWidth = 7 * multiple * 4;
FX_FLOAT blank = 0.0;
CFX_FxgeDevice geBitmap;
if (pOutBitmap != NULL) {
geBitmap.Attach(pOutBitmap);
}
FX_FLOAT charsWidth = 0;
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
if (pOutBitmap == NULL) {
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height);
@@ -196,7 +196,7 @@ void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C device->FillRect(&re, m_backgroundColor);
}
if (pOutBitmap == NULL) {
- strWidth = (FX_INT32)(strWidth * m_outputHScale);
+ strWidth = (int32_t)(strWidth * m_outputHScale);
}
CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank);
CFX_AffineMatrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize);
@@ -255,7 +255,7 @@ void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C }
FX_Free(pCharPos);
}
-void CBC_OnedEAN8Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OnedEAN8Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h index 2b55734538..f2e5cc2cbe 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h @@ -12,21 +12,21 @@ class CBC_OnedEAN8Writer; class CBC_OnedEAN8Writer : public CBC_OneDimWriter
{
private:
- FX_INT32 m_codeWidth;
+ int32_t m_codeWidth;
public:
CBC_OnedEAN8Writer();
virtual ~CBC_OnedEAN8Writer();
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight , FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints , FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
- void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight , int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints , int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e);
+ void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
FX_BOOL CheckContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
- void SetDataLength(FX_INT32 length);
+ void SetDataLength(int32_t length);
FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+ int32_t CalcChecksum(const CFX_ByteString &contents);
protected:
- void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp index 44c26acf7e..0156ba4af7 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp @@ -42,7 +42,7 @@ CBC_OnedUPCAReader::~CBC_OnedUPCAReader() }
m_ean13Reader = NULL;
}
-CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e)
{
CFX_ByteString bytestring = m_ean13Reader->DecodeRow(rowNumber, row, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -50,7 +50,7 @@ CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitAr BC_EXCEPTION_CHECK_ReturnValue(e, "");
return temp;
}
-CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e)
{
CFX_ByteString bytestring = m_ean13Reader->DecodeRow(rowNumber, row, startGuardRange, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -58,7 +58,7 @@ CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitAr BC_EXCEPTION_CHECK_ReturnValue(e, "");
return temp;
}
-CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e)
+CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, int32_t &e)
{
CFX_ByteString bytestring = m_ean13Reader->Decode(image, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -66,7 +66,7 @@ CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, "");
return temp;
}
-CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
CFX_ByteString bytestring = m_ean13Reader->Decode(image, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -74,13 +74,13 @@ CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hint BC_EXCEPTION_CHECK_ReturnValue(e, "");
return temp;
}
-FX_INT32 CBC_OnedUPCAReader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e)
+int32_t CBC_OnedUPCAReader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e)
{
- FX_INT32 temp = m_ean13Reader->DecodeMiddle(row, startRange, resultString, e);
+ int32_t temp = m_ean13Reader->DecodeMiddle(row, startRange, resultString, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
return temp;
}
-CFX_ByteString CBC_OnedUPCAReader::MaybeReturnResult(CFX_ByteString &result, FX_INT32 &e)
+CFX_ByteString CBC_OnedUPCAReader::MaybeReturnResult(CFX_ByteString &result, int32_t &e)
{
if(result[0] == '0') {
result.Delete(0);
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h index 5df6c739ff..c1eccb57d1 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h @@ -18,13 +18,13 @@ private: public:
CBC_OnedUPCAReader();
virtual ~CBC_OnedUPCAReader();
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
- CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e);
+ CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e);
virtual void Init();
protected:
- FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e);
- CFX_ByteString MaybeReturnResult(CFX_ByteString &result, FX_INT32 &e);
+ int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e);
+ CFX_ByteString MaybeReturnResult(CFX_ByteString &result, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 612c031c02..56324a8e1a 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -44,7 +44,7 @@ CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() }
FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(FX_WSTR contents)
{
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
@@ -58,7 +58,7 @@ CFX_WideString CBC_OnedUPCAWriter::FilterContents(FX_WSTR contents) {
CFX_WideString filtercontents;
FX_WCHAR ch;
- for (FX_INT32 i = 0; i < contents.GetLength(); i++) {
+ for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if(ch > 175) {
i++;
@@ -70,12 +70,12 @@ CFX_WideString CBC_OnedUPCAWriter::FilterContents(FX_WSTR contents) }
return filtercontents;
}
-FX_INT32 CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents)
+int32_t CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents)
{
- FX_INT32 odd = 0;
- FX_INT32 even = 0;
- FX_INT32 j = 1;
- for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) {
+ int32_t odd = 0;
+ int32_t even = 0;
+ int32_t j = 1;
+ for(int32_t i = contents.GetLength() - 1; i >= 0; i--) {
if(j % 2) {
odd += FXSYS_atoi(contents.Mid(i, 1));
} else {
@@ -83,17 +83,17 @@ FX_INT32 CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents) }
j++;
}
- FX_INT32 checksum = (odd * 3 + even) % 10;
+ int32_t checksum = (odd * 3 + even) % 10;
checksum = (10 - checksum) % 10;
return (checksum);
}
-FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
- FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e);
+ uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
if (format != BCFORMAT_UPC_A) {
e = BCExceptionOnlyEncodeUPC_A;
@@ -101,20 +101,20 @@ FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT for }
CFX_ByteString toEAN13String = '0' + contents;
m_iDataLenth = 13;
- FX_BYTE *ret = m_subWriter->Encode(toEAN13String, BCFORMAT_EAN_13, outWidth, outHeight, hints, e);
+ uint8_t *ret = m_subWriter->Encode(toEAN13String, BCFORMAT_EAN_13, outWidth, outHeight, hints, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return ret;
}
-void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e)
+void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e)
{
if (device == NULL && pOutBitmap == NULL) {
e = BCExceptionIllegalArgument;
return;
}
- FX_INT32 leftPadding = 7 * multiple;
- FX_INT32 leftPosition = 10 * multiple + leftPadding;
+ int32_t leftPadding = 7 * multiple;
+ int32_t leftPosition = 10 * multiple + leftPadding;
CFX_ByteString str = FX_UTF8Encode(contents);
- FX_INT32 iLen = str.GetLength();
+ int32_t iLen = str.GetLength();
FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen);
if (!pCharPos) {
return;
@@ -129,8 +129,8 @@ void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C }
FX_FLOAT charsWidth = 0;
iLen = tempStr.GetLength();
- FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize);
- FX_INT32 iTextHeight = iFontSize + 1;
+ int32_t iFontSize = (int32_t)fabs(m_fFontSize);
+ int32_t iTextHeight = iFontSize + 1;
if (pOutBitmap == NULL) {
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height);
@@ -278,7 +278,7 @@ void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C }
FX_Free(pCharPos);
}
-void CBC_OnedUPCAWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e)
+void CBC_OnedUPCAWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e)
{
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h index 4174ceb36e..ff59f9b660 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h @@ -17,15 +17,15 @@ public: CBC_OnedUPCAWriter();
virtual ~CBC_OnedUPCAWriter();
virtual void Init();
- FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e);
FX_BOOL CheckContentValidity(FX_WSTR contents);
CFX_WideString FilterContents(FX_WSTR contents);
- FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+ int32_t CalcChecksum(const CFX_ByteString &contents);
protected:
- void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp index 96d3a3b655..366b172863 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp @@ -27,9 +27,9 @@ #include "BC_PDF417ErrorCorrection.h"
#include "BC_PDF417HighLevelEncoder.h"
#include "BC_PDF417.h"
-FX_INT32 CBC_PDF417::START_PATTERN = 0x1fea8;
-FX_INT32 CBC_PDF417::STOP_PATTERN = 0x3fa29;
-FX_INT32 CBC_PDF417::CODEWORD_TABLE[][1000] = {
+int32_t CBC_PDF417::START_PATTERN = 0x1fea8;
+int32_t CBC_PDF417::STOP_PATTERN = 0x3fa29;
+int32_t CBC_PDF417::CODEWORD_TABLE[][1000] = {
{
0x1d5c0, 0x1eaf0, 0x1f57c, 0x1d4e0, 0x1ea78, 0x1f53e,
0x1a8c0, 0x1d470, 0x1a860, 0x15040, 0x1a830, 0x15020,
@@ -535,28 +535,28 @@ CBC_BarcodeMatrix* CBC_PDF417::getBarcodeMatrix() {
return m_barcodeMatrix;
}
-void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrectionLevel, FX_INT32 &e)
+void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, int32_t errorCorrectionLevel, int32_t &e)
{
- FX_INT32 errorCorrectionCodeWords = CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(errorCorrectionLevel, e);
+ int32_t errorCorrectionCodeWords = CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(errorCorrectionLevel, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
CFX_WideString highLevel = CBC_PDF417HighLevelEncoder::encodeHighLevel(msg, m_compaction, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 sourceCodeWords = highLevel.GetLength();
+ int32_t sourceCodeWords = highLevel.GetLength();
CFX_Int32Array* dimension = determineDimensions(sourceCodeWords, errorCorrectionCodeWords, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 cols = dimension->GetAt(0);
- FX_INT32 rows = dimension->GetAt(1);
+ int32_t cols = dimension->GetAt(0);
+ int32_t rows = dimension->GetAt(1);
delete dimension;
- FX_INT32 pad = getNumberOfPadCodewords(sourceCodeWords, errorCorrectionCodeWords, cols, rows);
+ int32_t pad = getNumberOfPadCodewords(sourceCodeWords, errorCorrectionCodeWords, cols, rows);
if (sourceCodeWords + errorCorrectionCodeWords + 1 > 929) {
e = BCExceptionEncodedMessageContainsTooManyCodeWords;
return;
}
- FX_INT32 n = sourceCodeWords + pad + 1;
+ int32_t n = sourceCodeWords + pad + 1;
CFX_WideString sb;
sb += (FX_WCHAR) n;
sb += highLevel;
- for (FX_INT32 i = 0; i < pad; i++) {
+ for (int32_t i = 0; i < pad; i++) {
sb += (FX_WCHAR) 900;
}
CFX_WideString dataCodewords(sb);
@@ -566,7 +566,7 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrecti m_barcodeMatrix = FX_NEW CBC_BarcodeMatrix(rows, cols);
encodeLowLevel(fullCodewords, cols, rows, errorCorrectionLevel, m_barcodeMatrix);
}
-void CBC_PDF417::setDimensions(FX_INT32 maxCols, FX_INT32 minCols, FX_INT32 maxRows, FX_INT32 minRows)
+void CBC_PDF417::setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows)
{
m_maxCols = maxCols;
m_minCols = minCols;
@@ -581,25 +581,25 @@ void CBC_PDF417::setCompact(FX_BOOL compact) {
m_compact = compact;
}
-FX_INT32 CBC_PDF417::calculateNumberOfRows(FX_INT32 m, FX_INT32 k, FX_INT32 c)
+int32_t CBC_PDF417::calculateNumberOfRows(int32_t m, int32_t k, int32_t c)
{
- FX_INT32 r = ((m + 1 + k) / c) + 1;
+ int32_t r = ((m + 1 + k) / c) + 1;
if (c * r >= (m + 1 + k + c)) {
r--;
}
return r;
}
-FX_INT32 CBC_PDF417::getNumberOfPadCodewords(FX_INT32 m, FX_INT32 k, FX_INT32 c, FX_INT32 r)
+int32_t CBC_PDF417::getNumberOfPadCodewords(int32_t m, int32_t k, int32_t c, int32_t r)
{
- FX_INT32 n = c * r - k;
+ int32_t n = c * r - k;
return n > m + 1 ? n - m - 1 : 0;
}
-void CBC_PDF417::encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logic)
+void CBC_PDF417::encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic)
{
- FX_INT32 map = 1 << (len - 1);
+ int32_t map = 1 << (len - 1);
FX_BOOL last = ((pattern & map) != 0);
- FX_INT32 width = 0;
- for (FX_INT32 i = 0; i < len; i++) {
+ int32_t width = 0;
+ for (int32_t i = 0; i < len; i++) {
FX_BOOL black = ((pattern & map) != 0);
if (last == black) {
width++;
@@ -612,16 +612,16 @@ void CBC_PDF417::encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logi }
logic->addBar(last, width);
}
-void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT32 r, FX_INT32 errorCorrectionLevel, CBC_BarcodeMatrix* logic)
+void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, int32_t c, int32_t r, int32_t errorCorrectionLevel, CBC_BarcodeMatrix* logic)
{
- FX_INT32 idx = 0;
- for (FX_INT32 y = 0; y < r; y++) {
- FX_INT32 cluster = y % 3;
+ int32_t idx = 0;
+ for (int32_t y = 0; y < r; y++) {
+ int32_t cluster = y % 3;
logic->startRow();
- FX_INT32 a = START_PATTERN;
+ int32_t a = START_PATTERN;
encodeChar(START_PATTERN, 17, logic->getCurrentRow());
- FX_INT32 left;
- FX_INT32 right;
+ int32_t left;
+ int32_t right;
if (cluster == 0) {
left = (30 * (y / 3)) + ((r - 1) / 3);
right = (30 * (y / 3)) + (c - 1);
@@ -632,9 +632,9 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT left = (30 * (y / 3)) + (c - 1);
right = (30 * (y / 3)) + (errorCorrectionLevel * 3) + ((r - 1) % 3);
}
- FX_INT32 pattern = CODEWORD_TABLE[cluster][left];
+ int32_t pattern = CODEWORD_TABLE[cluster][left];
encodeChar(pattern, 17, logic->getCurrentRow());
- for (FX_INT32 x = 0; x < c; x++) {
+ for (int32_t x = 0; x < c; x++) {
pattern = CODEWORD_TABLE[cluster][fullCodewords.GetAt(idx)];
encodeChar(pattern, 17, logic->getCurrentRow());
idx++;
@@ -648,12 +648,12 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT }
}
}
-CFX_Int32Array* CBC_PDF417::determineDimensions(FX_INT32 sourceCodeWords, FX_INT32 errorCorrectionCodeWords, FX_INT32 &e)
+CFX_Int32Array* CBC_PDF417::determineDimensions(int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t &e)
{
FX_FLOAT ratio = 0.0f;
CFX_Int32Array* dimension = NULL;
- for (FX_INT32 cols = m_minCols; cols <= m_maxCols; cols++) {
- FX_INT32 rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols);
+ for (int32_t cols = m_minCols; cols <= m_maxCols; cols++) {
+ int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols);
if (rows < m_minRows) {
break;
}
@@ -673,7 +673,7 @@ CFX_Int32Array* CBC_PDF417::determineDimensions(FX_INT32 sourceCodeWords, FX_INT dimension->Add(rows);
}
if (dimension == NULL) {
- FX_INT32 rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols);
+ int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols);
if (rows < m_minRows) {
dimension = FX_NEW CFX_Int32Array;
dimension->Add(m_minCols);
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417.h b/xfa/src/fxbarcode/pdf417/BC_PDF417.h index 928afe80d2..21d902ef7a 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417.h @@ -16,29 +16,29 @@ public: CBC_PDF417(FX_BOOL compact);
virtual ~CBC_PDF417();
CBC_BarcodeMatrix* getBarcodeMatrix();
- void generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrectionLevel, FX_INT32 &e);
- void setDimensions(FX_INT32 maxCols, FX_INT32 minCols, FX_INT32 maxRows, FX_INT32 minRows);
+ void generateBarcodeLogic(CFX_WideString msg, int32_t errorCorrectionLevel, int32_t &e);
+ void setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows);
void setCompaction(Compaction compaction);
void setCompact(FX_BOOL compact);
private:
- static FX_INT32 START_PATTERN;
- static FX_INT32 STOP_PATTERN;
- static FX_INT32 CODEWORD_TABLE[][1000];
+ static int32_t START_PATTERN;
+ static int32_t STOP_PATTERN;
+ static int32_t CODEWORD_TABLE[][1000];
static FX_FLOAT PREFERRED_RATIO;
static FX_FLOAT DEFAULT_MODULE_WIDTH;
static FX_FLOAT HEIGHT;
CBC_BarcodeMatrix* m_barcodeMatrix;
FX_BOOL m_compact;
Compaction m_compaction;
- FX_INT32 m_minCols;
- FX_INT32 m_maxCols;
- FX_INT32 m_maxRows;
- FX_INT32 m_minRows;
+ int32_t m_minCols;
+ int32_t m_maxCols;
+ int32_t m_maxRows;
+ int32_t m_minRows;
private:
- static FX_INT32 calculateNumberOfRows(FX_INT32 m, FX_INT32 k, FX_INT32 c);
- static FX_INT32 getNumberOfPadCodewords(FX_INT32 m, FX_INT32 k, FX_INT32 c, FX_INT32 r);
- static void encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logic);
- void encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT32 r, FX_INT32 errorCorrectionLevel, CBC_BarcodeMatrix* logic);
- CFX_Int32Array* determineDimensions(FX_INT32 sourceCodeWords, FX_INT32 errorCorrectionCodeWords, FX_INT32 &e);
+ static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c);
+ static int32_t getNumberOfPadCodewords(int32_t m, int32_t k, int32_t c, int32_t r);
+ static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic);
+ void encodeLowLevel(CFX_WideString fullCodewords, int32_t c, int32_t r, int32_t errorCorrectionLevel, CBC_BarcodeMatrix* logic);
+ CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index e45562ba79..aa30e25d49 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -23,10 +23,10 @@ #include "../barcode.h"
#include "BC_PDF417BarcodeRow.h"
#include "BC_PDF417BarcodeMatrix.h"
-CBC_BarcodeMatrix::CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width)
+CBC_BarcodeMatrix::CBC_BarcodeMatrix(int32_t height, int32_t width)
{
m_matrix.SetSize(height + 2);
- for (FX_INT32 i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength; i++) {
+ for (int32_t i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength; i++) {
m_matrix[i] = FX_NEW CBC_BarcodeRow((width + 4) * 17 + 1);
}
m_width = width * 17;
@@ -37,19 +37,19 @@ CBC_BarcodeMatrix::CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width) }
CBC_BarcodeMatrix::~CBC_BarcodeMatrix()
{
- for (FX_INT32 i = 0; i < m_matrix.GetSize(); i++) {
+ for (int32_t i = 0; i < m_matrix.GetSize(); i++) {
delete (CBC_BarcodeRow*)m_matrix.GetAt(i);
}
m_matrix.RemoveAll();
m_matrixOut.RemoveAll();
}
-void CBC_BarcodeMatrix::set(FX_INT32 x, FX_INT32 y, FX_BYTE value)
+void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value)
{
((CBC_BarcodeRow*)m_matrix[y])->set(x, value);
}
-void CBC_BarcodeMatrix::setMatrix(FX_INT32 x, FX_INT32 y, FX_BOOL black)
+void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, FX_BOOL black)
{
- set(x, y, (FX_BYTE) (black ? 1 : 0));
+ set(x, y, (uint8_t) (black ? 1 : 0));
}
void CBC_BarcodeMatrix::startRow()
{
@@ -59,11 +59,11 @@ CBC_BarcodeRow* CBC_BarcodeMatrix::getCurrentRow() {
return (CBC_BarcodeRow*)m_matrix[m_currentRow];
}
-FX_INT32 CBC_BarcodeMatrix::getWidth()
+int32_t CBC_BarcodeMatrix::getWidth()
{
return m_outWidth;
}
-FX_INT32 CBC_BarcodeMatrix::getHeight()
+int32_t CBC_BarcodeMatrix::getHeight()
{
return m_outHeight;
}
@@ -71,26 +71,26 @@ CFX_ByteArray& CBC_BarcodeMatrix::getMatrix() {
return getScaledMatrix(1, 1);
}
-CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(FX_INT32 scale)
+CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale)
{
return getScaledMatrix(scale, scale);
}
-CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(FX_INT32 xScale, FX_INT32 yScale)
+CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, int32_t yScale)
{
- FX_INT32 yMax = m_height * yScale;
+ int32_t yMax = m_height * yScale;
CFX_ByteArray bytearray;
bytearray.Copy(((CBC_BarcodeRow*)m_matrix[0])->getScaledRow(xScale));
- FX_INT32 xMax = bytearray.GetSize();
+ int32_t xMax = bytearray.GetSize();
m_matrixOut.SetSize(xMax * yMax);
m_outWidth = xMax;
m_outHeight = yMax;
- FX_INT32 k = 0;
- for (FX_INT32 i = 0; i < yMax; i++) {
+ int32_t k = 0;
+ for (int32_t i = 0; i < yMax; i++) {
if (i != 0) {
bytearray.Copy(((CBC_BarcodeRow*)m_matrix[i / yScale])->getScaledRow(xScale));
}
k = i * xMax;
- for (FX_INT32 l = 0; l < xMax; l++) {
+ for (int32_t l = 0; l < xMax; l++) {
m_matrixOut[k + l] = bytearray.GetAt(l);
}
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index ce0681bfa8..f5f035dbca 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -11,24 +11,24 @@ class CBC_BarcodeMatrix {
public:
CBC_BarcodeMatrix();
- CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width);
+ CBC_BarcodeMatrix(int32_t height, int32_t width);
virtual ~CBC_BarcodeMatrix();
- void set(FX_INT32 x, FX_INT32 y, FX_BYTE value);
- void setMatrix(FX_INT32 x, FX_INT32 y, FX_BOOL black);
+ void set(int32_t x, int32_t y, uint8_t value);
+ void setMatrix(int32_t x, int32_t y, FX_BOOL black);
void startRow();
CBC_BarcodeRow* getCurrentRow();
CFX_ByteArray& getMatrix();
- CFX_ByteArray& getScaledMatrix(FX_INT32 scale);
- CFX_ByteArray& getScaledMatrix(FX_INT32 xScale, FX_INT32 yScale);
- FX_INT32 getWidth();
- FX_INT32 getHeight();
+ CFX_ByteArray& getScaledMatrix(int32_t scale);
+ CFX_ByteArray& getScaledMatrix(int32_t xScale, int32_t yScale);
+ int32_t getWidth();
+ int32_t getHeight();
private:
CFX_PtrArray m_matrix;
CFX_ByteArray m_matrixOut;
- FX_INT32 m_currentRow;
- FX_INT32 m_height;
- FX_INT32 m_width;
- FX_INT32 m_outWidth;
- FX_INT32 m_outHeight;
+ int32_t m_currentRow;
+ int32_t m_height;
+ int32_t m_width;
+ int32_t m_outWidth;
+ int32_t m_outHeight;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp index 456c0e6f2e..fc3f255ec0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp @@ -22,7 +22,7 @@ #include "../barcode.h"
#include "BC_PDF417BarcodeMetadata.h"
-CBC_BarcodeMetadata::CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCountUpperPart, FX_INT32 rowCountLowerPart, FX_INT32 errorCorrectionLevel)
+CBC_BarcodeMetadata::CBC_BarcodeMetadata(int32_t columnCount, int32_t rowCountUpperPart, int32_t rowCountLowerPart, int32_t errorCorrectionLevel)
{
m_columnCount = columnCount;
m_rowCountUpperPart = rowCountUpperPart;
@@ -33,23 +33,23 @@ CBC_BarcodeMetadata::CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCount CBC_BarcodeMetadata::~CBC_BarcodeMetadata()
{
}
-FX_INT32 CBC_BarcodeMetadata::getColumnCount()
+int32_t CBC_BarcodeMetadata::getColumnCount()
{
return m_columnCount;
}
-FX_INT32 CBC_BarcodeMetadata::getErrorCorrectionLevel()
+int32_t CBC_BarcodeMetadata::getErrorCorrectionLevel()
{
return m_errorCorrectionLevel;
}
-FX_INT32 CBC_BarcodeMetadata::getRowCount()
+int32_t CBC_BarcodeMetadata::getRowCount()
{
return m_rowCount;
}
-FX_INT32 CBC_BarcodeMetadata::getRowCountUpperPart()
+int32_t CBC_BarcodeMetadata::getRowCountUpperPart()
{
return m_rowCountUpperPart;
}
-FX_INT32 CBC_BarcodeMetadata::getRowCountLowerPart()
+int32_t CBC_BarcodeMetadata::getRowCountLowerPart()
{
return m_rowCountLowerPart;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h index 6e2aa4d952..f25e37c1b4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h @@ -10,18 +10,18 @@ class CBC_BarcodeMetadata; class CBC_BarcodeMetadata
{
public:
- CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCountUpperPart, FX_INT32 rowCountLowerPart, FX_INT32 errorCorrectionLevel);
+ CBC_BarcodeMetadata(int32_t columnCount, int32_t rowCountUpperPart, int32_t rowCountLowerPart, int32_t errorCorrectionLevel);
virtual ~CBC_BarcodeMetadata();
- FX_INT32 getColumnCount();
- FX_INT32 getErrorCorrectionLevel();
- FX_INT32 getRowCount();
- FX_INT32 getRowCountUpperPart();
- FX_INT32 getRowCountLowerPart();
+ int32_t getColumnCount();
+ int32_t getErrorCorrectionLevel();
+ int32_t getRowCount();
+ int32_t getRowCountUpperPart();
+ int32_t getRowCountLowerPart();
private:
- FX_INT32 m_columnCount;
- FX_INT32 m_errorCorrectionLevel;
- FX_INT32 m_rowCountUpperPart;
- FX_INT32 m_rowCountLowerPart;
- FX_INT32 m_rowCount;
+ int32_t m_columnCount;
+ int32_t m_errorCorrectionLevel;
+ int32_t m_rowCountUpperPart;
+ int32_t m_rowCountLowerPart;
+ int32_t m_rowCount;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index 02bc0f5574..8918d32600 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -22,7 +22,7 @@ #include "../barcode.h"
#include "BC_PDF417BarcodeRow.h"
-CBC_BarcodeRow::CBC_BarcodeRow(FX_INT32 width)
+CBC_BarcodeRow::CBC_BarcodeRow(int32_t width)
{
m_row.SetSize(width);
m_currentLocation = 0;
@@ -32,17 +32,17 @@ CBC_BarcodeRow::~CBC_BarcodeRow() m_output.RemoveAll();
m_row.RemoveAll();
}
-void CBC_BarcodeRow::set(FX_INT32 x, FX_BYTE value)
+void CBC_BarcodeRow::set(int32_t x, uint8_t value)
{
m_row.SetAt(x, value);
}
-void CBC_BarcodeRow::set(FX_INT32 x, FX_BOOL black)
+void CBC_BarcodeRow::set(int32_t x, FX_BOOL black)
{
- m_row.SetAt(x, (FX_BYTE) (black ? 1 : 0));
+ m_row.SetAt(x, (uint8_t) (black ? 1 : 0));
}
-void CBC_BarcodeRow::addBar(FX_BOOL black, FX_INT32 width)
+void CBC_BarcodeRow::addBar(FX_BOOL black, int32_t width)
{
- for (FX_INT32 ii = 0; ii < width; ii++) {
+ for (int32_t ii = 0; ii < width; ii++) {
set(m_currentLocation++, black);
}
}
@@ -50,10 +50,10 @@ CFX_ByteArray& CBC_BarcodeRow::getRow() {
return m_row;
}
-CFX_ByteArray& CBC_BarcodeRow::getScaledRow(FX_INT32 scale)
+CFX_ByteArray& CBC_BarcodeRow::getScaledRow(int32_t scale)
{
m_output.SetSize(m_row.GetSize() * scale);
- for (FX_INT32 i = 0; i < m_output.GetSize(); i++) {
+ for (int32_t i = 0; i < m_output.GetSize(); i++) {
m_output[i] = (m_row[i / scale]);
}
return m_output;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index c5520f6440..0fd1003477 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -9,16 +9,16 @@ class CBC_BarcodeRow
{
public:
- CBC_BarcodeRow(FX_INT32 width);
+ CBC_BarcodeRow(int32_t width);
virtual ~CBC_BarcodeRow();
- void set(FX_INT32 x, FX_BYTE value);
- void set(FX_INT32 x, FX_BOOL black);
- void addBar(FX_BOOL black, FX_INT32 width);
+ void set(int32_t x, uint8_t value);
+ void set(int32_t x, FX_BOOL black);
+ void addBar(FX_BOOL black, int32_t width);
CFX_ByteArray& getRow();
- CFX_ByteArray& getScaledRow(FX_INT32 scale);
+ CFX_ByteArray& getScaledRow(int32_t scale);
private:
CFX_ByteArray m_row;
CFX_ByteArray m_output;
- FX_INT32 m_currentLocation;
+ int32_t m_currentLocation;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp index 446ef58a48..90fbea9897 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp @@ -29,10 +29,10 @@ CBC_BarcodeValue::CBC_BarcodeValue() CBC_BarcodeValue::~CBC_BarcodeValue()
{
}
-void CBC_BarcodeValue::setValue(FX_INT32 value)
+void CBC_BarcodeValue::setValue(int32_t value)
{
- FX_INT32 confidence = 0;
- for (FX_INT32 i = 0; i < m_keys.GetSize(); i++) {
+ int32_t confidence = 0;
+ for (int32_t i = 0; i < m_keys.GetSize(); i++) {
if (m_keys.GetAt(i) == value) {
confidence = m_values.GetAt(i);
m_values.SetAt(i, confidence + 1);
@@ -45,9 +45,9 @@ void CBC_BarcodeValue::setValue(FX_INT32 value) }
CFX_Int32Array* CBC_BarcodeValue::getValue()
{
- FX_INT32 maxConfidence = -1;
+ int32_t maxConfidence = -1;
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
- for (FX_INT32 i = 0; i < m_keys.GetSize(); i++) {
+ for (int32_t i = 0; i < m_keys.GetSize(); i++) {
if (m_values.GetAt(i) > maxConfidence) {
maxConfidence = m_values.GetAt(i);
result->RemoveAll();
@@ -58,9 +58,9 @@ CFX_Int32Array* CBC_BarcodeValue::getValue() }
return result;
}
-FX_INT32 CBC_BarcodeValue::getConfidence(FX_INT32 value)
+int32_t CBC_BarcodeValue::getConfidence(int32_t value)
{
- for (FX_INT32 i = 0; i < m_keys.GetSize(); i++)
+ for (int32_t i = 0; i < m_keys.GetSize(); i++)
if (m_keys.GetAt(i) == value) {
return m_values.GetAt(i);
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h index 6922d410f0..7729e04a14 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h @@ -11,9 +11,9 @@ class CBC_BarcodeValue public:
CBC_BarcodeValue();
virtual ~CBC_BarcodeValue();
- void setValue(FX_INT32 value);
+ void setValue(int32_t value);
CFX_Int32Array* getValue();
- FX_INT32 getConfidence(FX_INT32 value);
+ int32_t getConfidence(int32_t value);
private:
CFX_Int32Array m_keys;
CFX_Int32Array m_values;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp index 55f4cb4510..fec4abcafa 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp @@ -24,7 +24,7 @@ #include "../BC_ResultPoint.h"
#include "../common/BC_CommonBitMatrix.h"
#include "BC_PDF417BoundingBox.h"
-CBC_BoundingBox::CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, FX_INT32 &e)
+CBC_BoundingBox::CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, int32_t &e)
{
if ((topLeft == NULL && topRight == NULL) ||
(bottomLeft == NULL && bottomRight == NULL) ||
@@ -53,7 +53,7 @@ CBC_BoundingBox::~CBC_BoundingBox() delete m_bottomRight;
}
}
-CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, FX_INT32 &e)
+CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, int32_t &e)
{
CBC_BoundingBox* boundingBox = NULL;
if (leftBox == NULL) {
@@ -68,7 +68,7 @@ CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBo BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return boundingBox;
}
-CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_INT32 missingEndRows, FX_BOOL isLeft, FX_INT32 &e)
+CBC_BoundingBox* CBC_BoundingBox::addMissingRows(int32_t missingStartRows, int32_t missingEndRows, FX_BOOL isLeft, int32_t &e)
{
CBC_ResultPoint* newTopLeft = m_topLeft;
CBC_ResultPoint* newBottomLeft = m_bottomLeft;
@@ -78,7 +78,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_I CBC_ResultPoint* newBottom = NULL;
if (missingStartRows > 0) {
CBC_ResultPoint* top = isLeft ? m_topLeft : m_topRight;
- FX_INT32 newMinY = (FX_INT32) top->GetY() - missingStartRows;
+ int32_t newMinY = (int32_t) top->GetY() - missingStartRows;
if (newMinY < 0) {
newMinY = 0;
}
@@ -91,7 +91,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_I }
if (missingEndRows > 0) {
CBC_ResultPoint* bottom = isLeft ? m_bottomLeft : m_bottomRight;
- FX_INT32 newMaxY = (FX_INT32) bottom->GetY() + missingEndRows;
+ int32_t newMaxY = (int32_t) bottom->GetY() + missingEndRows;
if (newMaxY >= m_image->GetHeight()) {
newMaxY = m_image->GetHeight() - 1;
}
@@ -125,19 +125,19 @@ void CBC_BoundingBox::setBottomRight(CBC_ResultPoint bottomRight) m_bottomRight = FX_NEW CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY());
calculateMinMaxValues();
}
-FX_INT32 CBC_BoundingBox::getMinX()
+int32_t CBC_BoundingBox::getMinX()
{
return m_minX;
}
-FX_INT32 CBC_BoundingBox::getMaxX()
+int32_t CBC_BoundingBox::getMaxX()
{
return m_maxX;
}
-FX_INT32 CBC_BoundingBox::getMinY()
+int32_t CBC_BoundingBox::getMinY()
{
return m_minY;
}
-FX_INT32 CBC_BoundingBox::getMaxY()
+int32_t CBC_BoundingBox::getMaxY()
{
return m_maxY;
}
@@ -187,8 +187,8 @@ void CBC_BoundingBox::calculateMinMaxValues() m_topRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_topLeft->GetY());
m_bottomRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_bottomLeft->GetY());
}
- m_minX = (FX_INT32) (m_topLeft->GetX() < m_bottomLeft->GetX() ? m_topLeft->GetX() : m_bottomLeft->GetX());
- m_maxX = (FX_INT32) (m_topRight->GetX() > m_bottomRight->GetX() ? m_topRight->GetX() : m_bottomRight->GetX());
- m_minY = (FX_INT32) (m_topLeft->GetY() < m_topRight->GetY() ? m_topLeft->GetY() : m_topRight->GetY());
- m_maxY = (FX_INT32) (m_bottomLeft->GetY() > m_bottomRight->GetY() ? m_bottomLeft->GetY() : m_bottomRight->GetY());
+ m_minX = (int32_t) (m_topLeft->GetX() < m_bottomLeft->GetX() ? m_topLeft->GetX() : m_bottomLeft->GetX());
+ m_maxX = (int32_t) (m_topRight->GetX() > m_bottomRight->GetX() ? m_topRight->GetX() : m_bottomRight->GetX());
+ m_minY = (int32_t) (m_topLeft->GetY() < m_topRight->GetY() ? m_topLeft->GetY() : m_topRight->GetY());
+ m_maxY = (int32_t) (m_bottomLeft->GetY() > m_bottomRight->GetY() ? m_bottomLeft->GetY() : m_bottomRight->GetY());
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h index 26bd1881c3..97d8406fd4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h @@ -11,17 +11,17 @@ class CBC_ResultPoint; class CBC_BoundingBox
{
public:
- CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, FX_INT32 &e);
+ CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, int32_t &e);
CBC_BoundingBox(CBC_BoundingBox* boundingBox);
virtual ~CBC_BoundingBox();
- static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, FX_INT32 &e);
- CBC_BoundingBox* addMissingRows(FX_INT32 missingStartRows, FX_INT32 missingEndRows, FX_BOOL isLeft, FX_INT32 &e);
+ static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, int32_t &e);
+ CBC_BoundingBox* addMissingRows(int32_t missingStartRows, int32_t missingEndRows, FX_BOOL isLeft, int32_t &e);
void setTopRight(CBC_ResultPoint topRight);
void setBottomRight(CBC_ResultPoint bottomRight);
- FX_INT32 getMinX();
- FX_INT32 getMaxX();
- FX_INT32 getMinY();
- FX_INT32 getMaxY();
+ int32_t getMinX();
+ int32_t getMaxX();
+ int32_t getMinY();
+ int32_t getMaxY();
CBC_ResultPoint* getTopLeft();
CBC_ResultPoint* getTopRight();
CBC_ResultPoint* getBottomLeft();
@@ -32,10 +32,10 @@ private: CBC_ResultPoint* m_bottomLeft;
CBC_ResultPoint* m_topRight;
CBC_ResultPoint* m_bottomRight;
- FX_INT32 m_minX;
- FX_INT32 m_maxX;
- FX_INT32 m_minY;
- FX_INT32 m_maxY;
+ int32_t m_minX;
+ int32_t m_maxX;
+ int32_t m_minY;
+ int32_t m_maxY;
void init(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight);
void calculateMinMaxValues();
};
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp index 9ac65ab7bc..8449a7ed06 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp @@ -22,8 +22,8 @@ #include "../barcode.h"
#include "BC_PDF417Codeword.h"
-FX_INT32 CBC_Codeword::BARCODE_ROW_UNKNOWN = -1;
-CBC_Codeword::CBC_Codeword(FX_INT32 startX, FX_INT32 endX, FX_INT32 bucket, FX_INT32 cvalue)
+int32_t CBC_Codeword::BARCODE_ROW_UNKNOWN = -1;
+CBC_Codeword::CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t cvalue)
{
m_startX = startX;
m_endX = endX;
@@ -38,7 +38,7 @@ FX_BOOL CBC_Codeword::hasValidRowNumber() {
return isValidRowNumber(m_rowNumber);
}
-FX_BOOL CBC_Codeword::isValidRowNumber(FX_INT32 rowNumber)
+FX_BOOL CBC_Codeword::isValidRowNumber(int32_t rowNumber)
{
return m_rowNumber != BARCODE_ROW_UNKNOWN && m_bucket == (m_rowNumber % 3) * 3;
}
@@ -46,31 +46,31 @@ void CBC_Codeword::setRowNumberAsRowIndicatorColumn() {
m_rowNumber = (m_value / 30) * 3 + m_bucket / 3;
}
-FX_INT32 CBC_Codeword::getWidth()
+int32_t CBC_Codeword::getWidth()
{
return m_endX - m_startX;
}
-FX_INT32 CBC_Codeword::getStartX()
+int32_t CBC_Codeword::getStartX()
{
return m_startX;
}
-FX_INT32 CBC_Codeword::getEndX()
+int32_t CBC_Codeword::getEndX()
{
return m_endX;
}
-FX_INT32 CBC_Codeword::getBucket()
+int32_t CBC_Codeword::getBucket()
{
return m_bucket;
}
-FX_INT32 CBC_Codeword::getValue()
+int32_t CBC_Codeword::getValue()
{
return m_value;
}
-FX_INT32 CBC_Codeword::getRowNumber()
+int32_t CBC_Codeword::getRowNumber()
{
return m_rowNumber;
}
-void CBC_Codeword::setRowNumber(FX_INT32 rowNumber)
+void CBC_Codeword::setRowNumber(int32_t rowNumber)
{
m_rowNumber = rowNumber;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h index ea0524cbf8..ef5e0aefc7 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h @@ -9,25 +9,25 @@ class CBC_Codeword
{
public:
- CBC_Codeword(FX_INT32 startX, FX_INT32 endX, FX_INT32 bucket, FX_INT32 value);
+ CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t value);
virtual ~CBC_Codeword();
FX_BOOL hasValidRowNumber() ;
- FX_BOOL isValidRowNumber(FX_INT32 rowNumber);
+ FX_BOOL isValidRowNumber(int32_t rowNumber);
void setRowNumberAsRowIndicatorColumn();
- FX_INT32 getWidth();
- FX_INT32 getStartX();
- FX_INT32 getEndX();
- FX_INT32 getBucket();
- FX_INT32 getValue();
- FX_INT32 getRowNumber();
- void setRowNumber(FX_INT32 rowNumber);
+ int32_t getWidth();
+ int32_t getStartX();
+ int32_t getEndX();
+ int32_t getBucket();
+ int32_t getValue();
+ int32_t getRowNumber();
+ void setRowNumber(int32_t rowNumber);
CFX_ByteString toString();
private:
- static FX_INT32 BARCODE_ROW_UNKNOWN;
- FX_INT32 m_startX;
- FX_INT32 m_endX;
- FX_INT32 m_bucket;
- FX_INT32 m_value;
- FX_INT32 m_rowNumber;
+ static int32_t BARCODE_ROW_UNKNOWN;
+ int32_t m_startX;
+ int32_t m_endX;
+ int32_t m_bucket;
+ int32_t m_value;
+ int32_t m_rowNumber;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp index bf16bc25e0..822a47a4d4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp @@ -34,10 +34,10 @@ CBC_PDF417CodewordDecoder::~CBC_PDF417CodewordDecoder() }
void CBC_PDF417CodewordDecoder::Initialize()
{
- for (FX_INT32 i = 0; i < SYMBOL_TABLE_Length; i++) {
- FX_INT32 currentSymbol = CBC_PDF417Common::SYMBOL_TABLE[i];
- FX_INT32 currentBit = currentSymbol & 0x1;
- for (FX_INT32 j = 0; j < CBC_PDF417Common::BARS_IN_MODULE; j++) {
+ for (int32_t i = 0; i < SYMBOL_TABLE_Length; i++) {
+ int32_t currentSymbol = CBC_PDF417Common::SYMBOL_TABLE[i];
+ int32_t currentBit = currentSymbol & 0x1;
+ for (int32_t j = 0; j < CBC_PDF417Common::BARS_IN_MODULE; j++) {
FX_FLOAT size = 0.0f;
while ((currentSymbol & 0x1) == currentBit) {
size += 1.0f;
@@ -51,10 +51,10 @@ void CBC_PDF417CodewordDecoder::Initialize() void CBC_PDF417CodewordDecoder::Finalize()
{
}
-FX_INT32 CBC_PDF417CodewordDecoder::getDecodedValue(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417CodewordDecoder::getDecodedValue(CFX_Int32Array& moduleBitCount)
{
CFX_Int32Array* array = sampleBitCounts(moduleBitCount);
- FX_INT32 decodedValue = getDecodedCodewordValue(*array);
+ int32_t decodedValue = getDecodedCodewordValue(*array);
delete array;
if (decodedValue != -1) {
return decodedValue;
@@ -66,9 +66,9 @@ CFX_Int32Array* CBC_PDF417CodewordDecoder::sampleBitCounts(CFX_Int32Array& modul FX_FLOAT bitCountSum = (FX_FLOAT)CBC_PDF417Common::getBitCountSum(moduleBitCount);
CFX_Int32Array* bitCount = FX_NEW CFX_Int32Array();
bitCount->SetSize(CBC_PDF417Common::BARS_IN_MODULE);
- FX_INT32 bitCountIndex = 0;
- FX_INT32 sumPreviousBits = 0;
- for (FX_INT32 i = 0; i < CBC_PDF417Common::MODULES_IN_CODEWORD; i++) {
+ int32_t bitCountIndex = 0;
+ int32_t sumPreviousBits = 0;
+ for (int32_t i = 0; i < CBC_PDF417Common::MODULES_IN_CODEWORD; i++) {
FX_FLOAT sampleIndex = bitCountSum / (2 * CBC_PDF417Common::MODULES_IN_CODEWORD) + (i * bitCountSum) / CBC_PDF417Common::MODULES_IN_CODEWORD;
if (sumPreviousBits + moduleBitCount.GetAt(bitCountIndex) <= sampleIndex) {
sumPreviousBits += moduleBitCount.GetAt(bitCountIndex);
@@ -78,34 +78,34 @@ CFX_Int32Array* CBC_PDF417CodewordDecoder::sampleBitCounts(CFX_Int32Array& modul }
return bitCount;
}
-FX_INT32 CBC_PDF417CodewordDecoder::getDecodedCodewordValue(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417CodewordDecoder::getDecodedCodewordValue(CFX_Int32Array& moduleBitCount)
{
- FX_INT32 decodedValue = getBitValue(moduleBitCount);
+ int32_t decodedValue = getBitValue(moduleBitCount);
return CBC_PDF417Common::getCodeword(decodedValue) == -1 ? -1 : decodedValue;
}
-FX_INT32 CBC_PDF417CodewordDecoder::getBitValue(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417CodewordDecoder::getBitValue(CFX_Int32Array& moduleBitCount)
{
- FX_INT64 result = 0;
- for (FX_INT32 i = 0; i < moduleBitCount.GetSize(); i++) {
- for (FX_INT32 bit = 0; bit < moduleBitCount.GetAt(i); bit++) {
+ int64_t result = 0;
+ for (int32_t i = 0; i < moduleBitCount.GetSize(); i++) {
+ for (int32_t bit = 0; bit < moduleBitCount.GetAt(i); bit++) {
result = (result << 1) | (i % 2 == 0 ? 1 : 0);
}
}
- return (FX_INT32) result;
+ return (int32_t) result;
}
-FX_INT32 CBC_PDF417CodewordDecoder::getClosestDecodedValue(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417CodewordDecoder::getClosestDecodedValue(CFX_Int32Array& moduleBitCount)
{
- FX_INT32 bitCountSum = CBC_PDF417Common::getBitCountSum(moduleBitCount);
+ int32_t bitCountSum = CBC_PDF417Common::getBitCountSum(moduleBitCount);
CFX_FloatArray bitCountRatios;
bitCountRatios.SetSize(CBC_PDF417Common::BARS_IN_MODULE);
- for (FX_INT32 i = 0; i < bitCountRatios.GetSize(); i++) {
+ for (int32_t i = 0; i < bitCountRatios.GetSize(); i++) {
bitCountRatios[i] = moduleBitCount.GetAt(i) / (FX_FLOAT) bitCountSum;
}
FX_FLOAT bestMatchError = (FX_FLOAT)Float_MAX_VALUE;
- FX_INT32 bestMatch = -1;
- for (FX_INT32 j = 0; j < SYMBOL_TABLE_Length; j++) {
+ int32_t bestMatch = -1;
+ for (int32_t j = 0; j < SYMBOL_TABLE_Length; j++) {
FX_FLOAT error = 0.0f;
- for (FX_INT32 k = 0; k < CBC_PDF417Common::BARS_IN_MODULE; k++) {
+ for (int32_t k = 0; k < CBC_PDF417Common::BARS_IN_MODULE; k++) {
FX_FLOAT diff = RATIOS_TABLE[j][k] - bitCountRatios[k];
error += diff * diff;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h index f76d16d015..424d31b2ce 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h @@ -16,12 +16,12 @@ public: virtual ~CBC_PDF417CodewordDecoder();
static void Initialize();
static void Finalize();
- static FX_INT32 getDecodedValue(CFX_Int32Array& moduleBitCount);
+ static int32_t getDecodedValue(CFX_Int32Array& moduleBitCount);
private:
static FX_FLOAT RATIOS_TABLE[][8];
static CFX_Int32Array* sampleBitCounts(CFX_Int32Array& moduleBitCount);
- static FX_INT32 getDecodedCodewordValue(CFX_Int32Array& moduleBitCount);
- static FX_INT32 getBitValue(CFX_Int32Array& moduleBitCount);
- static FX_INT32 getClosestDecodedValue(CFX_Int32Array& moduleBitCount);
+ static int32_t getDecodedCodewordValue(CFX_Int32Array& moduleBitCount);
+ static int32_t getBitValue(CFX_Int32Array& moduleBitCount);
+ static int32_t getClosestDecodedValue(CFX_Int32Array& moduleBitCount);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp index 1f192e63a7..758fed61fe 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp @@ -22,16 +22,16 @@ #include "../barcode.h"
#include "BC_PDF417Common.h"
-FX_INT32 CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929;
-FX_INT32 CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1;
-FX_INT32 CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3;
-FX_INT32 CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90;
-FX_INT32 CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32;
-FX_INT32 CBC_PDF417Common::MODULES_IN_CODEWORD = 17;
-FX_INT32 CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18;
-FX_INT32 CBC_PDF417Common::BARS_IN_MODULE = 8;
+int32_t CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929;
+int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1;
+int32_t CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3;
+int32_t CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90;
+int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32;
+int32_t CBC_PDF417Common::MODULES_IN_CODEWORD = 17;
+int32_t CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18;
+int32_t CBC_PDF417Common::BARS_IN_MODULE = 8;
CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = NULL;
-FX_INT32 CBC_PDF417Common::SYMBOL_TABLE[] = {
+int32_t CBC_PDF417Common::SYMBOL_TABLE[] = {
0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, 0x1035c, 0x10396, 0x103a6, 0x103ac,
0x10422, 0x10428, 0x10436, 0x10442, 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482,
0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, 0x10504, 0x10508, 0x10510, 0x1051e,
@@ -266,7 +266,7 @@ FX_INT32 CBC_PDF417Common::SYMBOL_TABLE[] = { 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4,
0x1fba8, 0x1fbb6, 0x1fbda
};
-FX_INT32 CBC_PDF417Common::CODEWORD_TABLE[] = {
+int32_t CBC_PDF417Common::CODEWORD_TABLE[] = {
2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, 902, 896, 908, 868, 865, 861, 859, 2511,
873, 871, 1780, 835, 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, 807, 2482, 806, 2480, 815,
814, 813, 812, 2484, 817, 816, 1745, 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752,
@@ -414,30 +414,30 @@ CBC_PDF417Common::CBC_PDF417Common() CBC_PDF417Common::~CBC_PDF417Common()
{
}
-FX_INT32 CBC_PDF417Common::getBitCountSum(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417Common::getBitCountSum(CFX_Int32Array& moduleBitCount)
{
- FX_INT32 bitCountSum = 0;
- for (FX_INT32 i = 0; i < moduleBitCount.GetSize(); i++) {
- FX_INT32 count = moduleBitCount.GetAt(i);
+ int32_t bitCountSum = 0;
+ for (int32_t i = 0; i < moduleBitCount.GetSize(); i++) {
+ int32_t count = moduleBitCount.GetAt(i);
bitCountSum += count;
}
return bitCountSum;
}
-FX_INT32 CBC_PDF417Common::getCodeword(FX_DWORD symbol)
+int32_t CBC_PDF417Common::getCodeword(FX_DWORD symbol)
{
FX_DWORD sym = symbol & 0x3FFFF;
- FX_INT32 i = findCodewordIndex(sym);
+ int32_t i = findCodewordIndex(sym);
if (i == -1) {
return -1;
}
return (CODEWORD_TABLE[i] - 1) % NUMBER_OF_CODEWORDS;
}
-FX_INT32 CBC_PDF417Common::findCodewordIndex(FX_DWORD symbol)
+int32_t CBC_PDF417Common::findCodewordIndex(FX_DWORD symbol)
{
- FX_INT32 first = 0;
- FX_INT32 upto = sizeof(SYMBOL_TABLE) / sizeof(SYMBOL_TABLE[0]);
+ int32_t first = 0;
+ int32_t upto = sizeof(SYMBOL_TABLE) / sizeof(SYMBOL_TABLE[0]);
while (first < upto) {
- FX_INT32 mid = ((FX_DWORD)(first + upto)) >> 1;
+ int32_t mid = ((FX_DWORD)(first + upto)) >> 1;
if (symbol < (FX_DWORD)SYMBOL_TABLE[mid]) {
upto = mid;
} else if (symbol > (FX_DWORD)SYMBOL_TABLE[mid]) {
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h index 2d6258951e..a97d84b07a 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h @@ -11,20 +11,20 @@ class CBC_PDF417Common public:
CBC_PDF417Common();
virtual ~CBC_PDF417Common();
- static FX_INT32 getBitCountSum(CFX_Int32Array& moduleBitCount);
- static FX_INT32 getCodeword(FX_DWORD symbol);
- static FX_INT32 NUMBER_OF_CODEWORDS;
- static FX_INT32 MAX_CODEWORDS_IN_BARCODE;
- static FX_INT32 MIN_ROWS_IN_BARCODE;
- static FX_INT32 MAX_ROWS_IN_BARCODE;
- static FX_INT32 MAX_CODEWORDS_IN_ROW;
- static FX_INT32 MODULES_IN_CODEWORD;
- static FX_INT32 MODULES_IN_STOP_PATTERN;
- static FX_INT32 BARS_IN_MODULE;
- static FX_INT32 SYMBOL_TABLE[];
- static FX_INT32 CODEWORD_TABLE[];
+ static int32_t getBitCountSum(CFX_Int32Array& moduleBitCount);
+ static int32_t getCodeword(FX_DWORD symbol);
+ static int32_t NUMBER_OF_CODEWORDS;
+ static int32_t MAX_CODEWORDS_IN_BARCODE;
+ static int32_t MIN_ROWS_IN_BARCODE;
+ static int32_t MAX_ROWS_IN_BARCODE;
+ static int32_t MAX_CODEWORDS_IN_ROW;
+ static int32_t MODULES_IN_CODEWORD;
+ static int32_t MODULES_IN_STOP_PATTERN;
+ static int32_t BARS_IN_MODULE;
+ static int32_t SYMBOL_TABLE[];
+ static int32_t CODEWORD_TABLE[];
private:
static CFX_Int32Array* EMPTY_INT_ARRAY;
- static FX_INT32 findCodewordIndex(FX_DWORD symbol);
+ static int32_t findCodewordIndex(FX_DWORD symbol);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp index ae26057c3e..281c78a8eb 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp @@ -36,15 +36,15 @@ #define MACRO_PDF417_TERMINATOR 922
#define MODE_SHIFT_TO_BYTE_COMPACTION_MODE 913
-FX_INT32 CBC_DecodedBitStreamPaser::MAX_NUMERIC_CODEWORDS = 15;
-FX_INT32 CBC_DecodedBitStreamPaser::NUMBER_OF_SEQUENCE_CODEWORDS = 2;
-FX_INT32 CBC_DecodedBitStreamPaser::PL = 25;
-FX_INT32 CBC_DecodedBitStreamPaser::LL = 27;
-FX_INT32 CBC_DecodedBitStreamPaser::AS = 27;
-FX_INT32 CBC_DecodedBitStreamPaser::ML = 28;
-FX_INT32 CBC_DecodedBitStreamPaser::AL = 28;
-FX_INT32 CBC_DecodedBitStreamPaser::PS = 29;
-FX_INT32 CBC_DecodedBitStreamPaser::PAL = 29;
+int32_t CBC_DecodedBitStreamPaser::MAX_NUMERIC_CODEWORDS = 15;
+int32_t CBC_DecodedBitStreamPaser::NUMBER_OF_SEQUENCE_CODEWORDS = 2;
+int32_t CBC_DecodedBitStreamPaser::PL = 25;
+int32_t CBC_DecodedBitStreamPaser::LL = 27;
+int32_t CBC_DecodedBitStreamPaser::AS = 27;
+int32_t CBC_DecodedBitStreamPaser::ML = 28;
+int32_t CBC_DecodedBitStreamPaser::AL = 28;
+int32_t CBC_DecodedBitStreamPaser::PS = 29;
+int32_t CBC_DecodedBitStreamPaser::PAL = 29;
FX_CHAR CBC_DecodedBitStreamPaser::PUNCT_CHARS[29] = {
';', '<', '>', '@', '[', '\\', '}', '_', '`', '~', '!',
'\r', '\t', ',', ':', '\n', '-', '.', '$', '/', '"', '|', '*',
@@ -67,11 +67,11 @@ CBC_DecodedBitStreamPaser::CBC_DecodedBitStreamPaser() CBC_DecodedBitStreamPaser::~CBC_DecodedBitStreamPaser()
{
}
-CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, int32_t &e)
{
CFX_ByteString result;
- FX_INT32 codeIndex = 1;
- FX_INT32 code = codewords.GetAt(codeIndex);
+ int32_t codeIndex = 1;
+ int32_t code = codewords.GetAt(codeIndex);
codeIndex++;
CBC_PDF417ResultMetadata* resultMetadata = FX_NEW CBC_PDF417ResultMetadata;
while (codeIndex < codewords[0]) {
@@ -128,7 +128,7 @@ CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codew tempCd->setOther(resultMetadata);
return tempCd;
}
-FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e)
+int32_t CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, int32_t codeIndex, CBC_PDF417ResultMetadata* resultMetadata, int32_t &e)
{
if (codeIndex + NUMBER_OF_SEQUENCE_CODEWORDS > codewords[0]) {
e = BCExceptionFormatInstance;
@@ -136,7 +136,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, }
CFX_Int32Array segmentIndexArray;
segmentIndexArray.SetSize(NUMBER_OF_SEQUENCE_CODEWORDS);
- for (FX_INT32 i = 0; i < NUMBER_OF_SEQUENCE_CODEWORDS; i++, codeIndex++) {
+ for (int32_t i = 0; i < NUMBER_OF_SEQUENCE_CODEWORDS; i++, codeIndex++) {
segmentIndexArray.SetAt(i, codewords[codeIndex]);
}
CFX_ByteString str = decodeBase900toBase10(segmentIndexArray, NUMBER_OF_SEQUENCE_CODEWORDS, e);
@@ -149,10 +149,10 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, codeIndex++;
CFX_Int32Array additionalOptionCodeWords;
additionalOptionCodeWords.SetSize(codewords[0] - codeIndex);
- FX_INT32 additionalOptionCodeWordsIndex = 0;
+ int32_t additionalOptionCodeWordsIndex = 0;
FX_BOOL end = FALSE;
while ((codeIndex < codewords[0]) && !end) {
- FX_INT32 code = codewords[codeIndex++];
+ int32_t code = codewords[codeIndex++];
if (code < TEXT_COMPACTION_MODE_LATCH) {
additionalOptionCodeWords[additionalOptionCodeWordsIndex++] = code;
} else {
@@ -178,16 +178,16 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, }
return codeIndex;
}
-FX_INT32 CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result)
+int32_t CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result)
{
CFX_Int32Array textCompactionData;
textCompactionData.SetSize((codewords[0] - codeIndex) << 1);
CFX_Int32Array byteCompactionData;
byteCompactionData.SetSize((codewords[0] - codeIndex) << 1);
- FX_INT32 index = 0;
+ int32_t index = 0;
FX_BOOL end = FALSE;
while ((codeIndex < codewords[0]) && !end) {
- FX_INT32 code = codewords[codeIndex++];
+ int32_t code = codewords[codeIndex++];
if (code < TEXT_COMPACTION_MODE_LATCH) {
textCompactionData[index] = code / 30;
textCompactionData[index + 1] = code % 30;
@@ -233,13 +233,13 @@ FX_INT32 CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, FX decodeTextCompaction(textCompactionData, byteCompactionData, index, result);
return codeIndex;
}
-void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result)
+void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, int32_t length, CFX_ByteString &result)
{
Mode subMode = ALPHA;
Mode priorToShiftMode = ALPHA;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < length) {
- FX_INT32 subModeCh = textCompactionData[i];
+ int32_t subModeCh = textCompactionData[i];
FX_CHAR ch = 0;
switch (subMode) {
case ALPHA:
@@ -351,16 +351,16 @@ void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompact i++;
}
}
-FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result)
+int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result)
{
if (mode == BYTE_COMPACTION_MODE_LATCH) {
- FX_INT32 count = 0;
- FX_INT64 value = 0;
+ int32_t count = 0;
+ int64_t value = 0;
FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD));
CFX_Int32Array byteCompactedCodewords;
byteCompactedCodewords.SetSize(6);
FX_BOOL end = FALSE;
- FX_INT32 nextCode = codewords[codeIndex++];
+ int32_t nextCode = codewords[codeIndex++];
while ((codeIndex < codewords[0]) && !end) {
byteCompactedCodewords[count++] = nextCode;
value = 900 * value + nextCode;
@@ -376,7 +376,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array end = TRUE;
} else {
if ((count % 5 == 0) && (count > 0)) {
- FX_INT32 j = 0;
+ int32_t j = 0;
for (; j < 6; ++j) {
decodedData[5 - j] = (FX_WORD) (value % 256);
value >>= 8;
@@ -392,15 +392,15 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array if (codeIndex == codewords[0] && nextCode < TEXT_COMPACTION_MODE_LATCH) {
byteCompactedCodewords[count++] = nextCode;
}
- for (FX_INT32 i = 0; i < count; i++) {
+ for (int32_t i = 0; i < count; i++) {
result += (FX_CHAR)(FX_WORD) byteCompactedCodewords[i];
}
} else if (mode == BYTE_COMPACTION_MODE_LATCH_6) {
- FX_INT32 count = 0;
- FX_INT64 value = 0;
+ int32_t count = 0;
+ int64_t value = 0;
FX_BOOL end = FALSE;
while (codeIndex < codewords[0] && !end) {
- FX_INT32 code = codewords[codeIndex++];
+ int32_t code = codewords[codeIndex++];
if (code < TEXT_COMPACTION_MODE_LATCH) {
count++;
value = 900 * value + code;
@@ -418,7 +418,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array }
if ((count % 5 == 0) && (count > 0)) {
FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD));
- FX_INT32 j = 0;
+ int32_t j = 0;
for (; j < 6; ++j) {
decodedData[5 - j] = (FX_WORD) (value & 0xFF);
value >>= 8;
@@ -433,14 +433,14 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array }
return codeIndex;
}
-FX_INT32 CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e)
+int32_t CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result, int32_t &e)
{
- FX_INT32 count = 0;
+ int32_t count = 0;
FX_BOOL end = FALSE;
CFX_Int32Array numericCodewords;
numericCodewords.SetSize(MAX_NUMERIC_CODEWORDS);
while (codeIndex < codewords[0] && !end) {
- FX_INT32 code = codewords[codeIndex++];
+ int32_t code = codewords[codeIndex++];
if (codeIndex == codewords[0]) {
end = TRUE;
}
@@ -469,11 +469,11 @@ FX_INT32 CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, }
return codeIndex;
}
-CFX_ByteString CBC_DecodedBitStreamPaser::decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e)
+CFX_ByteString CBC_DecodedBitStreamPaser::decodeBase900toBase10(CFX_Int32Array &codewords, int32_t count, int32_t &e)
{
BigInteger result = 0;
BigInteger nineHundred(900);
- for (FX_INT32 i = 0; i < count; i++) {
+ for (int32_t i = 0; i < count; i++) {
result = result * nineHundred + BigInteger(codewords[i]);
}
CFX_ByteString resultString(bigIntegerToString(result).c_str());
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h index 4c97bc3f24..20831b4ad8 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h @@ -15,7 +15,7 @@ public: virtual ~CBC_DecodedBitStreamPaser();
static void Initialize();
static void Finalize();
- static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e);
+ static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, int32_t &e);
private:
enum Mode {
@@ -26,22 +26,22 @@ private: ALPHA_SHIFT,
PUNCT_SHIFT
};
- static FX_INT32 MAX_NUMERIC_CODEWORDS;
- static FX_INT32 PL;
- static FX_INT32 LL;
- static FX_INT32 AS;
- static FX_INT32 ML;
- static FX_INT32 AL;
- static FX_INT32 PS;
- static FX_INT32 PAL;
+ static int32_t MAX_NUMERIC_CODEWORDS;
+ static int32_t PL;
+ static int32_t LL;
+ static int32_t AS;
+ static int32_t ML;
+ static int32_t AL;
+ static int32_t PS;
+ static int32_t PAL;
static FX_CHAR PUNCT_CHARS[29];
static FX_CHAR MIXED_CHARS[30];
- static FX_INT32 NUMBER_OF_SEQUENCE_CODEWORDS;
- static FX_INT32 decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e);
- static FX_INT32 textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);
- static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result);
- static FX_INT32 byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);
- static FX_INT32 numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e);
- static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e);
+ static int32_t NUMBER_OF_SEQUENCE_CODEWORDS;
+ static int32_t decodeMacroBlock(CFX_Int32Array &codewords, int32_t codeIndex, CBC_PDF417ResultMetadata* resultMetadata, int32_t &e);
+ static int32_t textCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result);
+ static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, int32_t length, CFX_ByteString &result);
+ static int32_t byteCompaction(int32_t mode, CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result);
+ static int32_t numericCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result, int32_t &e);
+ static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, int32_t count, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp index af316f7660..c4966942c6 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp @@ -28,14 +28,14 @@ #include "BC_PDF417Common.h"
#include "BC_PDF417DetectionResultRowIndicatorColumn.h"
#include "BC_PDF417DetectionResult.h"
-FX_INT32 CBC_DetectionResult::ADJUST_ROW_NUMBER_SKIP = 2;
+int32_t CBC_DetectionResult::ADJUST_ROW_NUMBER_SKIP = 2;
CBC_DetectionResult::CBC_DetectionResult(CBC_BarcodeMetadata* barcodeMetadata, CBC_BoundingBox* boundingBox)
{
m_barcodeMetadata = barcodeMetadata;
m_barcodeColumnCount = barcodeMetadata->getColumnCount();
m_boundingBox = boundingBox;
m_detectionResultColumns.SetSize(m_barcodeColumnCount + 2);
- for (FX_INT32 i = 0; i < m_barcodeColumnCount + 2; i++) {
+ for (int32_t i = 0; i < m_barcodeColumnCount + 2; i++) {
m_detectionResultColumns[i] = NULL;
}
}
@@ -49,8 +49,8 @@ CFX_PtrArray& CBC_DetectionResult::getDetectionResultColumns() {
adjustIndicatorColumnRowNumbers((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0));
adjustIndicatorColumnRowNumbers((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1));
- FX_INT32 unadjustedCodewordCount = CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE;
- FX_INT32 previousUnadjustedCount;
+ int32_t unadjustedCodewordCount = CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE;
+ int32_t previousUnadjustedCount;
do {
previousUnadjustedCount = unadjustedCodewordCount;
unadjustedCodewordCount = adjustRowNumbers();
@@ -65,11 +65,11 @@ CBC_BoundingBox* CBC_DetectionResult::getBoundingBox() {
return m_boundingBox;
}
-void CBC_DetectionResult::setDetectionResultColumn(FX_INT32 barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn)
+void CBC_DetectionResult::setDetectionResultColumn(int32_t barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn)
{
m_detectionResultColumns[barcodeColumn] = detectionResultColumn;
}
-CBC_DetectionResultColumn* CBC_DetectionResult::getDetectionResultColumn(FX_INT32 barcodeColumn)
+CBC_DetectionResultColumn* CBC_DetectionResult::getDetectionResultColumn(int32_t barcodeColumn)
{
return (CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn];
}
@@ -80,9 +80,9 @@ CFX_ByteString CBC_DetectionResult::toString() rowIndicatorColumn = (CBC_DetectionResultColumn*)m_detectionResultColumns[m_barcodeColumnCount + 1];
}
CFX_ByteString result;
- for (FX_INT32 codewordsRow = 0; codewordsRow < rowIndicatorColumn->getCodewords()->GetSize(); codewordsRow++) {
+ for (int32_t codewordsRow = 0; codewordsRow < rowIndicatorColumn->getCodewords()->GetSize(); codewordsRow++) {
result += (FX_CHAR) codewordsRow;
- for (FX_INT32 barcodeColumn = 0; barcodeColumn < m_barcodeColumnCount + 2; barcodeColumn++) {
+ for (int32_t barcodeColumn = 0; barcodeColumn < m_barcodeColumnCount + 2; barcodeColumn++) {
if (m_detectionResultColumns[barcodeColumn] == NULL) {
result += " | ";
continue;
@@ -104,15 +104,15 @@ void CBC_DetectionResult::adjustIndicatorColumnRowNumbers(CBC_DetectionResultCol ((CBC_DetectionResultRowIndicatorColumn*)detectionResultColumn)->adjustCompleteIndicatorColumnRowNumbers(*m_barcodeMetadata);
}
}
-FX_INT32 CBC_DetectionResult::adjustRowNumbers()
+int32_t CBC_DetectionResult::adjustRowNumbers()
{
- FX_INT32 unadjustedCount = adjustRowNumbersByRow();
+ int32_t unadjustedCount = adjustRowNumbersByRow();
if (unadjustedCount == 0) {
return 0;
}
- for (FX_INT32 barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1; barcodeColumn++) {
+ for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1; barcodeColumn++) {
CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords();
- for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
+ for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
@@ -123,24 +123,24 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbers() }
return unadjustedCount;
}
-FX_INT32 CBC_DetectionResult::adjustRowNumbersByRow()
+int32_t CBC_DetectionResult::adjustRowNumbersByRow()
{
adjustRowNumbersFromBothRI();
- FX_INT32 unadjustedCount = adjustRowNumbersFromLRI();
+ int32_t unadjustedCount = adjustRowNumbersFromLRI();
return unadjustedCount + adjustRowNumbersFromRRI();
}
-FX_INT32 CBC_DetectionResult::adjustRowNumbersFromBothRI()
+int32_t CBC_DetectionResult::adjustRowNumbersFromBothRI()
{
if (m_detectionResultColumns[0] == NULL || m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) {
return 0;
}
CFX_PtrArray* LRIcodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[0])->getCodewords();
CFX_PtrArray* RRIcodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[m_barcodeColumnCount + 1])->getCodewords();
- for (FX_INT32 codewordsRow = 0; codewordsRow < LRIcodewords->GetSize(); codewordsRow++) {
+ for (int32_t codewordsRow = 0; codewordsRow < LRIcodewords->GetSize(); codewordsRow++) {
if (LRIcodewords->GetAt(codewordsRow) != NULL &&
RRIcodewords->GetAt(codewordsRow) != NULL &&
((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber() == ((CBC_Codeword*)RRIcodewords->GetAt(codewordsRow))->getRowNumber()) {
- for (FX_INT32 barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount; barcodeColumn++) {
+ for (int32_t barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount; barcodeColumn++) {
CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords()->GetAt(codewordsRow);
if (codeword == NULL) {
continue;
@@ -154,20 +154,20 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromBothRI() }
return 0;
}
-FX_INT32 CBC_DetectionResult::adjustRowNumbersFromRRI()
+int32_t CBC_DetectionResult::adjustRowNumbersFromRRI()
{
if (m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) {
return 0;
}
- FX_INT32 unadjustedCount = 0;
+ int32_t unadjustedCount = 0;
CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*) m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1))->getCodewords();
- for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
+ for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
- FX_INT32 rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
- FX_INT32 invalidRowCounts = 0;
- for (FX_INT32 barcodeColumn = m_barcodeColumnCount + 1; barcodeColumn > 0 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn--) {
+ int32_t rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
+ int32_t invalidRowCounts = 0;
+ for (int32_t barcodeColumn = m_barcodeColumnCount + 1; barcodeColumn > 0 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn--) {
CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(barcodeColumn))->getCodewords()->GetAt(codewordsRow);
if (codeword != NULL) {
invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword);
@@ -179,20 +179,20 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromRRI() }
return unadjustedCount;
}
-FX_INT32 CBC_DetectionResult::adjustRowNumbersFromLRI()
+int32_t CBC_DetectionResult::adjustRowNumbersFromLRI()
{
if (m_detectionResultColumns[0] == NULL) {
return 0;
}
- FX_INT32 unadjustedCount = 0;
+ int32_t unadjustedCount = 0;
CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0))->getCodewords();
- for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
+ for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
- FX_INT32 rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
- FX_INT32 invalidRowCounts = 0;
- for (FX_INT32 barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) {
+ int32_t rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
+ int32_t invalidRowCounts = 0;
+ for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) {
CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords()->GetAt(codewordsRow);
if (codeword != NULL) {
invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword);
@@ -204,7 +204,7 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromLRI() }
return unadjustedCount;
}
-FX_INT32 CBC_DetectionResult::adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNumber, FX_INT32 invalidRowCounts, CBC_Codeword* codeword)
+int32_t CBC_DetectionResult::adjustRowNumberIfValid(int32_t rowIndicatorRowNumber, int32_t invalidRowCounts, CBC_Codeword* codeword)
{
if (codeword == NULL) {
return invalidRowCounts;
@@ -219,7 +219,7 @@ FX_INT32 CBC_DetectionResult::adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNum }
return invalidRowCounts;
}
-void CBC_DetectionResult::adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 codewordsRow, CFX_PtrArray* codewords)
+void CBC_DetectionResult::adjustRowNumbers(int32_t barcodeColumn, int32_t codewordsRow, CFX_PtrArray* codewords)
{
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
CFX_PtrArray* previousColumnCodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(barcodeColumn - 1))->getCodewords();
@@ -251,7 +251,7 @@ void CBC_DetectionResult::adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 code otherCodewords[12] = previousColumnCodewords->GetAt(codewordsRow + 2);
otherCodewords[13] = nextColumnCodewords->GetAt(codewordsRow + 2);
}
- for (FX_INT32 i = 0; i < otherCodewords.GetSize(); i++) {
+ for (int32_t i = 0; i < otherCodewords.GetSize(); i++) {
CBC_Codeword* otherCodeword = (CBC_Codeword*)otherCodewords.GetAt(i);
if (adjustRowNumber(codeword, otherCodeword)) {
return;
@@ -269,15 +269,15 @@ FX_BOOL CBC_DetectionResult::adjustRowNumber(CBC_Codeword* codeword, CBC_Codewor }
return FALSE;
}
-FX_INT32 CBC_DetectionResult::getBarcodeColumnCount()
+int32_t CBC_DetectionResult::getBarcodeColumnCount()
{
return m_barcodeColumnCount;
}
-FX_INT32 CBC_DetectionResult::getBarcodeRowCount()
+int32_t CBC_DetectionResult::getBarcodeRowCount()
{
return m_barcodeMetadata->getRowCount();
}
-FX_INT32 CBC_DetectionResult::getBarcodeECLevel()
+int32_t CBC_DetectionResult::getBarcodeECLevel()
{
return m_barcodeMetadata->getErrorCorrectionLevel();
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h index 55a5a8f134..34da90082c 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h @@ -18,28 +18,28 @@ public: CFX_PtrArray& getDetectionResultColumns();
void setBoundingBox(CBC_BoundingBox* boundingBox);
CBC_BoundingBox* getBoundingBox();
- void setDetectionResultColumn(FX_INT32 barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn);
- CBC_DetectionResultColumn* getDetectionResultColumn(FX_INT32 barcodeColumn);
+ void setDetectionResultColumn(int32_t barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn);
+ CBC_DetectionResultColumn* getDetectionResultColumn(int32_t barcodeColumn);
CFX_ByteString toString();
- FX_INT32 getBarcodeColumnCount();
- FX_INT32 getBarcodeRowCount();
- FX_INT32 getBarcodeECLevel();
+ int32_t getBarcodeColumnCount();
+ int32_t getBarcodeRowCount();
+ int32_t getBarcodeECLevel();
private:
- static FX_INT32 ADJUST_ROW_NUMBER_SKIP;
+ static int32_t ADJUST_ROW_NUMBER_SKIP;
CBC_BarcodeMetadata* m_barcodeMetadata;
CFX_PtrArray m_detectionResultColumns;
CBC_BoundingBox* m_boundingBox;
- FX_INT32 m_barcodeColumnCount;
+ int32_t m_barcodeColumnCount;
private:
void adjustIndicatorColumnRowNumbers(CBC_DetectionResultColumn* detectionResultColumn);
- FX_INT32 adjustRowNumbers();
- FX_INT32 adjustRowNumbersByRow();
- FX_INT32 adjustRowNumbersFromBothRI();
- FX_INT32 adjustRowNumbersFromRRI();
- FX_INT32 adjustRowNumbersFromLRI();
- static FX_INT32 adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNumber, FX_INT32 invalidRowCounts, CBC_Codeword* codeword);
- void adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 codewordsRow, CFX_PtrArray* codewords);
+ int32_t adjustRowNumbers();
+ int32_t adjustRowNumbersByRow();
+ int32_t adjustRowNumbersFromBothRI();
+ int32_t adjustRowNumbersFromRRI();
+ int32_t adjustRowNumbersFromLRI();
+ static int32_t adjustRowNumberIfValid(int32_t rowIndicatorRowNumber, int32_t invalidRowCounts, CBC_Codeword* codeword);
+ void adjustRowNumbers(int32_t barcodeColumn, int32_t codewordsRow, CFX_PtrArray* codewords);
static FX_BOOL adjustRowNumber(CBC_Codeword* codeword, CBC_Codeword* otherCodeword);
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp index 6d949b7640..f4da542130 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp @@ -24,7 +24,7 @@ #include "BC_PDF417Codeword.h"
#include "BC_PDF417BoundingBox.h"
#include "BC_PDF417DetectionResultColumn.h"
-FX_INT32 CBC_DetectionResultColumn::MAX_NEARBY_DISTANCE = 5;
+int32_t CBC_DetectionResultColumn::MAX_NEARBY_DISTANCE = 5;
CBC_DetectionResultColumn::CBC_DetectionResultColumn(CBC_BoundingBox* boundingBox)
{
m_boundingBox = boundingBox;
@@ -33,20 +33,20 @@ CBC_DetectionResultColumn::CBC_DetectionResultColumn(CBC_BoundingBox* boundingBo }
CBC_DetectionResultColumn::~CBC_DetectionResultColumn()
{
- for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) {
+ for (int32_t i = 0; i < m_codewords->GetSize(); i++) {
delete (CBC_Codeword*)m_codewords->GetAt(i);
}
m_codewords->RemoveAll();
delete m_codewords;
}
-CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(FX_INT32 imageRow)
+CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(int32_t imageRow)
{
CBC_Codeword* codeword = getCodeword(imageRow);
if (codeword != NULL) {
return codeword;
}
- for (FX_INT32 i = 1; i < MAX_NEARBY_DISTANCE; i++) {
- FX_INT32 nearImageRow = imageRowToCodewordIndex(imageRow) - i;
+ for (int32_t i = 1; i < MAX_NEARBY_DISTANCE; i++) {
+ int32_t nearImageRow = imageRowToCodewordIndex(imageRow) - i;
if (nearImageRow >= 0) {
codeword = (CBC_Codeword*)m_codewords->GetAt(nearImageRow);
if (codeword != NULL) {
@@ -63,19 +63,19 @@ CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(FX_INT32 imageRow) }
return NULL;
}
-FX_INT32 CBC_DetectionResultColumn::imageRowToCodewordIndex(FX_INT32 imageRow)
+int32_t CBC_DetectionResultColumn::imageRowToCodewordIndex(int32_t imageRow)
{
return imageRow - m_boundingBox->getMinY();
}
-FX_INT32 CBC_DetectionResultColumn::codewordIndexToImageRow(FX_INT32 codewordIndex)
+int32_t CBC_DetectionResultColumn::codewordIndexToImageRow(int32_t codewordIndex)
{
return m_boundingBox->getMinY() + codewordIndex;
}
-void CBC_DetectionResultColumn::setCodeword(FX_INT32 imageRow, CBC_Codeword* codeword)
+void CBC_DetectionResultColumn::setCodeword(int32_t imageRow, CBC_Codeword* codeword)
{
m_codewords->SetAt(imageRowToCodewordIndex(imageRow), codeword);
}
-CBC_Codeword* CBC_DetectionResultColumn::getCodeword(FX_INT32 imageRow)
+CBC_Codeword* CBC_DetectionResultColumn::getCodeword(int32_t imageRow)
{
return (CBC_Codeword*)m_codewords->GetAt(imageRowToCodewordIndex(imageRow));
}
@@ -90,8 +90,8 @@ CFX_PtrArray* CBC_DetectionResultColumn::getCodewords() CFX_ByteString CBC_DetectionResultColumn::toString()
{
CFX_ByteString result;
- FX_INT32 row = 0;
- for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) {
+ int32_t row = 0;
+ for (int32_t i = 0; i < m_codewords->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i);
if (codeword == NULL) {
result += (FX_CHAR) row;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h index 202272d2e9..9940998282 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h @@ -13,11 +13,11 @@ class CBC_DetectionResultColumn public:
CBC_DetectionResultColumn(CBC_BoundingBox* boundingBox);
virtual ~CBC_DetectionResultColumn();
- CBC_Codeword* getCodewordNearby(FX_INT32 imageRow);
- FX_INT32 imageRowToCodewordIndex(FX_INT32 imageRow);
- FX_INT32 codewordIndexToImageRow(FX_INT32 codewordIndex);
- void setCodeword(FX_INT32 imageRow, CBC_Codeword* codeword);
- CBC_Codeword* getCodeword(FX_INT32 imageRow);
+ CBC_Codeword* getCodewordNearby(int32_t imageRow);
+ int32_t imageRowToCodewordIndex(int32_t imageRow);
+ int32_t codewordIndexToImageRow(int32_t codewordIndex);
+ void setCodeword(int32_t imageRow, CBC_Codeword* codeword);
+ CBC_Codeword* getCodeword(int32_t imageRow);
CBC_BoundingBox* getBoundingBox();
CFX_PtrArray* getCodewords();
CFX_ByteString toString();
@@ -25,6 +25,6 @@ public: CBC_BoundingBox* m_boundingBox;
CFX_PtrArray* m_codewords;
private:
- static FX_INT32 MAX_NEARBY_DISTANCE;
+ static int32_t MAX_NEARBY_DISTANCE;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp index 89e46a74cd..12622c3dff 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp @@ -39,14 +39,14 @@ CBC_DetectionResultRowIndicatorColumn::~CBC_DetectionResultRowIndicatorColumn() }
void CBC_DetectionResultRowIndicatorColumn::setRowNumbers()
{
- for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) {
+ for (int32_t i = 0; i < m_codewords->GetSize(); i++) {
CBC_Codeword * codeword = (CBC_Codeword*)m_codewords->GetAt(i);
if (codeword != NULL) {
codeword->setRowNumberAsRowIndicatorColumn();
}
}
}
-FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
+int32_t CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
{
CFX_PtrArray* codewords = getCodewords();
setRowNumbers();
@@ -54,18 +54,18 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
- FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY());
- FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY());
+ int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY());
+ int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY());
FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount();
- FX_INT32 barcodeRow = -1;
- FX_INT32 maxRowHeight = 1;
- FX_INT32 currentRowHeight = 0;
- for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
+ int32_t barcodeRow = -1;
+ int32_t maxRowHeight = 1;
+ int32_t currentRowHeight = 0;
+ for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
- FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow;
+ int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
@@ -79,14 +79,14 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow } else if (rowDifference > codewordsRow) {
codewords->SetAt(codewordsRow, NULL);
} else {
- FX_INT32 checkedRows;
+ int32_t checkedRows;
if (maxRowHeight > 2) {
checkedRows = (maxRowHeight - 2) * rowDifference;
} else {
checkedRows = rowDifference;
}
FX_BOOL closePreviousCodewordFound = checkedRows >= codewordsRow;
- for (FX_INT32 i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) {
+ for (int32_t i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) {
closePreviousCodewordFound = codewords->GetAt(codewordsRow - i) != NULL;
}
if (closePreviousCodewordFound) {
@@ -97,9 +97,9 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow }
}
}
- return (FX_INT32) (averageRowHeight + 0.5);
+ return (int32_t) (averageRowHeight + 0.5);
}
-CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e)
+CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(int32_t &e)
{
CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata();
if (barcodeMetadata == NULL) {
@@ -109,7 +109,7 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata);
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
result->SetSize(barcodeMetadata->getRowCount());
- for (FX_INT32 i = 0; i < getCodewords()->GetSize(); i++) {
+ for (int32_t i = 0; i < getCodewords()->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i);
if (codeword != NULL) {
result->SetAt(codeword->getRowNumber(), result->GetAt(codeword->getRowNumber()) + 1);
@@ -117,25 +117,25 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e }
return result;
}
-FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
+int32_t CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
{
CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
- FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY());
- FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY());
+ int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY());
+ int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY());
FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount();
CFX_PtrArray* codewords = getCodewords();
- FX_INT32 barcodeRow = -1;
- FX_INT32 maxRowHeight = 1;
- FX_INT32 currentRowHeight = 0;
- for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
+ int32_t barcodeRow = -1;
+ int32_t maxRowHeight = 1;
+ int32_t currentRowHeight = 0;
+ for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
codeword->setRowNumberAsRowIndicatorColumn();
- FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow;
+ int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
@@ -149,7 +149,7 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnR currentRowHeight = 1;
}
}
- return (FX_INT32) (averageRowHeight + 0.5);
+ return (int32_t) (averageRowHeight + 0.5);
}
CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata()
{
@@ -158,14 +158,14 @@ CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() CBC_BarcodeValue barcodeRowCountUpperPart;
CBC_BarcodeValue barcodeRowCountLowerPart;
CBC_BarcodeValue barcodeECLevel;
- for (FX_INT32 i = 0; i < codewords->GetSize(); i++) {
+ for (int32_t i = 0; i < codewords->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i);
if (codeword == NULL) {
continue;
}
codeword->setRowNumberAsRowIndicatorColumn();
- FX_INT32 rowIndicatorValue = codeword->getValue() % 30;
- FX_INT32 codewordRowNumber = codeword->getRowNumber();
+ int32_t rowIndicatorValue = codeword->getValue() % 30;
+ int32_t codewordRowNumber = codeword->getRowNumber();
if (!m_isLeft) {
codewordRowNumber += 2;
}
@@ -205,13 +205,13 @@ CFX_ByteString CBC_DetectionResultRowIndicatorColumn::toString() }
void CBC_DetectionResultRowIndicatorColumn::removeIncorrectCodewords(CFX_PtrArray* codewords, CBC_BarcodeMetadata barcodeMetadata)
{
- for (FX_INT32 codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) {
+ for (int32_t codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) {
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordRow);
if (codeword == NULL) {
continue;
}
- FX_INT32 rowIndicatorValue = codeword->getValue() % 30;
- FX_INT32 codewordRowNumber = codeword->getRowNumber();
+ int32_t rowIndicatorValue = codeword->getValue() % 30;
+ int32_t codewordRowNumber = codeword->getRowNumber();
if (codewordRowNumber > barcodeMetadata.getRowCount()) {
codewords->SetAt(codewordRow, NULL);
continue;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h index fbdd0f0ec4..f8092311c5 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h @@ -15,9 +15,9 @@ public: CBC_DetectionResultRowIndicatorColumn(CBC_BoundingBox* boundingBox, FX_BOOL isLeft);
virtual ~CBC_DetectionResultRowIndicatorColumn();
void setRowNumbers();
- FX_INT32 adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
- CFX_Int32Array* getRowHeights(FX_INT32 &e);
- FX_INT32 adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
+ int32_t adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
+ CFX_Int32Array* getRowHeights(int32_t &e);
+ int32_t adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
CBC_BarcodeMetadata* getBarcodeMetadata();
FX_BOOL isLeft();
CFX_ByteString toString();
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp index 8d1a86ec92..726e0ec94f 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp @@ -28,26 +28,26 @@ #include "BC_PDF417DetectorResult.h"
#include "BC_PDF417Detector.h"
#define INTERGER_MAX 2147483647
-FX_INT32 CBC_Detector::INDEXES_START_PATTERN[] = {0, 4, 1, 5};
-FX_INT32 CBC_Detector::INDEXES_STOP_PATTERN[] = {6, 2, 7, 3};
-FX_INT32 CBC_Detector::INTEGER_MATH_SHIFT = 8;
-FX_INT32 CBC_Detector::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT;
-FX_INT32 CBC_Detector::MAX_AVG_VARIANCE = (FX_INT32) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
-FX_INT32 CBC_Detector::MAX_INDIVIDUAL_VARIANCE = (FX_INT32) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f);
-FX_INT32 CBC_Detector::START_PATTERN[] = {8, 1, 1, 1, 1, 1, 1, 3};
-FX_INT32 CBC_Detector::STOP_PATTERN[] = {7, 1, 1, 3, 1, 1, 1, 2, 1};
-FX_INT32 CBC_Detector::MAX_PIXEL_DRIFT = 3;
-FX_INT32 CBC_Detector::MAX_PATTERN_DRIFT = 5;
-FX_INT32 CBC_Detector::SKIPPED_ROW_COUNT_MAX = 25;
-FX_INT32 CBC_Detector::ROW_STEP = 5;
-FX_INT32 CBC_Detector::BARCODE_MIN_HEIGHT = 10;
+int32_t CBC_Detector::INDEXES_START_PATTERN[] = {0, 4, 1, 5};
+int32_t CBC_Detector::INDEXES_STOP_PATTERN[] = {6, 2, 7, 3};
+int32_t CBC_Detector::INTEGER_MATH_SHIFT = 8;
+int32_t CBC_Detector::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT;
+int32_t CBC_Detector::MAX_AVG_VARIANCE = (int32_t) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f);
+int32_t CBC_Detector::MAX_INDIVIDUAL_VARIANCE = (int32_t) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f);
+int32_t CBC_Detector::START_PATTERN[] = {8, 1, 1, 1, 1, 1, 1, 3};
+int32_t CBC_Detector::STOP_PATTERN[] = {7, 1, 1, 3, 1, 1, 1, 2, 1};
+int32_t CBC_Detector::MAX_PIXEL_DRIFT = 3;
+int32_t CBC_Detector::MAX_PATTERN_DRIFT = 5;
+int32_t CBC_Detector::SKIPPED_ROW_COUNT_MAX = 25;
+int32_t CBC_Detector::ROW_STEP = 5;
+int32_t CBC_Detector::BARCODE_MIN_HEIGHT = 10;
CBC_Detector::CBC_Detector()
{
}
CBC_Detector::~CBC_Detector()
{
}
-CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e)
+CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, int32_t hints, FX_BOOL multiple, int32_t &e)
{
CBC_CommonBitMatrix* bitMatrix = image->GetBlackMatrix(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -65,12 +65,12 @@ CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, FX_INT32 }
void CBC_Detector::rotate180(CBC_CommonBitMatrix* bitMatrix)
{
- FX_INT32 width = bitMatrix->GetWidth();
- FX_INT32 height = bitMatrix->GetHeight();
+ int32_t width = bitMatrix->GetWidth();
+ int32_t height = bitMatrix->GetHeight();
CBC_CommonBitArray* firstRowBitArray = FX_NEW CBC_CommonBitArray(width);
CBC_CommonBitArray* secondRowBitArray = FX_NEW CBC_CommonBitArray(width);
CBC_CommonBitArray* tmpBitArray = FX_NEW CBC_CommonBitArray(width);
- for (FX_INT32 y = 0; y < (height + 1) >> 1; y++) {
+ for (int32_t y = 0; y < (height + 1) >> 1; y++) {
CBC_CommonBitArray* temp = bitMatrix->GetRow(height - 1 - y, secondRowBitArray);
CBC_CommonBitArray* tempfirstRow = firstRowBitArray;
firstRowBitArray = bitMatrix->GetRow(y, tempfirstRow);
@@ -91,8 +91,8 @@ CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, CBC_CommonBi {
CBC_CommonBitArray* array = FX_NEW CBC_CommonBitArray(result->GetSize());
array->Clear();
- FX_INT32 size = input->GetSize();
- for (FX_INT32 i = 0; i < size; i++) {
+ int32_t size = input->GetSize();
+ for (int32_t i = 0; i < size; i++) {
if (input->Get(i)) {
array->Set(size - 1 - i);
}
@@ -102,8 +102,8 @@ CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, CBC_CommonBi CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix)
{
CFX_PtrArray* barcodeCoordinates = FX_NEW CFX_PtrArray;
- FX_INT32 row = 0;
- FX_INT32 column = 0;
+ int32_t row = 0;
+ int32_t column = 0;
FX_BOOL foundBarcodeInRow = FALSE;
while (row < bitMatrix->GetHeight()) {
CFX_PtrArray* vertices = findVertices(bitMatrix, row, column);
@@ -116,7 +116,7 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMat }
foundBarcodeInRow = FALSE;
column = 0;
- for (FX_INT32 i = 0; i < barcodeCoordinates->GetSize(); i++) {
+ for (int32_t i = 0; i < barcodeCoordinates->GetSize(); i++) {
CFX_PtrArray* barcodeCoordinate = (CFX_PtrArray*)barcodeCoordinates->GetAt(i);
if (barcodeCoordinate->GetAt(1) != NULL) {
row = row > ((CBC_ResultPoint*)barcodeCoordinate->GetAt(1))->GetY();
@@ -137,19 +137,19 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMat break;
}
if (vertices->GetAt(2) != NULL) {
- column = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(2))->GetX();
- row = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(2))->GetY();
+ column = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(2))->GetX();
+ row = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(2))->GetY();
} else {
- column = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(4))->GetX();
- row = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(4))->GetY();
+ column = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(4))->GetX();
+ row = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(4))->GetY();
}
}
return barcodeCoordinates;
}
-CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn)
+CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, int32_t startRow, int32_t startColumn)
{
- FX_INT32 height = matrix->GetHeight();
- FX_INT32 width = matrix->GetWidth();
+ int32_t height = matrix->GetHeight();
+ int32_t width = matrix->GetWidth();
CFX_PtrArray* result = FX_NEW CFX_PtrArray;
result->SetSize(8);
CFX_PtrArray* startptr = findRowsWithPattern(matrix, height, width, startRow, startColumn, START_PATTERN, sizeof(START_PATTERN) / sizeof(START_PATTERN[0]));
@@ -157,8 +157,8 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 s startptr->RemoveAll();
delete startptr;
if (result->GetAt(4) != NULL) {
- startColumn = (FX_INT32) ((CBC_ResultPoint*)result->GetAt(4))->GetX();
- startRow = (FX_INT32) ((CBC_ResultPoint*)result->GetAt(4))->GetY();
+ startColumn = (int32_t) ((CBC_ResultPoint*)result->GetAt(4))->GetX();
+ startRow = (int32_t) ((CBC_ResultPoint*)result->GetAt(4))->GetY();
}
CFX_PtrArray* stopptr = findRowsWithPattern(matrix, height, width, startRow, startColumn, STOP_PATTERN, sizeof(STOP_PATTERN) / sizeof(STOP_PATTERN[0]));
copyToResult(result, stopptr, INDEXES_STOP_PATTERN, sizeof(INDEXES_STOP_PATTERN) / sizeof(INDEXES_STOP_PATTERN[0]));
@@ -166,13 +166,13 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 s delete stopptr;
return result;
}
-void CBC_Detector::copyToResult(CFX_PtrArray *result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength)
+void CBC_Detector::copyToResult(CFX_PtrArray *result, CFX_PtrArray* tmpResult, int32_t* destinationIndexes, int32_t destinationLength)
{
- for (FX_INT32 i = 0; i < destinationLength; i++) {
+ for (int32_t i = 0; i < destinationLength; i++) {
result->SetAt(destinationIndexes[i], tmpResult->GetAt(i));
}
}
-CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength)
+CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_t height, int32_t width, int32_t startRow, int32_t startColumn, int32_t* pattern, int32_t patternLength)
{
CFX_PtrArray* result = FX_NEW CFX_PtrArray;
result->SetSize(4);
@@ -199,12 +199,12 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_ break;
}
}
- FX_INT32 stopRow = startRow + 1;
+ int32_t stopRow = startRow + 1;
if (found) {
- FX_INT32 skippedRowCount = 0;
+ int32_t skippedRowCount = 0;
CFX_Int32Array previousRowLoc;
- previousRowLoc.Add((FX_INT32)((CBC_ResultPoint*)result->GetAt(0))->GetX());
- previousRowLoc.Add((FX_INT32)((CBC_ResultPoint*)result->GetAt(1))->GetX());
+ previousRowLoc.Add((int32_t)((CBC_ResultPoint*)result->GetAt(0))->GetX());
+ previousRowLoc.Add((int32_t)((CBC_ResultPoint*)result->GetAt(1))->GetX());
for (; stopRow < height; stopRow++) {
CFX_Int32Array* loc = findGuardPattern(matrix, previousRowLoc[0], stopRow, width, FALSE, pattern, patternLength, counters);
if (loc != NULL &&
@@ -227,26 +227,26 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_ result->SetAt(3, FX_NEW CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(1), (FX_FLOAT)stopRow));
}
if (stopRow - startRow < BARCODE_MIN_HEIGHT) {
- for (FX_INT32 i = 0; i < result->GetSize(); i++) {
+ for (int32_t i = 0; i < result->GetSize(); i++) {
result->SetAt(i, NULL);
}
}
return result;
}
-CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters)
+CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, int32_t column, int32_t row, int32_t width, FX_BOOL whiteFirst, int32_t* pattern, int32_t patternLength, CFX_Int32Array &counters)
{
- for (FX_INT32 i = 0; i < counters.GetSize(); i++) {
+ for (int32_t i = 0; i < counters.GetSize(); i++) {
counters.SetAt(i, 0);
}
FX_BOOL isWhite = whiteFirst;
- FX_INT32 patternStart = column;
- FX_INT32 pixelDrift = 0;
+ int32_t patternStart = column;
+ int32_t pixelDrift = 0;
CFX_Int32Array* intarray = FX_NEW CFX_Int32Array;
while (matrix->Get(patternStart, row) && patternStart > 0 && pixelDrift++ < MAX_PIXEL_DRIFT) {
patternStart--;
}
- FX_INT32 x = patternStart;
- FX_INT32 counterPosition = 0;
+ int32_t x = patternStart;
+ int32_t counterPosition = 0;
for (; x < width; x++) {
FX_BOOL pixel = matrix->Get(x, row);
if (pixel ^ isWhite) {
@@ -259,7 +259,7 @@ CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_I return intarray;
}
patternStart += counters[0] + counters[1];
- for (FX_INT32 l = 2, k = 0; l < patternLength; l++, k++) {
+ for (int32_t l = 2, k = 0; l < patternLength; l++, k++) {
counters.SetAt(k, counters.GetAt(l));
}
counters.SetAt(patternLength - 2, 0);
@@ -282,25 +282,25 @@ CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_I delete intarray;
return NULL;
}
-FX_INT32 CBC_Detector::patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance)
+int32_t CBC_Detector::patternMatchVariance(CFX_Int32Array &counters, int32_t* pattern, int32_t maxIndividualVariance)
{
- FX_INT32 numCounters = counters.GetSize();
- FX_INT32 total = 0;
- FX_INT32 patternLength = 0;
- for (FX_INT32 i = 0; i < numCounters; i++) {
+ int32_t numCounters = counters.GetSize();
+ int32_t total = 0;
+ int32_t patternLength = 0;
+ for (int32_t i = 0; i < numCounters; i++) {
total += counters[i];
patternLength += pattern[i];
}
if (total < patternLength) {
return INTERGER_MAX;
}
- FX_INT32 unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
+ int32_t unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength;
maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT;
- FX_INT32 totalVariance = 0;
- for (FX_INT32 x = 0; x < numCounters; x++) {
- FX_INT32 counter = counters[x] << INTEGER_MATH_SHIFT;
- FX_INT32 scaledPattern = pattern[x] * unitBarWidth;
- FX_INT32 variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;
+ int32_t totalVariance = 0;
+ for (int32_t x = 0; x < numCounters; x++) {
+ int32_t counter = counters[x] << INTEGER_MATH_SHIFT;
+ int32_t scaledPattern = pattern[x] * unitBarWidth;
+ int32_t variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter;
if (variance > maxIndividualVariance) {
return INTERGER_MAX;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h index c160779122..93d5ff82a2 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h @@ -15,28 +15,28 @@ class CBC_Detector public:
CBC_Detector();
virtual ~CBC_Detector();
- static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e);
+ static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, int32_t hints, FX_BOOL multiple, int32_t &e);
static void rotate180(CBC_CommonBitMatrix* bitMatrix);
static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitArray* result);
private:
- static FX_INT32 INDEXES_START_PATTERN[];
- static FX_INT32 INDEXES_STOP_PATTERN[];
- static FX_INT32 INTEGER_MATH_SHIFT;
- static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR;
- static FX_INT32 MAX_AVG_VARIANCE;
- static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
- static FX_INT32 START_PATTERN[];
- static FX_INT32 STOP_PATTERN[];
- static FX_INT32 MAX_PIXEL_DRIFT;
- static FX_INT32 MAX_PATTERN_DRIFT;
- static FX_INT32 SKIPPED_ROW_COUNT_MAX;
- static FX_INT32 ROW_STEP;
- static FX_INT32 BARCODE_MIN_HEIGHT;
+ static int32_t INDEXES_START_PATTERN[];
+ static int32_t INDEXES_STOP_PATTERN[];
+ static int32_t INTEGER_MATH_SHIFT;
+ static int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR;
+ static int32_t MAX_AVG_VARIANCE;
+ static int32_t MAX_INDIVIDUAL_VARIANCE;
+ static int32_t START_PATTERN[];
+ static int32_t STOP_PATTERN[];
+ static int32_t MAX_PIXEL_DRIFT;
+ static int32_t MAX_PATTERN_DRIFT;
+ static int32_t SKIPPED_ROW_COUNT_MAX;
+ static int32_t ROW_STEP;
+ static int32_t BARCODE_MIN_HEIGHT;
static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix);
- static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn);
- static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength);
- static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength);
- static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters);
- static FX_INT32 patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance);
+ static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, int32_t startRow, int32_t startColumn);
+ static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, int32_t* destinationIndexes, int32_t destinationLength);
+ static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_t height, int32_t width, int32_t startRow, int32_t startColumn, int32_t* pattern, int32_t patternLength);
+ static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, int32_t column, int32_t row, int32_t width, FX_BOOL whiteFirst, int32_t* pattern, int32_t patternLength, CFX_Int32Array &counters);
+ static int32_t patternMatchVariance(CFX_Int32Array &counters, int32_t* pattern, int32_t maxIndividualVariance);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp index e082290011..7f65e04294 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp @@ -31,9 +31,9 @@ CBC_PDF417DetectorResult::CBC_PDF417DetectorResult(CBC_CommonBitMatrix* bits, CF }
CBC_PDF417DetectorResult::~CBC_PDF417DetectorResult()
{
- for (FX_INT32 i = 0; i < m_points->GetSize(); i++) {
+ for (int32_t i = 0; i < m_points->GetSize(); i++) {
CFX_PtrArray* temp = (CFX_PtrArray*)m_points->GetAt(i);
- for (FX_INT32 j = 0; j < temp->GetSize(); j++) {
+ for (int32_t j = 0; j < temp->GetSize(); j++) {
delete (CBC_ResultPoint*)temp->GetAt(j);
}
temp->RemoveAll();
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp index 76d2e7bf88..189ed0831b 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp @@ -23,7 +23,7 @@ #include "../barcode.h"
#include "BC_PDF417Dimensions.h"
-CBC_Dimensions::CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minRows, FX_INT32 maxRows)
+CBC_Dimensions::CBC_Dimensions(int32_t minCols, int32_t maxCols, int32_t minRows, int32_t maxRows)
{
m_minCols = minCols;
m_maxCols = maxCols;
@@ -33,19 +33,19 @@ CBC_Dimensions::CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minR CBC_Dimensions::~CBC_Dimensions()
{
}
-FX_INT32 CBC_Dimensions::getMinCols()
+int32_t CBC_Dimensions::getMinCols()
{
return m_minCols;
}
-FX_INT32 CBC_Dimensions::getMaxCols()
+int32_t CBC_Dimensions::getMaxCols()
{
return m_maxCols;
}
-FX_INT32 CBC_Dimensions::getMinRows()
+int32_t CBC_Dimensions::getMinRows()
{
return m_minRows;
}
-FX_INT32 CBC_Dimensions::getMaxRows()
+int32_t CBC_Dimensions::getMaxRows()
{
return m_maxRows;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h index b8e9763081..b75b998fe7 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h @@ -9,16 +9,16 @@ class CBC_Dimensions
{
public:
- CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minRows, FX_INT32 maxRows);
+ CBC_Dimensions(int32_t minCols, int32_t maxCols, int32_t minRows, int32_t maxRows);
virtual ~CBC_Dimensions();
- FX_INT32 getMinCols();
- FX_INT32 getMaxCols();
- FX_INT32 getMinRows();
- FX_INT32 getMaxRows();
+ int32_t getMinCols();
+ int32_t getMaxCols();
+ int32_t getMinRows();
+ int32_t getMaxRows();
private:
- FX_INT32 m_minCols;
- FX_INT32 m_maxCols;
- FX_INT32 m_minRows;
- FX_INT32 m_maxRows;
+ int32_t m_minCols;
+ int32_t m_maxCols;
+ int32_t m_minRows;
+ int32_t m_maxRows;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp index 23207ef959..d80a7f86ac 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp @@ -26,7 +26,7 @@ #include "BC_PDF417ECModulusGF.h"
#include "BC_PDF417ECErrorCorrection.h"
CBC_PDF417ECModulusGF* CBC_PDF417ECErrorCorrection::m_field = NULL;
-void CBC_PDF417ECErrorCorrection::Initialize(FX_INT32 &e)
+void CBC_PDF417ECErrorCorrection::Initialize(int32_t &e)
{
m_field = FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e);
}
@@ -40,15 +40,15 @@ CBC_PDF417ECErrorCorrection::CBC_PDF417ECErrorCorrection() CBC_PDF417ECErrorCorrection::~CBC_PDF417ECErrorCorrection()
{
}
-FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 numECCodewords, CFX_Int32Array &erasures, FX_INT32 &e)
+int32_t CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, int32_t numECCodewords, CFX_Int32Array &erasures, int32_t &e)
{
CBC_PDF417ECModulusPoly poly(m_field, received, e);
BC_EXCEPTION_CHECK_ReturnValue(e, -1);
CFX_Int32Array S;
S.SetSize(numECCodewords);
FX_BOOL error = FALSE;
- for (FX_INT32 l = numECCodewords; l > 0; l--) {
- FX_INT32 eval = poly.evaluateAt(m_field->exp(l));
+ for (int32_t l = numECCodewords; l > 0; l--) {
+ int32_t eval = poly.evaluateAt(m_field->exp(l));
S[numECCodewords - l] = eval;
if (eval != 0) {
error = TRUE;
@@ -72,7 +72,7 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 CBC_PDF417ECModulusPoly* omega = (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(1);
CFX_Int32Array* errorLocations = findErrorLocations(sigma, e);
if (e != BCExceptionNO) {
- for (FX_INT32 i = 0; i < sigmaOmega->GetSize(); i++) {
+ for (int32_t i = 0; i < sigmaOmega->GetSize(); i++) {
delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(i);
}
sigmaOmega->RemoveAll();
@@ -82,22 +82,22 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 CFX_Int32Array* errorMagnitudes = findErrorMagnitudes(omega, sigma, *errorLocations, e);
if (e != BCExceptionNO) {
delete errorLocations;
- for (FX_INT32 i = 0; i < sigmaOmega->GetSize(); i++) {
+ for (int32_t i = 0; i < sigmaOmega->GetSize(); i++) {
delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(i);
}
sigmaOmega->RemoveAll();
delete sigmaOmega;
return -1;
}
- for (FX_INT32 i = 0; i < errorLocations->GetSize(); i++) {
- FX_INT32 log = m_field->log(errorLocations->GetAt(i), e);;
+ for (int32_t i = 0; i < errorLocations->GetSize(); i++) {
+ int32_t log = m_field->log(errorLocations->GetAt(i), e);;
BC_EXCEPTION_CHECK_ReturnValue(e, -1);
- FX_INT32 position = received.GetSize() - 1 - log;
+ int32_t position = received.GetSize() - 1 - log;
if (position < 0) {
e = BCExceptionChecksumException;
delete errorLocations;
delete errorMagnitudes;
- for (FX_INT32 j = 0; j < sigmaOmega->GetSize(); j++) {
+ for (int32_t j = 0; j < sigmaOmega->GetSize(); j++) {
delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(j);
}
sigmaOmega->RemoveAll();
@@ -106,17 +106,17 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 }
received[position] = m_field->subtract(received[position], errorMagnitudes->GetAt(i));
}
- FX_INT32 result = errorLocations->GetSize();
+ int32_t result = errorLocations->GetSize();
delete errorLocations;
delete errorMagnitudes;
- for (FX_INT32 k = 0; k < sigmaOmega->GetSize(); k++) {
+ for (int32_t k = 0; k < sigmaOmega->GetSize(); k++) {
delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(k);
}
sigmaOmega->RemoveAll();
delete sigmaOmega;
return result;
}
-CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, FX_INT32 R, FX_INT32 &e)
+CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, int32_t R, int32_t &e)
{
if (a->getDegree() < b->getDegree()) {
CBC_PDF417ECModulusPoly* temp = a;
@@ -130,10 +130,10 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod CBC_PDF417ECModulusPoly* qtemp = NULL;
CBC_PDF417ECModulusPoly* rtemp = NULL;
CBC_PDF417ECModulusPoly* ttemp = NULL;
- FX_INT32 i = 0;
- FX_INT32 j = 0;
- FX_INT32 m = 0;
- FX_INT32 n = 0;
+ int32_t i = 0;
+ int32_t j = 0;
+ int32_t m = 0;
+ int32_t n = 0;
while (r->getDegree() >= R / 2) {
CBC_PDF417ECModulusPoly* rLastLast = rLast;
CBC_PDF417ECModulusPoly* tLastLast = tLast;
@@ -156,8 +156,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod }
r = rLastLast;
CBC_PDF417ECModulusPoly* q = m_field->getZero();
- FX_INT32 denominatorLeadingTerm = rLast->getCoefficient(rLast->getDegree());
- FX_INT32 dltInverse = m_field->inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = rLast->getCoefficient(rLast->getDegree());
+ int32_t dltInverse = m_field->inverse(denominatorLeadingTerm, e);
if (e != BCExceptionNO) {
if (qtemp) {
delete qtemp;
@@ -171,8 +171,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod return NULL;
}
while (r->getDegree() >= rLast->getDegree() && !r->isZero()) {
- FX_INT32 degreeDiff = r->getDegree() - rLast->getDegree();
- FX_INT32 scale = m_field->multiply(r->getCoefficient(r->getDegree()), dltInverse);
+ int32_t degreeDiff = r->getDegree() - rLast->getDegree();
+ int32_t scale = m_field->multiply(r->getCoefficient(r->getDegree()), dltInverse);
CBC_PDF417ECModulusPoly* buildmonomial = m_field->buildMonomial(degreeDiff, scale, e);
if (e != BCExceptionNO) {
if (qtemp) {
@@ -273,8 +273,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod ttemp = t;
j++;
}
- FX_INT32 aa = t->getCoefficient(1);
- FX_INT32 sigmaTildeAtZero = t->getCoefficient(0);
+ int32_t aa = t->getCoefficient(1);
+ int32_t sigmaTildeAtZero = t->getCoefficient(0);
if (sigmaTildeAtZero == 0) {
e = BCExceptionChecksumException;
if (rtemp) {
@@ -285,7 +285,7 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod }
return NULL;
}
- FX_INT32 inverse = m_field->inverse(sigmaTildeAtZero, e);
+ int32_t inverse = m_field->inverse(sigmaTildeAtZero, e);
if (e != BCExceptionNO) {
if (rtemp) {
delete rtemp;
@@ -315,13 +315,13 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod modulusPoly->Add(omega);
return modulusPoly;
}
-CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, FX_INT32 &e)
+CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, int32_t &e)
{
- FX_INT32 numErrors = errorLocator->getDegree();
+ int32_t numErrors = errorLocator->getDegree();
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
result->SetSize(numErrors);
- FX_INT32 ee = 0;
- for (FX_INT32 i = 1; i < m_field->getSize() && ee < numErrors; i++) {
+ int32_t ee = 0;
+ for (int32_t i = 1; i < m_field->getSize() && ee < numErrors; i++) {
if (errorLocator->evaluateAt(i) == 0) {
result->SetAt(ee, m_field->inverse(i, e));
if (e != BCExceptionNO) {
@@ -338,27 +338,27 @@ CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModu }
return result;
}
-CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, FX_INT32 &e)
+CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, int32_t &e)
{
- FX_INT32 errorLocatorDegree = errorLocator->getDegree();
+ int32_t errorLocatorDegree = errorLocator->getDegree();
CFX_Int32Array formalDerivativeCoefficients;
formalDerivativeCoefficients.SetSize(errorLocatorDegree);
- for (FX_INT32 l = 1; l <= errorLocatorDegree; l++) {
+ for (int32_t l = 1; l <= errorLocatorDegree; l++) {
formalDerivativeCoefficients[errorLocatorDegree - l] = m_field->multiply(l, errorLocator->getCoefficient(l));
}
CBC_PDF417ECModulusPoly formalDerivative(m_field, formalDerivativeCoefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 s = errorLocations.GetSize();
+ int32_t s = errorLocations.GetSize();
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
result->SetSize(s);
- for (FX_INT32 i = 0; i < s; i++) {
- FX_INT32 xiInverse = m_field->inverse(errorLocations[i], e);
+ for (int32_t i = 0; i < s; i++) {
+ int32_t xiInverse = m_field->inverse(errorLocations[i], e);
if (e != BCExceptionNO) {
delete result;
return NULL;
}
- FX_INT32 numerator = m_field->subtract(0, errorEvaluator->evaluateAt(xiInverse));
- FX_INT32 denominator = m_field->inverse(formalDerivative.evaluateAt(xiInverse), e);
+ int32_t numerator = m_field->subtract(0, errorEvaluator->evaluateAt(xiInverse));
+ int32_t denominator = m_field->inverse(formalDerivative.evaluateAt(xiInverse), e);
if (e != BCExceptionNO) {
delete result;
return NULL;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h index 0fca2e6c39..c8a2058298 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h @@ -13,13 +13,13 @@ class CBC_PDF417ECErrorCorrection public:
CBC_PDF417ECErrorCorrection();
virtual ~CBC_PDF417ECErrorCorrection();
- static void Initialize(FX_INT32 &e);
+ static void Initialize(int32_t &e);
static void Finalize();
- static FX_INT32 decode(CFX_Int32Array &received, FX_INT32 numECCodewords, CFX_Int32Array &erasures, FX_INT32 &e);
+ static int32_t decode(CFX_Int32Array &received, int32_t numECCodewords, CFX_Int32Array &erasures, int32_t &e);
private:
static CBC_PDF417ECModulusGF* m_field;
- static CFX_PtrArray* runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, FX_INT32 R, FX_INT32 &e);
- static CFX_Int32Array* findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, FX_INT32 &e);
- static CFX_Int32Array* findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, FX_INT32 &e);
+ static CFX_PtrArray* runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, int32_t R, int32_t &e);
+ static CFX_Int32Array* findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, int32_t &e);
+ static CFX_Int32Array* findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp index 7619854bcb..1b41474bb3 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp @@ -25,7 +25,7 @@ #include "BC_PDF417ECModulusPoly.h"
#include "BC_PDF417ECModulusGF.h"
CBC_PDF417ECModulusGF* CBC_PDF417ECModulusGF::PDF417_GF = NULL;
-void CBC_PDF417ECModulusGF::Initialize(FX_INT32 &e)
+void CBC_PDF417ECModulusGF::Initialize(int32_t &e)
{
PDF417_GF = FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e);
}
@@ -33,17 +33,17 @@ void CBC_PDF417ECModulusGF::Finalize() {
delete PDF417_GF;
}
-CBC_PDF417ECModulusGF::CBC_PDF417ECModulusGF(FX_INT32 modulus, FX_INT32 generator, FX_INT32 &e)
+CBC_PDF417ECModulusGF::CBC_PDF417ECModulusGF(int32_t modulus, int32_t generator, int32_t &e)
{
m_modulus = modulus;
m_expTable.SetSize(modulus);
m_logTable.SetSize(modulus);
- FX_INT32 x = 1;
- for (FX_INT32 i = 0; i < modulus; i++) {
+ int32_t x = 1;
+ for (int32_t i = 0; i < modulus; i++) {
m_expTable[i] = x;
x = (x * generator) % modulus;
}
- for (FX_INT32 j = 0; j < modulus - 1; j++) {
+ for (int32_t j = 0; j < modulus - 1; j++) {
m_logTable[m_expTable[j]] = j;
}
CFX_Int32Array zero;
@@ -66,7 +66,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::getOne() {
return m_one;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if (degree < 0) {
e = BCExceptionIllegalArgument;
@@ -85,19 +85,19 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(FX_INT32 degree, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-FX_INT32 CBC_PDF417ECModulusGF::add(FX_INT32 a, FX_INT32 b)
+int32_t CBC_PDF417ECModulusGF::add(int32_t a, int32_t b)
{
return (a + b) % m_modulus;
}
-FX_INT32 CBC_PDF417ECModulusGF::subtract(FX_INT32 a, FX_INT32 b)
+int32_t CBC_PDF417ECModulusGF::subtract(int32_t a, int32_t b)
{
return (m_modulus + a - b) % m_modulus;
}
-FX_INT32 CBC_PDF417ECModulusGF::exp(FX_INT32 a)
+int32_t CBC_PDF417ECModulusGF::exp(int32_t a)
{
return m_expTable[a];
}
-FX_INT32 CBC_PDF417ECModulusGF::log(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_PDF417ECModulusGF::log(int32_t a, int32_t &e)
{
if (a == 0) {
e = BCExceptionIllegalArgument;
@@ -105,7 +105,7 @@ FX_INT32 CBC_PDF417ECModulusGF::log(FX_INT32 a, FX_INT32 &e) }
return m_logTable[a];
}
-FX_INT32 CBC_PDF417ECModulusGF::inverse(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_PDF417ECModulusGF::inverse(int32_t a, int32_t &e)
{
if (a == 0) {
e = BCExceptionIllegalArgument;
@@ -113,14 +113,14 @@ FX_INT32 CBC_PDF417ECModulusGF::inverse(FX_INT32 a, FX_INT32 &e) }
return m_expTable[m_modulus - m_logTable[a] - 1];
}
-FX_INT32 CBC_PDF417ECModulusGF::multiply(FX_INT32 a, FX_INT32 b)
+int32_t CBC_PDF417ECModulusGF::multiply(int32_t a, int32_t b)
{
if (a == 0 || b == 0) {
return 0;
}
return m_expTable[(m_logTable[a] + m_logTable[b]) % (m_modulus - 1)];
}
-FX_INT32 CBC_PDF417ECModulusGF::getSize()
+int32_t CBC_PDF417ECModulusGF::getSize()
{
return m_modulus;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h index fbb79e3586..ee19117242 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h @@ -11,26 +11,26 @@ class CBC_PDF417Common; class CBC_PDF417ECModulusGF
{
public:
- CBC_PDF417ECModulusGF(FX_INT32 modulus, FX_INT32 generator, FX_INT32 &e);
+ CBC_PDF417ECModulusGF(int32_t modulus, int32_t generator, int32_t &e);
virtual ~CBC_PDF417ECModulusGF();
- static void Initialize(FX_INT32 &e);
+ static void Initialize(int32_t &e);
static void Finalize();
CBC_PDF417ECModulusPoly* getZero();
CBC_PDF417ECModulusPoly* getOne();
- CBC_PDF417ECModulusPoly* buildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- FX_INT32 add(FX_INT32 a, FX_INT32 b);
- FX_INT32 subtract(FX_INT32 a, FX_INT32 b);
- FX_INT32 exp(FX_INT32 a);
- FX_INT32 log(FX_INT32 a, FX_INT32 &e);
- FX_INT32 inverse(FX_INT32 a, FX_INT32 &e);
- FX_INT32 multiply(FX_INT32 a, FX_INT32 b);
- FX_INT32 getSize();
+ CBC_PDF417ECModulusPoly* buildMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ int32_t add(int32_t a, int32_t b);
+ int32_t subtract(int32_t a, int32_t b);
+ int32_t exp(int32_t a);
+ int32_t log(int32_t a, int32_t &e);
+ int32_t inverse(int32_t a, int32_t &e);
+ int32_t multiply(int32_t a, int32_t b);
+ int32_t getSize();
static CBC_PDF417ECModulusGF* PDF417_GF;
private:
CFX_Int32Array m_expTable;
CFX_Int32Array m_logTable;
CBC_PDF417ECModulusPoly* m_zero;
CBC_PDF417ECModulusPoly* m_one;
- FX_INT32 m_modulus;
+ int32_t m_modulus;
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp index 39d3fd8056..686b2badca 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp @@ -24,15 +24,15 @@ #include "BC_PDF417Common.h"
#include "BC_PDF417ECModulusGF.h"
#include "BC_PDF417ECModulusPoly.h"
-CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, FX_INT32 &e)
+CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, int32_t &e)
{
if (coefficients.GetSize() == 0) {
e = BCExceptionIllegalArgument;
}
m_field = field;
- FX_INT32 coefficientsLength = coefficients.GetSize();
+ int32_t coefficientsLength = coefficients.GetSize();
if (coefficientsLength > 1 && coefficients[0] == 0) {
- FX_INT32 firstNonZero = 1;
+ int32_t firstNonZero = 1;
while (firstNonZero < coefficientsLength && coefficients[firstNonZero] == 0) {
firstNonZero++;
}
@@ -40,8 +40,8 @@ CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, C m_coefficients = field->getZero()->m_coefficients;
} else {
m_coefficients.SetSize(coefficientsLength - firstNonZero);
- FX_INT32 l = 0;
- for (FX_INT32 i = firstNonZero; i < firstNonZero + m_coefficients.GetSize(); i++) {
+ int32_t l = 0;
+ for (int32_t i = firstNonZero; i < firstNonZero + m_coefficients.GetSize(); i++) {
m_coefficients.SetAt(l, coefficients.GetAt(i));
l++;
}
@@ -61,7 +61,7 @@ CBC_PDF417ECModulusGF* CBC_PDF417ECModulusPoly::getField() {
return m_field;
}
-FX_INT32 CBC_PDF417ECModulusPoly::getDegree()
+int32_t CBC_PDF417ECModulusPoly::getDegree()
{
return m_coefficients.GetSize() - 1;
}
@@ -69,31 +69,31 @@ FX_BOOL CBC_PDF417ECModulusPoly::isZero() {
return m_coefficients[0] == 0;
}
-FX_INT32 CBC_PDF417ECModulusPoly::getCoefficient(FX_INT32 degree)
+int32_t CBC_PDF417ECModulusPoly::getCoefficient(int32_t degree)
{
return m_coefficients[m_coefficients.GetSize() - 1 - degree];
}
-FX_INT32 CBC_PDF417ECModulusPoly::evaluateAt(FX_INT32 a)
+int32_t CBC_PDF417ECModulusPoly::evaluateAt(int32_t a)
{
if (a == 0) {
return getCoefficient(0);
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
if (a == 1) {
- FX_INT32 result = 0;
- for (FX_INT32 l = 0; l < m_coefficients.GetSize(); l++) {
- FX_INT32 coefficient = m_coefficients.GetAt(l);
+ int32_t result = 0;
+ for (int32_t l = 0; l < m_coefficients.GetSize(); l++) {
+ int32_t coefficient = m_coefficients.GetAt(l);
result = m_field->add(result, coefficient);
}
return result;
}
- FX_INT32 result = m_coefficients[0];
- for (FX_INT32 i = 1; i < size; i++) {
+ int32_t result = m_coefficients[0];
+ for (int32_t i = 1; i < size; i++) {
result = m_field->add(m_field->multiply(a, result), m_coefficients[i]);
}
return result;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* other, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* other, int32_t &e)
{
CBC_PDF417ECModulusPoly* modulusPoly = NULL;
if (isZero()) {
@@ -118,18 +118,18 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* o }
CFX_Int32Array sumDiff;
sumDiff.SetSize(largerCoefficients.GetSize());
- FX_INT32 lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
- for (FX_INT32 l = 0; l < lengthDiff; l++) {
+ int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
+ for (int32_t l = 0; l < lengthDiff; l++) {
sumDiff.SetAt(l, largerCoefficients.GetAt(l));
}
- for (FX_INT32 i = lengthDiff; i < largerCoefficients.GetSize(); i++) {
+ for (int32_t i = lengthDiff; i < largerCoefficients.GetSize(); i++) {
sumDiff[i] = m_field->add(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);
}
modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, sumDiff, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPoly* other, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPoly* other, int32_t &e)
{
CBC_PDF417ECModulusPoly* modulusPoly = NULL;
if (other->isZero()) {
@@ -144,7 +144,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPo BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPoly* other, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPoly* other, int32_t &e)
{
CBC_PDF417ECModulusPoly* modulusPoly = NULL;
if (isZero() || other->isZero()) {
@@ -154,15 +154,15 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPo }
CFX_Int32Array aCoefficients;
aCoefficients.Copy(m_coefficients);
- FX_INT32 aLength = aCoefficients.GetSize();
+ int32_t aLength = aCoefficients.GetSize();
CFX_Int32Array bCoefficients;
bCoefficients.Copy(other->m_coefficients);
- FX_INT32 bLength = bCoefficients.GetSize();
+ int32_t bLength = bCoefficients.GetSize();
CFX_Int32Array product;
product.SetSize(aLength + bLength - 1);
- for (FX_INT32 i = 0; i < aLength; i++) {
- FX_INT32 aCoeff = aCoefficients[i];
- for (FX_INT32 j = 0; j < bLength; j++) {
+ for (int32_t i = 0; i < aLength; i++) {
+ int32_t aCoeff = aCoefficients[i];
+ for (int32_t j = 0; j < bLength; j++) {
product[i + j] = m_field->add(product[i + j], m_field->multiply(aCoeff, bCoefficients[j]));
}
}
@@ -170,19 +170,19 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPo BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::negative(FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::negative(int32_t &e)
{
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array negativeCoefficients;
negativeCoefficients.SetSize(size);
- for (FX_INT32 i = 0; i < size; i++) {
+ for (int32_t i = 0; i < size; i++) {
negativeCoefficients[i] = m_field->subtract(0, m_coefficients[i]);
}
CBC_PDF417ECModulusPoly* modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, negativeCoefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(FX_INT32 scalar, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(int32_t scalar, int32_t &e)
{
CBC_PDF417ECModulusPoly* modulusPoly = NULL;
if (scalar == 0) {
@@ -195,17 +195,17 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(FX_INT32 scalar, FX_I BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size);
- for (FX_INT32 i = 0; i < size; i++) {
+ for (int32_t i = 0; i < size; i++) {
product[i] = m_field->multiply(m_coefficients[i], scalar);
}
modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if (degree < 0) {
e = BCExceptionIllegalArgument;
@@ -217,17 +217,17 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(FX_INT32 de BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size + degree);
- for (FX_INT32 i = 0; i < size; i++) {
+ for (int32_t i = 0; i < size; i++) {
product[i] = m_field->multiply(m_coefficients[i], coefficient);
}
modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return modulusPoly;
}
-CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX_INT32 &e)
+CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, int32_t &e)
{
if (other->isZero()) {
e = BCExceptionDivideByZero;
@@ -240,16 +240,16 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX delete quotient;
return NULL;
}
- FX_INT32 denominatorLeadingTerm = other->getCoefficient(other->getDegree());
- FX_INT32 inverseDenominatorLeadingTerm = m_field->inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = other->getCoefficient(other->getDegree());
+ int32_t inverseDenominatorLeadingTerm = m_field->inverse(denominatorLeadingTerm, e);
if (e != BCExceptionNO) {
delete quotient;
delete remainder;
return NULL;
}
while (remainder->getDegree() >= other->getDegree() && !remainder->isZero()) {
- FX_INT32 degreeDifference = remainder->getDegree() - other->getDegree();
- FX_INT32 scale = m_field->multiply(remainder->getCoefficient(remainder->getDegree()), inverseDenominatorLeadingTerm);
+ int32_t degreeDifference = remainder->getDegree() - other->getDegree();
+ int32_t scale = m_field->multiply(remainder->getCoefficient(remainder->getDegree()), inverseDenominatorLeadingTerm);
CBC_PDF417ECModulusPoly* term = other->multiplyByMonomial(degreeDifference, scale, e);
if (e != BCExceptionNO) {
delete quotient;
@@ -288,8 +288,8 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX CFX_ByteString CBC_PDF417ECModulusPoly::toString()
{
CFX_ByteString result;
- for (FX_INT32 degree = getDegree(); degree >= 0; degree--) {
- FX_INT32 coefficient = getCoefficient(degree);
+ for (int32_t degree = getDegree(); degree >= 0; degree--) {
+ int32_t coefficient = getCoefficient(degree);
if (coefficient != 0) {
if (coefficient < 0) {
result += " - ";
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h index 172cc76cc8..72c8d3eb35 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h @@ -10,21 +10,21 @@ class CBC_PDF417ECModulusGF; class CBC_PDF417ECModulusPoly
{
public:
- CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, FX_INT32 &e);
+ CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, int32_t &e);
virtual ~CBC_PDF417ECModulusPoly();
CFX_Int32Array& getCoefficients();
CBC_PDF417ECModulusGF* getField();
- FX_INT32 getDegree();
+ int32_t getDegree();
FX_BOOL isZero();
- FX_INT32 getCoefficient(FX_INT32 degree);
- FX_INT32 evaluateAt(FX_INT32 a);
- CBC_PDF417ECModulusPoly* add(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
- CBC_PDF417ECModulusPoly* subtract(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
- CBC_PDF417ECModulusPoly* multiply(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
- CBC_PDF417ECModulusPoly* negative(FX_INT32 &e);
- CBC_PDF417ECModulusPoly* multiply(FX_INT32 scalar, FX_INT32 &e);
- CBC_PDF417ECModulusPoly* multiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- CFX_PtrArray* divide(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
+ int32_t getCoefficient(int32_t degree);
+ int32_t evaluateAt(int32_t a);
+ CBC_PDF417ECModulusPoly* add(CBC_PDF417ECModulusPoly* other, int32_t &e);
+ CBC_PDF417ECModulusPoly* subtract(CBC_PDF417ECModulusPoly* other, int32_t &e);
+ CBC_PDF417ECModulusPoly* multiply(CBC_PDF417ECModulusPoly* other, int32_t &e);
+ CBC_PDF417ECModulusPoly* negative(int32_t &e);
+ CBC_PDF417ECModulusPoly* multiply(int32_t scalar, int32_t &e);
+ CBC_PDF417ECModulusPoly* multiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ CFX_PtrArray* divide(CBC_PDF417ECModulusPoly* other, int32_t &e);
CFX_ByteString toString();
private:
CBC_PDF417ECModulusGF* m_field;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp index cd1ea88046..9dd6f67575 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp @@ -22,7 +22,7 @@ #include "../barcode.h"
#include "BC_PDF417ErrorCorrection.h"
-FX_INT32 CBC_PDF417ErrorCorrection::EC_COEFFICIENTS[][2500] = {
+int32_t CBC_PDF417ErrorCorrection::EC_COEFFICIENTS[][2500] = {
{27, 917},
{522, 568, 723, 809},
{237, 308, 436, 284, 646, 653, 428, 379},
@@ -132,7 +132,7 @@ CBC_PDF417ErrorCorrection::CBC_PDF417ErrorCorrection() CBC_PDF417ErrorCorrection::~CBC_PDF417ErrorCorrection()
{
}
-FX_INT32 CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(FX_INT32 errorCorrectionLevel, FX_INT32 &e)
+int32_t CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(int32_t errorCorrectionLevel, int32_t &e)
{
if (errorCorrectionLevel < 0 || errorCorrectionLevel > 8) {
e = BCExceptionErrorCorrectionLevelMustBeBetween0And8;
@@ -140,7 +140,7 @@ FX_INT32 CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(FX_INT32 err }
return 1 << (errorCorrectionLevel + 1);
}
-FX_INT32 CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(FX_INT32 n, FX_INT32 &e)
+int32_t CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(int32_t n, int32_t &e)
{
if (n <= 0) {
e = BCExceptionIllegalArgumentnMustBeAbove0;
@@ -161,18 +161,18 @@ FX_INT32 CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(FX e = BCExceptionNoRecommendationPossible;
return -1;
}
-CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString dataCodewords, FX_INT32 errorCorrectionLevel, FX_INT32 &e)
+CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString dataCodewords, int32_t errorCorrectionLevel, int32_t &e)
{
- FX_INT32 k = getErrorCorrectionCodewordCount(errorCorrectionLevel, e);
+ int32_t k = getErrorCorrectionCodewordCount(errorCorrectionLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_WCHAR)' ');
FX_WCHAR* ech = FX_Alloc(FX_WCHAR, k * sizeof(FX_WCHAR));
FXSYS_memset32(ech, 0, k * sizeof(FX_WCHAR));
- FX_INT32 sld = dataCodewords.GetLength();
- for (FX_INT32 i = 0; i < sld; i++) {
- FX_INT32 t1 = (dataCodewords.GetAt(i) + ech[k - 1]) % 929;
- FX_INT32 t2;
- FX_INT32 t3;
- for (FX_INT32 j = k - 1; j >= 1; j--) {
+ int32_t sld = dataCodewords.GetLength();
+ for (int32_t i = 0; i < sld; i++) {
+ int32_t t1 = (dataCodewords.GetAt(i) + ech[k - 1]) % 929;
+ int32_t t2;
+ int32_t t3;
+ for (int32_t j = k - 1; j >= 1; j--) {
t2 = (t1 * EC_COEFFICIENTS[errorCorrectionLevel][j]) % 929;
t3 = 929 - t2;
ech[j] = (FX_WCHAR) ((ech[j - 1] + t3) % 929);
@@ -182,7 +182,7 @@ CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString ech[0] = (FX_WCHAR) (t3 % 929);
}
CFX_WideString sb;
- for (FX_INT32 j = k - 1; j >= 0; j--) {
+ for (int32_t j = k - 1; j >= 0; j--) {
if (ech[j] != 0) {
ech[j] = (FX_WCHAR) (929 - ech[j]);
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h index 9af8b72f17..4e5dee0bb8 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h @@ -11,10 +11,10 @@ class CBC_PDF417ErrorCorrection public:
CBC_PDF417ErrorCorrection();
virtual ~CBC_PDF417ErrorCorrection();
- static FX_INT32 getErrorCorrectionCodewordCount(FX_INT32 errorCorrectionLevel, FX_INT32 &e);
- static FX_INT32 getRecommendedMinimumErrorCorrectionLevel(FX_INT32 n, FX_INT32 &e);
- static CFX_WideString generateErrorCorrection(CFX_WideString dataCodewords, FX_INT32 errorCorrectionLevel, FX_INT32 &e);
+ static int32_t getErrorCorrectionCodewordCount(int32_t errorCorrectionLevel, int32_t &e);
+ static int32_t getRecommendedMinimumErrorCorrectionLevel(int32_t n, int32_t &e);
+ static CFX_WideString generateErrorCorrection(CFX_WideString dataCodewords, int32_t errorCorrectionLevel, int32_t &e);
private:
- static FX_INT32 EC_COEFFICIENTS[][2500];
+ static int32_t EC_COEFFICIENTS[][2500];
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp index 54bd0b6c6a..85c01d60b0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp @@ -28,23 +28,23 @@ #define SUBMODE_ALPHA 0
#define SUBMODE_LOWER 1
#define SUBMODE_MIXED 2
-FX_INT32 CBC_PDF417HighLevelEncoder::TEXT_COMPACTION = 0;
-FX_INT32 CBC_PDF417HighLevelEncoder::BYTE_COMPACTION = 1;
-FX_INT32 CBC_PDF417HighLevelEncoder::NUMERIC_COMPACTION = 2;
-FX_INT32 CBC_PDF417HighLevelEncoder::SUBMODE_PUNCTUATION = 3;
-FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_TEXT = 900;
-FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE_PADDED = 901;
-FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_NUMERIC = 902;
-FX_INT32 CBC_PDF417HighLevelEncoder::SHIFT_TO_BYTE = 913;
-FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE = 924;
-FX_BYTE CBC_PDF417HighLevelEncoder::TEXT_MIXED_RAW[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 38, 13, 9, 44, 58,
+int32_t CBC_PDF417HighLevelEncoder::TEXT_COMPACTION = 0;
+int32_t CBC_PDF417HighLevelEncoder::BYTE_COMPACTION = 1;
+int32_t CBC_PDF417HighLevelEncoder::NUMERIC_COMPACTION = 2;
+int32_t CBC_PDF417HighLevelEncoder::SUBMODE_PUNCTUATION = 3;
+int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_TEXT = 900;
+int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE_PADDED = 901;
+int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_NUMERIC = 902;
+int32_t CBC_PDF417HighLevelEncoder::SHIFT_TO_BYTE = 913;
+int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE = 924;
+uint8_t CBC_PDF417HighLevelEncoder::TEXT_MIXED_RAW[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 38, 13, 9, 44, 58,
35, 45, 46, 36, 47, 43, 37, 42, 61, 94, 0, 32, 0, 0, 0
};
-FX_BYTE CBC_PDF417HighLevelEncoder::TEXT_PUNCTUATION_RAW[] = {59, 60, 62, 64, 91, 92, 93, 95, 96, 126, 33, 13, 9, 44, 58,
+uint8_t CBC_PDF417HighLevelEncoder::TEXT_PUNCTUATION_RAW[] = {59, 60, 62, 64, 91, 92, 93, 95, 96, 126, 33, 13, 9, 44, 58,
10, 45, 46, 36, 47, 34, 124, 42, 40, 41, 63, 123, 125, 39, 0
};
-FX_INT32 CBC_PDF417HighLevelEncoder::MIXED[128] = {0};
-FX_INT32 CBC_PDF417HighLevelEncoder::PUNCTUATION[128] = {0};
+int32_t CBC_PDF417HighLevelEncoder::MIXED[128] = {0};
+int32_t CBC_PDF417HighLevelEncoder::PUNCTUATION[128] = {0};
void CBC_PDF417HighLevelEncoder::Initialize()
{
Inverse();
@@ -52,13 +52,13 @@ void CBC_PDF417HighLevelEncoder::Initialize() void CBC_PDF417HighLevelEncoder::Finalize()
{
}
-CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMsg, Compaction compaction, FX_INT32 &e)
+CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMsg, Compaction compaction, int32_t &e)
{
CFX_ByteString bytes;
CBC_UtilCodingConvert::UnicodeToUTF8(wideMsg, bytes);
CFX_WideString msg;
- FX_INT32 len = bytes.GetLength();
- for (FX_INT32 i = 0; i < len; i++) {
+ int32_t len = bytes.GetLength();
+ for (int32_t i = 0; i < len; i++) {
FX_WCHAR ch = (FX_WCHAR)(bytes.GetAt(i) & 0xff);
if (ch == '?' && bytes.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
@@ -67,13 +67,13 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs msg += ch;
}
CFX_ByteArray byteArr;
- for (FX_INT32 k = 0; k < bytes.GetLength(); k++) {
+ for (int32_t k = 0; k < bytes.GetLength(); k++) {
byteArr.Add(bytes.GetAt(k));
}
CFX_WideString sb;
len = msg.GetLength();
- FX_INT32 p = 0;
- FX_INT32 textSubMode = SUBMODE_ALPHA;
+ int32_t p = 0;
+ int32_t textSubMode = SUBMODE_ALPHA;
if (compaction == TEXT) {
encodeText(msg, p, len, sb, textSubMode);
} else if (compaction == BYTES) {
@@ -82,9 +82,9 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs sb += (FX_WCHAR) LATCH_TO_NUMERIC;
encodeNumeric(msg, p, len, sb);
} else {
- FX_INT32 encodingMode = LATCH_TO_TEXT;
+ int32_t encodingMode = LATCH_TO_TEXT;
while (p < len) {
- FX_INT32 n = determineConsecutiveDigitCount(msg, p);
+ int32_t n = determineConsecutiveDigitCount(msg, p);
if (n >= 13) {
sb += (FX_WCHAR) LATCH_TO_NUMERIC;
encodingMode = NUMERIC_COMPACTION;
@@ -92,7 +92,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs encodeNumeric(msg, p, n, sb);
p += n;
} else {
- FX_INT32 t = determineConsecutiveTextCount(msg, p);
+ int32_t t = determineConsecutiveTextCount(msg, p);
if (t >= 5 || n == len) {
if (encodingMode != TEXT_COMPACTION) {
sb += (FX_WCHAR) LATCH_TO_TEXT;
@@ -102,7 +102,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs textSubMode = encodeText(msg, p, t, sb, textSubMode);
p += t;
} else {
- FX_INT32 b = determineConsecutiveBinaryCount(msg, &byteArr, p, e);
+ int32_t b = determineConsecutiveBinaryCount(msg, &byteArr, p, e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_WCHAR)' ');
if (b == 0) {
b = 1;
@@ -123,13 +123,13 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs }
void CBC_PDF417HighLevelEncoder::Inverse()
{
- FX_BYTE i = 0;
- FX_INT32 l = 0;
+ uint8_t i = 0;
+ int32_t l = 0;
for (l = 0; l < sizeof(MIXED) / sizeof(MIXED[0]); l++) {
MIXED[l] = -1;
}
for (i = 0; i < sizeof(TEXT_MIXED_RAW) / sizeof(TEXT_MIXED_RAW[0]); i++) {
- FX_BYTE b = TEXT_MIXED_RAW[i];
+ uint8_t b = TEXT_MIXED_RAW[i];
if (b > 0) {
MIXED[b] = i;
}
@@ -138,17 +138,17 @@ void CBC_PDF417HighLevelEncoder::Inverse() PUNCTUATION[l] = -1;
}
for (i = 0; i < sizeof(TEXT_PUNCTUATION_RAW) / sizeof(TEXT_PUNCTUATION_RAW[0]); i++) {
- FX_BYTE b = TEXT_PUNCTUATION_RAW[i];
+ uint8_t b = TEXT_PUNCTUATION_RAW[i];
if (b > 0) {
PUNCTUATION[b] = i;
}
}
}
-FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode)
+int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb, int32_t initialSubmode)
{
CFX_WideString tmp;
- FX_INT32 submode = initialSubmode;
- FX_INT32 idx = 0;
+ int32_t submode = initialSubmode;
+ int32_t idx = 0;
while (TRUE) {
FX_WCHAR ch = msg.GetAt(startpos + idx);
switch (submode) {
@@ -201,7 +201,7 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta case SUBMODE_MIXED:
if (isMixed(ch)) {
FX_WCHAR a = MIXED[ch];
- FX_INT32 b = (FX_INT32)a;
+ int32_t b = (int32_t)a;
tmp += MIXED[ch];
} else {
if (isAlphaUpper(ch)) {
@@ -241,8 +241,8 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta }
}
FX_WCHAR h = 0;
- FX_INT32 len = tmp.GetLength();
- for (FX_INT32 i = 0; i < len; i++) {
+ int32_t len = tmp.GetLength();
+ for (int32_t i = 0; i < len; i++) {
FX_BOOL odd = (i % 2) != 0;
if (odd) {
h = (FX_WCHAR) ((h * 30) + tmp.GetAt(i));
@@ -256,18 +256,18 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta }
return submode;
}
-void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb)
+void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t count, int32_t startmode, CFX_WideString &sb)
{
if (count == 1 && startmode == TEXT_COMPACTION) {
sb += (FX_WCHAR) SHIFT_TO_BYTE;
}
- FX_INT32 idx = startpos;
- FX_INT32 i = 0;
+ int32_t idx = startpos;
+ int32_t i = 0;
if (count >= 6) {
sb += (FX_WCHAR) LATCH_TO_BYTE;
FX_WCHAR chars[5];
while ((startpos + count - idx) >= 6) {
- FX_INT64 t = 0;
+ int64_t t = 0;
for (i = 0; i < 6; i++) {
t <<= 8;
t += bytes->GetAt(idx + i) & 0xff;
@@ -286,25 +286,25 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, FX_INT32 sta sb += (FX_WCHAR) LATCH_TO_BYTE_PADDED;
}
for (i = idx; i < startpos + count; i++) {
- FX_INT32 ch = bytes->GetAt(i) & 0xff;
+ int32_t ch = bytes->GetAt(i) & 0xff;
sb += (FX_WCHAR) ch;
}
}
-void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb)
+void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb)
{
- FX_INT32 idx = 0;
+ int32_t idx = 0;
BigInteger num900 = 900;
while (idx < count) {
CFX_WideString tmp;
- FX_INT32 len = 44 < count - idx ? 44 : count - idx;
+ int32_t len = 44 < count - idx ? 44 : count - idx;
CFX_ByteString part = ((FX_WCHAR)'1' + msg.Mid(startpos + idx, len)).UTF8Encode();
BigInteger bigint = stringToBigInteger(part.c_str());
do {
- FX_INT32 c = (bigint % num900).toInt();
+ int32_t c = (bigint % num900).toInt();
tmp += (FX_WCHAR)(c);
bigint = bigint / num900;
} while (!bigint.isZero());
- for (FX_INT32 i = tmp.GetLength() - 1; i >= 0; i--) {
+ for (int32_t i = tmp.GetLength() - 1; i >= 0; i--) {
sb += tmp.GetAt(i);
}
idx += len;
@@ -334,11 +334,11 @@ FX_BOOL CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) {
return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126);
}
-FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos)
+int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos)
{
- FX_INT32 count = 0;
- FX_INT32 len = msg.GetLength();
- FX_INT32 idx = startpos;
+ int32_t count = 0;
+ int32_t len = msg.GetLength();
+ int32_t idx = startpos;
if (idx < len) {
FX_WCHAR ch = msg.GetAt(idx);
while (isDigit(ch) && idx < len) {
@@ -351,13 +351,13 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideStri }
return count;
}
-FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos)
+int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos)
{
- FX_INT32 len = msg.GetLength();
- FX_INT32 idx = startpos;
+ int32_t len = msg.GetLength();
+ int32_t idx = startpos;
while (idx < len) {
FX_WCHAR ch = msg.GetAt(idx);
- FX_INT32 numericCount = 0;
+ int32_t numericCount = 0;
while (numericCount < 13 && isDigit(ch) && idx < len) {
numericCount++;
idx++;
@@ -379,16 +379,16 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideStrin }
return idx - startpos;
}
-FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e)
+int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, int32_t startpos, int32_t &e)
{
- FX_INT32 len = msg.GetLength();
- FX_INT32 idx = startpos;
+ int32_t len = msg.GetLength();
+ int32_t idx = startpos;
while (idx < len) {
FX_WCHAR ch = msg.GetAt(idx);
- FX_INT32 numericCount = 0;
+ int32_t numericCount = 0;
while (numericCount < 13 && isDigit(ch)) {
numericCount++;
- FX_INT32 i = idx + numericCount;
+ int32_t i = idx + numericCount;
if (i >= len) {
break;
}
@@ -397,10 +397,10 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideStr if (numericCount >= 13) {
return idx - startpos;
}
- FX_INT32 textCount = 0;
+ int32_t textCount = 0;
while (textCount < 5 && isText(ch)) {
textCount++;
- FX_INT32 i = idx + textCount;
+ int32_t i = idx + textCount;
if (i >= len) {
break;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h index 7c8801cb21..177507c4f5 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h @@ -12,36 +12,36 @@ class CBC_PDF417HighLevelEncoder
{
public:
- static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, FX_INT32 &e);
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, int32_t &e);
static void Inverse();
static void Initialize();
static void Finalize();
private:
- static FX_INT32 TEXT_COMPACTION;
- static FX_INT32 BYTE_COMPACTION;
- static FX_INT32 NUMERIC_COMPACTION;
- static FX_INT32 SUBMODE_PUNCTUATION;
- static FX_INT32 LATCH_TO_TEXT;
- static FX_INT32 LATCH_TO_BYTE_PADDED;
- static FX_INT32 LATCH_TO_NUMERIC;
- static FX_INT32 SHIFT_TO_BYTE;
- static FX_INT32 LATCH_TO_BYTE;
- static FX_BYTE TEXT_MIXED_RAW[];
- static FX_BYTE TEXT_PUNCTUATION_RAW[];
- static FX_INT32 MIXED[128];
- static FX_INT32 PUNCTUATION[128];
- static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode);
- static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb);
- static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb);
+ static int32_t TEXT_COMPACTION;
+ static int32_t BYTE_COMPACTION;
+ static int32_t NUMERIC_COMPACTION;
+ static int32_t SUBMODE_PUNCTUATION;
+ static int32_t LATCH_TO_TEXT;
+ static int32_t LATCH_TO_BYTE_PADDED;
+ static int32_t LATCH_TO_NUMERIC;
+ static int32_t SHIFT_TO_BYTE;
+ static int32_t LATCH_TO_BYTE;
+ static uint8_t TEXT_MIXED_RAW[];
+ static uint8_t TEXT_PUNCTUATION_RAW[];
+ static int32_t MIXED[128];
+ static int32_t PUNCTUATION[128];
+ static int32_t encodeText(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb, int32_t initialSubmode);
+ static void encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t count, int32_t startmode, CFX_WideString &sb);
+ static void encodeNumeric(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb);
static FX_BOOL isDigit(FX_WCHAR ch);
static FX_BOOL isAlphaUpper(FX_WCHAR ch);
static FX_BOOL isAlphaLower(FX_WCHAR ch);
static FX_BOOL isMixed(FX_WCHAR ch);
static FX_BOOL isPunctuation(FX_WCHAR ch);
static FX_BOOL isText(FX_WCHAR ch);
- static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos);
- static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos);
- static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e);
+ static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos);
+ static int32_t determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos);
+ static int32_t determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, int32_t startpos, int32_t &e);
friend class PDF417HighLevelEncoder_EncodeNumeric_Test;
friend class PDF417HighLevelEncoder_EncodeBinary_Test;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp index ed751cc4ba..a880317ee0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp @@ -57,16 +57,16 @@ CBC_PDF417Reader::CBC_PDF417Reader() CBC_PDF417Reader::~CBC_PDF417Reader()
{
}
-CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e)
+CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, int32_t &e)
{
return Decode(image, 0, e);
}
-CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, int32_t hints, int32_t &e)
{
CFX_ByteString results;
CBC_PDF417DetectorResult* detectorResult = CBC_Detector::detect(image, hints, multiple, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- for (FX_INT32 i = 0; i < detectorResult->getPoints()->GetSize(); i++) {
+ for (int32_t i = 0; i < detectorResult->getPoints()->GetSize(); i++) {
CFX_PtrArray* points = (CFX_PtrArray*)detectorResult->getPoints()->GetAt(i);
CBC_CommonDecoderResult* ResultTemp = CBC_PDF417ScanningDecoder::decode(detectorResult->getBits(), (CBC_ResultPoint*)points->GetAt(4), (CBC_ResultPoint*)points->GetAt(5),
(CBC_ResultPoint*)points->GetAt(6), (CBC_ResultPoint*)points->GetAt(7), getMinCodewordWidth(*points), getMaxCodewordWidth(*points), e);
@@ -81,39 +81,39 @@ CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multipl delete detectorResult;
return results;
}
-CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
CFX_ByteString bs = Decode(image, FALSE, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
return bs;
}
-FX_INT32 CBC_PDF417Reader::getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2)
+int32_t CBC_PDF417Reader::getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2)
{
if (p1 == NULL || p2 == NULL) {
return 0;
}
- return (FX_INT32) FXSYS_fabs(p1->GetX() - p2->GetX());
+ return (int32_t) FXSYS_fabs(p1->GetX() - p2->GetX());
}
-FX_INT32 CBC_PDF417Reader::getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2)
+int32_t CBC_PDF417Reader::getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2)
{
if (p1 == NULL || p2 == NULL) {
return Integer_MAX_VALUE;
}
- return (FX_INT32) FXSYS_fabs(p1->GetX() - p2->GetX());
+ return (int32_t) FXSYS_fabs(p1->GetX() - p2->GetX());
}
-FX_INT32 CBC_PDF417Reader::getMaxCodewordWidth(CFX_PtrArray& p)
+int32_t CBC_PDF417Reader::getMaxCodewordWidth(CFX_PtrArray& p)
{
- FX_INT32 a = getMaxWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
- FX_INT32 b = getMaxWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
- FX_INT32 c = getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a;
- FX_INT32 d = getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b;
+ int32_t a = getMaxWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
+ int32_t b = getMaxWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
+ int32_t c = getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a;
+ int32_t d = getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b;
return c < d ? c : d;
}
-FX_INT32 CBC_PDF417Reader::getMinCodewordWidth(CFX_PtrArray& p)
+int32_t CBC_PDF417Reader::getMinCodewordWidth(CFX_PtrArray& p)
{
- FX_INT32 a = getMinWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
- FX_INT32 b = getMinWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
- FX_INT32 c = getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a;
- FX_INT32 d = getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b;
+ int32_t a = getMinWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
+ int32_t b = getMinWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN;
+ int32_t c = getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a;
+ int32_t d = getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b;
return c < d ? c : d;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h index e6c0236cf7..031829d8e6 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h @@ -14,13 +14,13 @@ class CBC_PDF417Reader : public CBC_Reader public:
CBC_PDF417Reader();
virtual ~CBC_PDF417Reader();
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, FX_INT32 hints, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, int32_t hints, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e);
private:
- static FX_INT32 getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
- static FX_INT32 getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
- static FX_INT32 getMaxCodewordWidth(CFX_PtrArray& p);
- static FX_INT32 getMinCodewordWidth(CFX_PtrArray& p);
+ static int32_t getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
+ static int32_t getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
+ static int32_t getMaxCodewordWidth(CFX_PtrArray& p);
+ static int32_t getMinCodewordWidth(CFX_PtrArray& p);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp index 393ee2e75d..d99cefdb58 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp @@ -28,11 +28,11 @@ CBC_PDF417ResultMetadata::CBC_PDF417ResultMetadata() CBC_PDF417ResultMetadata::~CBC_PDF417ResultMetadata()
{
}
-FX_INT32 CBC_PDF417ResultMetadata::getSegmentIndex()
+int32_t CBC_PDF417ResultMetadata::getSegmentIndex()
{
return m_segmentIndex;
}
-void CBC_PDF417ResultMetadata::setSegmentIndex(FX_INT32 segmentIndex)
+void CBC_PDF417ResultMetadata::setSegmentIndex(int32_t segmentIndex)
{
m_segmentIndex = segmentIndex;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h index 7639c032ba..d635137e9d 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h @@ -11,8 +11,8 @@ class CBC_PDF417ResultMetadata public:
CBC_PDF417ResultMetadata();
virtual ~CBC_PDF417ResultMetadata();
- FX_INT32 getSegmentIndex();
- void setSegmentIndex(FX_INT32 segmentIndex);
+ int32_t getSegmentIndex();
+ void setSegmentIndex(int32_t segmentIndex);
CFX_ByteString getFileId();
void setFileId(CFX_ByteString fileId);
CFX_Int32Array& getOptionalData();
@@ -20,7 +20,7 @@ public: FX_BOOL isLastSegment();
void setLastSegment(FX_BOOL lastSegment);
private:
- FX_INT32 m_segmentIndex;
+ int32_t m_segmentIndex;
CFX_ByteString m_fileId;
CFX_Int32Array m_optionalData;
FX_BOOL m_lastSegment;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp index 2b127ceb07..de43e65144 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp @@ -40,9 +40,9 @@ #include "BC_PDF417ECErrorCorrection.h"
#include "BC_PDF417DecodedBitStreamParser.h"
#include "BC_PDF417ScanningDecoder.h"
-FX_INT32 CBC_PDF417ScanningDecoder::CODEWORD_SKEW_SIZE = 2;
-FX_INT32 CBC_PDF417ScanningDecoder::MAX_ERRORS = 3;
-FX_INT32 CBC_PDF417ScanningDecoder::MAX_EC_CODEWORDS = 512;
+int32_t CBC_PDF417ScanningDecoder::CODEWORD_SKEW_SIZE = 2;
+int32_t CBC_PDF417ScanningDecoder::MAX_ERRORS = 3;
+int32_t CBC_PDF417ScanningDecoder::MAX_EC_CODEWORDS = 512;
CBC_PDF417ECErrorCorrection* CBC_PDF417ScanningDecoder::errorCorrection = NULL;
CBC_PDF417ScanningDecoder::CBC_PDF417ScanningDecoder()
{
@@ -59,14 +59,14 @@ void CBC_PDF417ScanningDecoder::Finalize() delete errorCorrection;
}
CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* image, CBC_ResultPoint* imageTopLeft, CBC_ResultPoint* imageBottomLeft, CBC_ResultPoint* imageTopRight,
- CBC_ResultPoint* imageBottomRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth, FX_INT32 &e)
+ CBC_ResultPoint* imageBottomRight, int32_t minCodewordWidth, int32_t maxCodewordWidth, int32_t &e)
{
CBC_BoundingBox* boundingBox = FX_NEW CBC_BoundingBox(image, imageTopLeft, imageBottomLeft, imageTopRight, imageBottomRight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn = NULL;
CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn = NULL;
CBC_DetectionResult* detectionResult = NULL;
- for (FX_INT32 i = 0; i < 2; i++) {
+ for (int32_t i = 0; i < 2; i++) {
if (imageTopLeft != NULL) {
leftRowIndicatorColumn = getRowIndicatorColumn(image, boundingBox, *imageTopLeft, TRUE, minCodewordWidth, maxCodewordWidth);
}
@@ -89,12 +89,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* break;
}
}
- FX_INT32 maxBarcodeColumn = detectionResult->getBarcodeColumnCount() + 1;
+ int32_t maxBarcodeColumn = detectionResult->getBarcodeColumnCount() + 1;
detectionResult->setDetectionResultColumn(0, leftRowIndicatorColumn);
detectionResult->setDetectionResultColumn(maxBarcodeColumn, rightRowIndicatorColumn);
FX_BOOL leftToRight = leftRowIndicatorColumn != NULL;
- for (FX_INT32 barcodeColumnCount = 1; barcodeColumnCount <= maxBarcodeColumn; barcodeColumnCount++) {
- FX_INT32 barcodeColumn = leftToRight ? barcodeColumnCount : maxBarcodeColumn - barcodeColumnCount;
+ for (int32_t barcodeColumnCount = 1; barcodeColumnCount <= maxBarcodeColumn; barcodeColumnCount++) {
+ int32_t barcodeColumn = leftToRight ? barcodeColumnCount : maxBarcodeColumn - barcodeColumnCount;
if (detectionResult->getDetectionResultColumn(barcodeColumn) != NULL) {
continue;
}
@@ -105,9 +105,9 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* detectionResultColumn = FX_NEW CBC_DetectionResultColumn(boundingBox);
}
detectionResult->setDetectionResultColumn(barcodeColumn, detectionResultColumn);
- FX_INT32 startColumn = -1;
- FX_INT32 previousStartColumn = startColumn;
- for (FX_INT32 imageRow = boundingBox->getMinY(); imageRow <= boundingBox->getMaxY(); imageRow++) {
+ int32_t startColumn = -1;
+ int32_t previousStartColumn = startColumn;
+ for (int32_t imageRow = boundingBox->getMinY(); imageRow <= boundingBox->getMaxY(); imageRow++) {
startColumn = getStartColumn(detectionResult, barcodeColumn, imageRow, leftToRight);
if (startColumn < 0 || startColumn > boundingBox->getMaxX()) {
if (previousStartColumn == -1) {
@@ -134,9 +134,9 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* CFX_ByteString CBC_PDF417ScanningDecoder::toString(CFX_PtrArray* barcodeMatrix)
{
CFX_ByteString result;
- for (FX_INT32 row = 0; row < barcodeMatrix->GetSize(); row++) {
+ for (int32_t row = 0; row < barcodeMatrix->GetSize(); row++) {
result += row;
- FX_INT32 l = 0;
+ int32_t l = 0;
for (; l < ((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetSize(); l++) {
CBC_BarcodeValue* barcodeValue = (CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetAt(l);
if (barcodeValue->getValue()->GetSize() == 0) {
@@ -149,7 +149,7 @@ CFX_ByteString CBC_PDF417ScanningDecoder::toString(CFX_PtrArray* barcodeMatrix) }
return result;
}
-CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, FX_INT32 &e)
+CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, int32_t &e)
{
if (leftRowIndicatorColumn == NULL && rightRowIndicatorColumn == NULL) {
e = BCExceptionIllegalArgument;
@@ -178,45 +178,45 @@ CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndi CBC_DetectionResult* detectionresult = FX_NEW CBC_DetectionResult(barcodeMetadata, boundingBox);
return detectionresult;
}
-CBC_BoundingBox* CBC_PDF417ScanningDecoder::adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, FX_INT32 &e)
+CBC_BoundingBox* CBC_PDF417ScanningDecoder::adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, int32_t &e)
{
if (rowIndicatorColumn == NULL) {
return NULL;
}
CFX_Int32Array* rowHeights = rowIndicatorColumn->getRowHeights(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 maxRowHeight = getMax(*rowHeights);
- FX_INT32 missingStartRows = 0;
- for (FX_INT32 i = 0; i < rowHeights->GetSize(); i++) {
- FX_INT32 rowHeight = rowHeights->GetAt(i);
+ int32_t maxRowHeight = getMax(*rowHeights);
+ int32_t missingStartRows = 0;
+ for (int32_t i = 0; i < rowHeights->GetSize(); i++) {
+ int32_t rowHeight = rowHeights->GetAt(i);
missingStartRows += maxRowHeight - rowHeight;
if (rowHeight > 0) {
break;
}
}
CFX_PtrArray* codewords = rowIndicatorColumn->getCodewords();
- for (FX_INT32 row = 0; missingStartRows > 0 && codewords->GetAt(row) == NULL; row++) {
+ for (int32_t row = 0; missingStartRows > 0 && codewords->GetAt(row) == NULL; row++) {
missingStartRows--;
}
- FX_INT32 missingEndRows = 0;
- for (FX_INT32 row1 = rowHeights->GetSize() - 1; row1 >= 0; row1--) {
+ int32_t missingEndRows = 0;
+ for (int32_t row1 = rowHeights->GetSize() - 1; row1 >= 0; row1--) {
missingEndRows += maxRowHeight - rowHeights->GetAt(row1);
if (rowHeights->GetAt(row1) > 0) {
break;
}
}
- for (FX_INT32 row2 = codewords->GetSize() - 1; missingEndRows > 0 && codewords->GetAt(row2) == NULL; row2--) {
+ for (int32_t row2 = codewords->GetSize() - 1; missingEndRows > 0 && codewords->GetAt(row2) == NULL; row2--) {
missingEndRows--;
}
CBC_BoundingBox* boundingBox = rowIndicatorColumn->getBoundingBox()->addMissingRows(missingStartRows, missingEndRows, rowIndicatorColumn->isLeft(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return boundingBox;
}
-FX_INT32 CBC_PDF417ScanningDecoder::getMax(CFX_Int32Array& values)
+int32_t CBC_PDF417ScanningDecoder::getMax(CFX_Int32Array& values)
{
- FX_INT32 maxValue = -1;
- for (FX_INT32 i = 0; i < values.GetSize(); i++) {
- FX_INT32 value = values.GetAt(i);
+ int32_t maxValue = -1;
+ for (int32_t i = 0; i < values.GetSize(); i++) {
+ int32_t value = values.GetAt(i);
maxValue = maxValue > value ? maxValue : value;
}
return maxValue;
@@ -243,13 +243,13 @@ CBC_BarcodeMetadata* CBC_PDF417ScanningDecoder::getBarcodeMetadata(CBC_Detection return leftBarcodeMetadata;
}
CBC_DetectionResultRowIndicatorColumn* CBC_PDF417ScanningDecoder::getRowIndicatorColumn(CBC_CommonBitMatrix* image, CBC_BoundingBox* boundingBox, CBC_ResultPoint startPoint,
- FX_BOOL leftToRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth)
+ FX_BOOL leftToRight, int32_t minCodewordWidth, int32_t maxCodewordWidth)
{
CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn = FX_NEW CBC_DetectionResultRowIndicatorColumn(boundingBox, leftToRight);
- for (FX_INT32 i = 0; i < 2; i++) {
- FX_INT32 increment = i == 0 ? 1 : -1;
- FX_INT32 startColumn = (FX_INT32) startPoint.GetX();
- for (FX_INT32 imageRow = (FX_INT32) startPoint.GetY(); imageRow <= boundingBox->getMaxY() && imageRow >= boundingBox->getMinY(); imageRow += increment) {
+ for (int32_t i = 0; i < 2; i++) {
+ int32_t increment = i == 0 ? 1 : -1;
+ int32_t startColumn = (int32_t) startPoint.GetX();
+ for (int32_t imageRow = (int32_t) startPoint.GetY(); imageRow <= boundingBox->getMaxY() && imageRow >= boundingBox->getMinY(); imageRow += increment) {
CBC_Codeword* codeword = detectCodeword(image, 0, image->GetWidth(), leftToRight, startColumn, imageRow, minCodewordWidth, maxCodewordWidth);
if (codeword != NULL) {
rowIndicatorColumn->setCodeword(imageRow, codeword);
@@ -263,10 +263,10 @@ CBC_DetectionResultRowIndicatorColumn* CBC_PDF417ScanningDecoder::getRowIndicato }
return rowIndicatorColumn;
}
-void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, FX_INT32 &e)
+void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, int32_t &e)
{
CFX_Int32Array* numberOfCodewords = ((CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(0))->GetAt(1))->getValue();
- FX_INT32 calculatedNumberOfCodewords = detectionResult->getBarcodeColumnCount() * detectionResult->getBarcodeRowCount() - getNumberOfECCodeWords(detectionResult->getBarcodeECLevel());
+ int32_t calculatedNumberOfCodewords = detectionResult->getBarcodeColumnCount() * detectionResult->getBarcodeRowCount() - getNumberOfECCodeWords(detectionResult->getBarcodeECLevel());
if (numberOfCodewords->GetSize() == 0) {
if (calculatedNumberOfCodewords < 1 || calculatedNumberOfCodewords > CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE) {
e = BCExceptiontNotFoundInstance;
@@ -279,14 +279,14 @@ void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detecti }
delete numberOfCodewords;
}
-CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_DetectionResult* detectionResult, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_DetectionResult* detectionResult, int32_t &e)
{
CFX_PtrArray* barcodeMatrix = createBarcodeMatrix(detectionResult);
adjustCodewordCount(detectionResult, barcodeMatrix, e);
if (e != BCExceptionNO) {
- for (FX_INT32 i = 0; i < barcodeMatrix->GetSize(); i++) {
+ for (int32_t i = 0; i < barcodeMatrix->GetSize(); i++) {
CFX_PtrArray* temp = (CFX_PtrArray*)barcodeMatrix->GetAt(i);
- for (FX_INT32 j = 0; j < temp->GetSize(); j++) {
+ for (int32_t j = 0; j < temp->GetSize(); j++) {
delete (CBC_BarcodeValue*)temp->GetAt(j);
}
temp->RemoveAll();
@@ -301,10 +301,10 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete codewords.SetSize(detectionResult->getBarcodeRowCount() * detectionResult->getBarcodeColumnCount());
CFX_PtrArray ambiguousIndexValuesList;
CFX_Int32Array ambiguousIndexesList;
- for (FX_INT32 row = 0; row < detectionResult->getBarcodeRowCount(); row++) {
- for (FX_INT32 l = 0; l < detectionResult->getBarcodeColumnCount(); l++) {
+ for (int32_t row = 0; row < detectionResult->getBarcodeRowCount(); row++) {
+ for (int32_t l = 0; l < detectionResult->getBarcodeColumnCount(); l++) {
CFX_Int32Array* values = ((CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetAt(l + 1))->getValue();
- FX_INT32 codewordIndex = row * detectionResult->getBarcodeColumnCount() + l;
+ int32_t codewordIndex = row * detectionResult->getBarcodeColumnCount() + l;
if (values->GetSize() == 0) {
erasures.Add(codewordIndex);
} else if (values->GetSize() == 1) {
@@ -317,12 +317,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete }
CFX_PtrArray ambiguousIndexValues;
ambiguousIndexValues.SetSize(ambiguousIndexValuesList.GetSize());
- for (FX_INT32 i = 0; i < ambiguousIndexValues.GetSize(); i++) {
+ for (int32_t i = 0; i < ambiguousIndexValues.GetSize(); i++) {
ambiguousIndexValues.SetAt(i, ambiguousIndexValuesList.GetAt(i));
}
- for (FX_INT32 l = 0; l < barcodeMatrix->GetSize(); l++) {
+ for (int32_t l = 0; l < barcodeMatrix->GetSize(); l++) {
CFX_PtrArray* temp = (CFX_PtrArray*)barcodeMatrix->GetAt(l);
- for (FX_INT32 j = 0; j < temp->GetSize(); j++) {
+ for (int32_t j = 0; j < temp->GetSize(); j++) {
delete (CBC_BarcodeValue*)temp->GetAt(j);
}
temp->RemoveAll();
@@ -334,14 +334,14 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return decoderResult;
}
-CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbiguousValues(FX_INT32 ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes,
- CFX_PtrArray& ambiguousIndexValues, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbiguousValues(int32_t ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes,
+ CFX_PtrArray& ambiguousIndexValues, int32_t &e)
{
CFX_Int32Array ambiguousIndexCount;
ambiguousIndexCount.SetSize(ambiguousIndexes.GetSize());
- FX_INT32 tries = 100;
+ int32_t tries = 100;
while (tries-- > 0) {
- for (FX_INT32 l = 0; l < ambiguousIndexCount.GetSize(); l++) {
+ for (int32_t l = 0; l < ambiguousIndexCount.GetSize(); l++) {
codewords[ambiguousIndexes[l]] = ((CFX_Int32Array*)ambiguousIndexValues.GetAt(l))->GetAt(ambiguousIndexCount[l]);
}
CBC_CommonDecoderResult* decoderResult = decodeCodewords(codewords, ecLevel, erasureArray, e);
@@ -355,7 +355,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbig e = BCExceptionChecksumInstance;
return NULL;
}
- for (FX_INT32 i = 0; i < ambiguousIndexCount.GetSize(); i++) {
+ for (int32_t i = 0; i < ambiguousIndexCount.GetSize(); i++) {
if (ambiguousIndexCount[i] < ((CFX_Int32Array*)(ambiguousIndexValues.GetAt(i)))->GetSize() - 1) {
ambiguousIndexCount[i]++;
break;
@@ -376,8 +376,8 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult CFX_PtrArray* barcodeMatrix = FX_NEW CFX_PtrArray;
barcodeMatrix->SetSize(detectionResult->getBarcodeRowCount());
CFX_PtrArray* temp = NULL;
- FX_INT32 colume = 0;
- for (FX_INT32 row = 0; row < barcodeMatrix->GetSize(); row++) {
+ int32_t colume = 0;
+ for (int32_t row = 0; row < barcodeMatrix->GetSize(); row++) {
temp = FX_NEW CFX_PtrArray;
temp->SetSize(detectionResult->getBarcodeColumnCount() + 2);
for (colume = 0; colume < detectionResult->getBarcodeColumnCount() + 2; colume++) {
@@ -386,14 +386,14 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult barcodeMatrix->SetAt(row, temp);
}
colume = -1;
- for (FX_INT32 i = 0; i < detectionResult->getDetectionResultColumns().GetSize(); i++) {
+ for (int32_t i = 0; i < detectionResult->getDetectionResultColumns().GetSize(); i++) {
CBC_DetectionResultColumn* detectionResultColumn = (CBC_DetectionResultColumn*) detectionResult->getDetectionResultColumns().GetAt(i);
colume++;
if (detectionResultColumn == NULL) {
continue;
}
CFX_PtrArray* temp = detectionResultColumn->getCodewords();
- for (FX_INT32 l = 0; l < temp->GetSize(); l++) {
+ for (int32_t l = 0; l < temp->GetSize(); l++) {
CBC_Codeword* codeword = (CBC_Codeword*) temp->GetAt(l);
if (codeword == NULL || codeword->getRowNumber() == -1) {
continue;
@@ -403,13 +403,13 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult }
return barcodeMatrix;
}
-FX_BOOL CBC_PDF417ScanningDecoder::isValidBarcodeColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn)
+FX_BOOL CBC_PDF417ScanningDecoder::isValidBarcodeColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn)
{
return barcodeColumn >= 0 && barcodeColumn <= detectionResult->getBarcodeColumnCount() + 1;
}
-FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn, FX_INT32 imageRow, FX_BOOL leftToRight)
+int32_t CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn, int32_t imageRow, FX_BOOL leftToRight)
{
- FX_INT32 offset = leftToRight ? 1 : -1;
+ int32_t offset = leftToRight ? 1 : -1;
CBC_Codeword* codeword = NULL;
if (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) {
codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)->getCodeword(imageRow);
@@ -427,10 +427,10 @@ FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectio if (codeword != NULL) {
return leftToRight ? codeword->getEndX() : codeword->getStartX();
}
- FX_INT32 skippedColumns = 0;
+ int32_t skippedColumns = 0;
while (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) {
barcodeColumn -= offset;
- for (FX_INT32 i = 0; i < detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetSize(); i++) {
+ for (int32_t i = 0; i < detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetSize(); i++) {
CBC_Codeword* previousRowCodeword = (CBC_Codeword*) detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetAt(i);
if (previousRowCodeword != NULL) {
return (leftToRight ? previousRowCodeword->getEndX() : previousRowCodeword->getStartX()) +
@@ -441,42 +441,42 @@ FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectio }
return leftToRight ? detectionResult->getBoundingBox()->getMinX() : detectionResult->getBoundingBox()->getMaxX();
}
-CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn,
- FX_INT32 imageRow, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth)
+CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn,
+ int32_t imageRow, int32_t minCodewordWidth, int32_t maxCodewordWidth)
{
startColumn = adjustCodewordStartColumn(image, minColumn, maxColumn, leftToRight, startColumn, imageRow);
CFX_Int32Array* moduleBitCount = getModuleBitCount(image, minColumn, maxColumn, leftToRight, startColumn, imageRow);
if (moduleBitCount == NULL) {
return NULL;
}
- FX_INT32 endColumn;
- FX_INT32 codewordBitCount = CBC_PDF417Common::getBitCountSum(*moduleBitCount);
+ int32_t endColumn;
+ int32_t codewordBitCount = CBC_PDF417Common::getBitCountSum(*moduleBitCount);
if (leftToRight) {
endColumn = startColumn + codewordBitCount;
} else {
- for (FX_INT32 i = 0; i < moduleBitCount->GetSize() >> 1; i++) {
- FX_INT32 tmpCount = moduleBitCount->GetAt(i);
+ for (int32_t i = 0; i < moduleBitCount->GetSize() >> 1; i++) {
+ int32_t tmpCount = moduleBitCount->GetAt(i);
moduleBitCount->SetAt(i, moduleBitCount->GetAt(moduleBitCount->GetSize() - 1 - i));
moduleBitCount->SetAt(moduleBitCount->GetSize() - 1 - i, tmpCount);
}
endColumn = startColumn;
startColumn = endColumn - codewordBitCount;
}
- FX_INT32 decodedValue = CBC_PDF417CodewordDecoder::getDecodedValue(*moduleBitCount);
- FX_INT32 codeword = CBC_PDF417Common::getCodeword(decodedValue);
+ int32_t decodedValue = CBC_PDF417CodewordDecoder::getDecodedValue(*moduleBitCount);
+ int32_t codeword = CBC_PDF417Common::getCodeword(decodedValue);
delete moduleBitCount;
if (codeword == -1) {
return NULL;
}
return FX_NEW CBC_Codeword(startColumn, endColumn, getCodewordBucketNumber(decodedValue), codeword);
}
-CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, FX_INT32 imageRow)
+CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, int32_t imageRow)
{
- FX_INT32 imageColumn = startColumn;
+ int32_t imageColumn = startColumn;
CFX_Int32Array* moduleBitCount = FX_NEW CFX_Int32Array;
moduleBitCount->SetSize(8);
- FX_INT32 moduleNumber = 0;
- FX_INT32 increment = leftToRight ? 1 : -1;
+ int32_t moduleNumber = 0;
+ int32_t increment = leftToRight ? 1 : -1;
FX_BOOL previousPixelValue = leftToRight;
while (((leftToRight && imageColumn < maxColumn) || (!leftToRight && imageColumn >= minColumn)) && moduleNumber < moduleBitCount->GetSize()) {
if (image->Get(imageColumn, imageRow) == previousPixelValue) {
@@ -493,15 +493,15 @@ CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix delete moduleBitCount;
return NULL;
}
-FX_INT32 CBC_PDF417ScanningDecoder::getNumberOfECCodeWords(FX_INT32 barcodeECLevel)
+int32_t CBC_PDF417ScanningDecoder::getNumberOfECCodeWords(int32_t barcodeECLevel)
{
return 2 << barcodeECLevel;
}
-FX_INT32 CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 codewordStartColumn, FX_INT32 imageRow)
+int32_t CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t codewordStartColumn, int32_t imageRow)
{
- FX_INT32 correctedStartColumn = codewordStartColumn;
- FX_INT32 increment = leftToRight ? -1 : 1;
- for (FX_INT32 i = 0; i < 2; i++) {
+ int32_t correctedStartColumn = codewordStartColumn;
+ int32_t increment = leftToRight ? -1 : 1;
+ for (int32_t i = 0; i < 2; i++) {
FX_BOOL l = image->Get(correctedStartColumn, imageRow);
while (((leftToRight && correctedStartColumn >= minColumn) || (!leftToRight && correctedStartColumn < maxColumn)) && leftToRight == image->Get(correctedStartColumn, imageRow)) {
if (abs(codewordStartColumn - correctedStartColumn) > CODEWORD_SKEW_SIZE) {
@@ -514,18 +514,18 @@ FX_INT32 CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatri }
return correctedStartColumn;
}
-FX_BOOL CBC_PDF417ScanningDecoder::checkCodewordSkew(FX_INT32 codewordSize, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth)
+FX_BOOL CBC_PDF417ScanningDecoder::checkCodewordSkew(int32_t codewordSize, int32_t minCodewordWidth, int32_t maxCodewordWidth)
{
return minCodewordWidth - CODEWORD_SKEW_SIZE <= codewordSize && codewordSize <= maxCodewordWidth + CODEWORD_SKEW_SIZE;
}
-CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Array &codewords, FX_INT32 ecLevel, CFX_Int32Array &erasures, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Array &codewords, int32_t ecLevel, CFX_Int32Array &erasures, int32_t &e)
{
if (codewords.GetSize() == 0) {
e = BCExceptionFormatInstance;
return NULL;
}
- FX_INT32 numECCodewords = 1 << (ecLevel + 1);
- FX_INT32 correctedErrorsCount = correctErrors(codewords, erasures, numECCodewords, e);
+ int32_t numECCodewords = 1 << (ecLevel + 1);
+ int32_t correctedErrorsCount = correctErrors(codewords, erasures, numECCodewords, e);
BC_EXCEPTION_CHECK_ReturnValue(e , NULL);
verifyCodewordCount(codewords, numECCodewords, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -534,23 +534,23 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Arr BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return decoderResult;
}
-FX_INT32 CBC_PDF417ScanningDecoder::correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, FX_INT32 numECCodewords, FX_INT32 &e)
+int32_t CBC_PDF417ScanningDecoder::correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, int32_t numECCodewords, int32_t &e)
{
if ((erasures.GetSize() != 0 && erasures.GetSize() > (numECCodewords / 2 + MAX_ERRORS)) || numECCodewords < 0 || numECCodewords > MAX_EC_CODEWORDS) {
e = BCExceptionChecksumInstance;
return -1;
}
- FX_INT32 result = CBC_PDF417ECErrorCorrection::decode(codewords, numECCodewords, erasures, e);
+ int32_t result = CBC_PDF417ECErrorCorrection::decode(codewords, numECCodewords, erasures, e);
BC_EXCEPTION_CHECK_ReturnValue(e, -1);
return result;
}
-void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, FX_INT32 numECCodewords, FX_INT32 &e)
+void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, int32_t numECCodewords, int32_t &e)
{
if (codewords.GetSize() < 4) {
e = BCExceptionFormatInstance;
return;
}
- FX_INT32 numberOfCodewords = codewords.GetAt(0);
+ int32_t numberOfCodewords = codewords.GetAt(0);
if (numberOfCodewords > codewords.GetSize()) {
e = BCExceptionFormatInstance;
return;
@@ -564,12 +564,12 @@ void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, F }
}
}
-CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(FX_INT32 codeword)
+CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(int32_t codeword)
{
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
result->SetSize(8);
- FX_INT32 previousValue = 0;
- FX_INT32 i = result->GetSize() - 1;
+ int32_t previousValue = 0;
+ int32_t i = result->GetSize() - 1;
while (TRUE) {
if ((codeword & 0x1) != previousValue) {
previousValue = codeword & 0x1;
@@ -583,14 +583,14 @@ CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(FX_INT32 codew }
return result;
}
-FX_INT32 CBC_PDF417ScanningDecoder::getCodewordBucketNumber(FX_INT32 codeword)
+int32_t CBC_PDF417ScanningDecoder::getCodewordBucketNumber(int32_t codeword)
{
CFX_Int32Array* array = getBitCountForCodeword(codeword);
- FX_INT32 result = getCodewordBucketNumber(*array);
+ int32_t result = getCodewordBucketNumber(*array);
delete array;
return result;
}
-FX_INT32 CBC_PDF417ScanningDecoder::getCodewordBucketNumber(CFX_Int32Array& moduleBitCount)
+int32_t CBC_PDF417ScanningDecoder::getCodewordBucketNumber(CFX_Int32Array& moduleBitCount)
{
return (moduleBitCount.GetAt(0) - moduleBitCount.GetAt(2) + moduleBitCount.GetAt(4) - moduleBitCount.GetAt(6) + 9) % 9;
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h index 8cb5d2856c..1022288811 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h @@ -25,37 +25,37 @@ public: static void Initialize();
static void Finalize();
static CBC_CommonDecoderResult* decode(CBC_CommonBitMatrix* image, CBC_ResultPoint* imageTopLeft, CBC_ResultPoint* imageBottomLeft, CBC_ResultPoint* imageTopRight,
- CBC_ResultPoint* imageBottomRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth, FX_INT32 &e);
+ CBC_ResultPoint* imageBottomRight, int32_t minCodewordWidth, int32_t maxCodewordWidth, int32_t &e);
static CFX_ByteString toString(CFX_PtrArray* barcodeMatrix);
private:
- static FX_INT32 CODEWORD_SKEW_SIZE;
- static FX_INT32 MAX_ERRORS;
- static FX_INT32 MAX_EC_CODEWORDS;
+ static int32_t CODEWORD_SKEW_SIZE;
+ static int32_t MAX_ERRORS;
+ static int32_t MAX_EC_CODEWORDS;
static CBC_PDF417ECErrorCorrection* errorCorrection;
- static CBC_DetectionResult* merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, FX_INT32 &e);
- static CBC_BoundingBox* adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, FX_INT32 &e);
- static FX_INT32 getMax(CFX_Int32Array& values);
+ static CBC_DetectionResult* merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, int32_t &e);
+ static CBC_BoundingBox* adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, int32_t &e);
+ static int32_t getMax(CFX_Int32Array& values);
static CBC_BarcodeMetadata* getBarcodeMetadata(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn);
static CBC_DetectionResultRowIndicatorColumn* getRowIndicatorColumn(CBC_CommonBitMatrix* image, CBC_BoundingBox* boundingBox, CBC_ResultPoint startPoint,
- FX_BOOL leftToRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
- static void adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, FX_INT32 &e);
- static CBC_CommonDecoderResult* createDecoderResult(CBC_DetectionResult* detectionResult, FX_INT32 &e);
- static CBC_CommonDecoderResult* createDecoderResultFromAmbiguousValues(FX_INT32 ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes,
- CFX_PtrArray& ambiguousIndexValues, FX_INT32 &e);
+ FX_BOOL leftToRight, int32_t minCodewordWidth, int32_t maxCodewordWidth);
+ static void adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, int32_t &e);
+ static CBC_CommonDecoderResult* createDecoderResult(CBC_DetectionResult* detectionResult, int32_t &e);
+ static CBC_CommonDecoderResult* createDecoderResultFromAmbiguousValues(int32_t ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes,
+ CFX_PtrArray& ambiguousIndexValues, int32_t &e);
static CFX_PtrArray* createBarcodeMatrix(CBC_DetectionResult* detectionResult);
- static FX_BOOL isValidBarcodeColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn);
- static FX_INT32 getStartColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn, FX_INT32 imageRow, FX_BOOL leftToRight);
- static CBC_Codeword* detectCodeword(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn,
- FX_INT32 imageRow, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
- static CFX_Int32Array* getModuleBitCount(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, FX_INT32 imageRow);
- static FX_INT32 getNumberOfECCodeWords(FX_INT32 barcodeECLevel);
- static FX_INT32 adjustCodewordStartColumn(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 codewordStartColumn, FX_INT32 imageRow);
- static FX_BOOL checkCodewordSkew(FX_INT32 codewordSize, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
- static CBC_CommonDecoderResult* decodeCodewords(CFX_Int32Array &codewords, FX_INT32 ecLevel, CFX_Int32Array &erasures, FX_INT32 &e);
- static FX_INT32 correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, FX_INT32 numECCodewords, FX_INT32 &e);
- static void verifyCodewordCount(CFX_Int32Array &codewords, FX_INT32 numECCodewords, FX_INT32 &e);
- static CFX_Int32Array* getBitCountForCodeword(FX_INT32 codeword);
- static FX_INT32 getCodewordBucketNumber(FX_INT32 codeword);
- static FX_INT32 getCodewordBucketNumber(CFX_Int32Array& moduleBitCount);
+ static FX_BOOL isValidBarcodeColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn);
+ static int32_t getStartColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn, int32_t imageRow, FX_BOOL leftToRight);
+ static CBC_Codeword* detectCodeword(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn,
+ int32_t imageRow, int32_t minCodewordWidth, int32_t maxCodewordWidth);
+ static CFX_Int32Array* getModuleBitCount(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, int32_t imageRow);
+ static int32_t getNumberOfECCodeWords(int32_t barcodeECLevel);
+ static int32_t adjustCodewordStartColumn(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t codewordStartColumn, int32_t imageRow);
+ static FX_BOOL checkCodewordSkew(int32_t codewordSize, int32_t minCodewordWidth, int32_t maxCodewordWidth);
+ static CBC_CommonDecoderResult* decodeCodewords(CFX_Int32Array &codewords, int32_t ecLevel, CFX_Int32Array &erasures, int32_t &e);
+ static int32_t correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, int32_t numECCodewords, int32_t &e);
+ static void verifyCodewordCount(CFX_Int32Array &codewords, int32_t numECCodewords, int32_t &e);
+ static CFX_Int32Array* getBitCountForCodeword(int32_t codeword);
+ static int32_t getCodewordBucketNumber(int32_t codeword);
+ static int32_t getCodewordBucketNumber(CFX_Int32Array& moduleBitCount);
};
#endif
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp index 86951c91e9..5154b2e231 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -36,7 +36,7 @@ CBC_PDF417Writer::~CBC_PDF417Writer() {
m_bTruncated = TRUE;
}
-FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(FX_INT32 level)
+FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(int32_t level)
{
if (level < 0 || level > 8) {
return FALSE;
@@ -48,7 +48,7 @@ void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) {
m_bTruncated = truncated;
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
if ( format != BCFORMAT_PDF_417) {
return NULL;
@@ -56,15 +56,15 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT forma CFX_WideString encodeContents = contents.UTF8Decode();
return Encode(encodeContents, outWidth, outHeight, e );
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
return NULL;
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
CBC_PDF417 encoder;
- FX_INT32 col = (m_Width / m_ModuleWidth - 69) / 17;
- FX_INT32 row = m_Height / (m_ModuleWidth * 20);
+ int32_t col = (m_Width / m_ModuleWidth - 69) / 17;
+ int32_t row = m_Height / (m_ModuleWidth * 20);
if (row >= 3 && row <= 90 && col >= 1 && col <= 30) {
encoder.setDimensions(col, col, row, row);
} else if (col >= 1 && col <= 30) {
@@ -74,26 +74,26 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW }
encoder.generateBarcodeLogic(contents, m_iCorrectLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 lineThickness = 2;
- FX_INT32 aspectRatio = 4;
+ int32_t lineThickness = 2;
+ int32_t aspectRatio = 4;
CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix();
CFX_ByteArray originalScale;
originalScale.Copy(barcodeMatrix->getScaledMatrix(lineThickness, aspectRatio * lineThickness));
- FX_INT32 width = outWidth;
- FX_INT32 height = outHeight;
+ int32_t width = outWidth;
+ int32_t height = outHeight;
outWidth = barcodeMatrix->getWidth();
outHeight = barcodeMatrix->getHeight();
FX_BOOL rotated = FALSE;
if ((height > width) ^ (outWidth < outHeight)) {
rotateArray(originalScale, outHeight, outWidth);
rotated = TRUE;
- FX_INT32 temp = outHeight;
+ int32_t temp = outHeight;
outHeight = outWidth;
outWidth = temp;
}
- FX_INT32 scaleX = width / outWidth;
- FX_INT32 scaleY = height / outHeight;
- FX_INT32 scale;
+ int32_t scaleX = width / outWidth;
+ int32_t scaleY = height / outHeight;
+ int32_t scale;
if (scaleX < scaleY) {
scale = scaleX;
} else {
@@ -104,22 +104,22 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW originalScale.Copy(barcodeMatrix->getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness));
if (rotated) {
rotateArray(originalScale, outHeight, outWidth);
- FX_INT32 temp = outHeight;
+ int32_t temp = outHeight;
outHeight = outWidth;
outWidth = temp;
}
}
- FX_BYTE* result = (FX_BYTE*)FX_Alloc(FX_BYTE, outHeight * outWidth);
+ uint8_t* result = (uint8_t*)FX_Alloc(uint8_t, outHeight * outWidth);
FXSYS_memcpy32(result, originalScale.GetData(), outHeight * outWidth);
return result;
}
-void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, FX_INT32 height, FX_INT32 width)
+void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, int32_t height, int32_t width)
{
CFX_ByteArray temp;
temp.Copy(bitarray);
- for (FX_INT32 ii = 0; ii < height; ii++) {
- FX_INT32 inverseii = height - ii - 1;
- for (FX_INT32 jj = 0; jj < width; jj++) {
+ for (int32_t ii = 0; ii < height; ii++) {
+ int32_t inverseii = height - ii - 1;
+ for (int32_t jj = 0; jj < width; jj++) {
bitarray[jj * height + inverseii] = temp[ii * width + jj];
}
}
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h index 5d974f9377..e44959f4ff 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h @@ -13,14 +13,14 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter public:
CBC_PDF417Writer();
virtual ~CBC_PDF417Writer();
- FX_BYTE * Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ uint8_t * Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BOOL SetErrorCorrectionLevel(FX_INT32 level);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ FX_BOOL SetErrorCorrectionLevel(int32_t level);
void SetTruncated(FX_BOOL truncated);
private:
- void rotateArray(CFX_ByteArray& bitarray, FX_INT32 width, FX_INT32 height);
+ void rotateArray(CFX_ByteArray& bitarray, int32_t width, int32_t height);
FX_BOOL m_bTruncated;
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp index 669a0fbf7e..fa75cd8995 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp @@ -26,10 +26,10 @@ #include "BC_QRAlignmentPattern.h"
#include "BC_QRAlignmentPatternFinder.h"
CBC_QRAlignmentPatternFinder::CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image,
- FX_INT32 startX,
- FX_INT32 startY,
- FX_INT32 width,
- FX_INT32 height,
+ int32_t startX,
+ int32_t startY,
+ int32_t width,
+ int32_t height,
FX_FLOAT moduleSize): m_image(image),
m_startX(startX),
m_startY(startY),
@@ -42,29 +42,29 @@ CBC_QRAlignmentPatternFinder::CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix * }
CBC_QRAlignmentPatternFinder::~CBC_QRAlignmentPatternFinder()
{
- for (FX_INT32 i = 0; i < m_possibleCenters.GetSize(); i++) {
+ for (int32_t i = 0; i < m_possibleCenters.GetSize(); i++) {
delete (CBC_QRAlignmentPattern*)m_possibleCenters[i];
}
m_possibleCenters.RemoveAll();
}
-CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(FX_INT32 &e)
+CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(int32_t &e)
{
- FX_INT32 startX = m_startX;
- FX_INT32 height = m_height;
- FX_INT32 maxJ = startX + m_width;
- FX_INT32 middleI = m_startY + (height >> 1);
+ int32_t startX = m_startX;
+ int32_t height = m_height;
+ int32_t maxJ = startX + m_width;
+ int32_t middleI = m_startY + (height >> 1);
CFX_Int32Array stateCount;
stateCount.SetSize(3);
- for (FX_INT32 iGen = 0; iGen < height; iGen++) {
- FX_INT32 i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));
+ for (int32_t iGen = 0; iGen < height; iGen++) {
+ int32_t i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));
stateCount[0] = 0;
stateCount[1] = 0;
stateCount[2] = 0;
- FX_INT32 j = startX;
+ int32_t j = startX;
while (j < maxJ && !m_image->Get(j, i)) {
j++;
}
- FX_INT32 currentState = 0;
+ int32_t currentState = 0;
while (j < maxJ) {
if (m_image->Get(j, i)) {
if (currentState == 1) {
@@ -107,7 +107,7 @@ CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return NULL;
}
-FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end)
+FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end)
{
return (FX_FLOAT) (end - stateCount[2]) - stateCount[1] / 2.0f;
}
@@ -115,23 +115,23 @@ FX_BOOL CBC_QRAlignmentPatternFinder::FoundPatternCross(const CFX_Int32Array &st {
FX_FLOAT moduleSize = m_moduleSize;
FX_FLOAT maxVariance = moduleSize / 2.0f;
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
if (fabs(moduleSize - stateCount[i]) >= maxVariance) {
return false;
}
}
return TRUE;
}
-FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal)
+FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount, int32_t originalStateCountTotal)
{
CBC_CommonBitMatrix *image = m_image;
- FX_INT32 maxI = m_image->GetHeight();
+ int32_t maxI = m_image->GetHeight();
CFX_Int32Array stateCount;
stateCount.Copy(m_crossCheckStateCount);
stateCount[0] = 0;
stateCount[1] = 0;
stateCount[2] = 0;
- FX_INT32 i = startI;
+ int32_t i = startI;
while (i >= 0 && m_image->Get(centerJ, i) && stateCount[1] <= maxCount) {
stateCount[1]++;
i--;
@@ -161,21 +161,21 @@ FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_IN if (stateCount[2] > maxCount) {
return FXSYS_nan();
}
- FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
+ int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
if (5 * abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) {
return FXSYS_nan();
}
return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, i) : FXSYS_nan();
}
-CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j)
+CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j)
{
- FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
+ int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
FX_FLOAT centerJ = CenterFromEnd(stateCount, j);
- FX_FLOAT centerI = CrossCheckVertical(i, (FX_INT32) centerJ, 2 * stateCount[1], stateCountTotal);
+ FX_FLOAT centerI = CrossCheckVertical(i, (int32_t) centerJ, 2 * stateCount[1], stateCountTotal);
if (!FXSYS_isnan(centerI)) {
FX_FLOAT estimatedModuleSize = (FX_FLOAT) (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f;
- FX_INT32 max = m_possibleCenters.GetSize();
- for (FX_INT32 index = 0; index < max; index++) {
+ int32_t max = m_possibleCenters.GetSize();
+ for (int32_t index = 0; index < max; index++) {
CBC_QRAlignmentPattern *center = (CBC_QRAlignmentPattern *)(m_possibleCenters[index]);
if (center->AboutEquals(estimatedModuleSize, centerI, centerJ)) {
return FX_NEW CBC_QRAlignmentPattern(centerJ, centerI, estimatedModuleSize);
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h index c1d224a8eb..b16517ede2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h @@ -13,19 +13,19 @@ class CBC_QRAlignmentPatternFinder private:
CBC_CommonBitMatrix *m_image;
CFX_PtrArray m_possibleCenters;
- FX_INT32 m_startX;
- FX_INT32 m_startY;
- FX_INT32 m_width;
- FX_INT32 m_height;
+ int32_t m_startX;
+ int32_t m_startY;
+ int32_t m_width;
+ int32_t m_height;
FX_FLOAT m_moduleSize;
CFX_Int32Array m_crossCheckStateCount;
public:
- CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, FX_INT32 startX, FX_INT32 startY, FX_INT32 width, FX_INT32 height, FX_FLOAT moduleSize);
+ CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, int32_t startX, int32_t startY, int32_t width, int32_t height, FX_FLOAT moduleSize);
virtual ~CBC_QRAlignmentPatternFinder();
FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount);
- FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 startJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal);
- CBC_QRAlignmentPattern* Find(FX_INT32 &e);
- CBC_QRAlignmentPattern *HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j);
- static FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end);
+ FX_FLOAT CrossCheckVertical(int32_t startI, int32_t startJ, int32_t maxCount, int32_t originalStateCountTotal);
+ CBC_QRAlignmentPattern* Find(int32_t &e);
+ CBC_QRAlignmentPattern *HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j);
+ static FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp index 7c85c58367..ba5662bb4e 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp @@ -29,7 +29,7 @@ CBC_QRBitMatrixParser::CBC_QRBitMatrixParser()
{
}
-void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e)
+void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e)
{
m_dimension = bitMatrix->GetDimension(e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -50,34 +50,34 @@ CBC_QRBitMatrixParser::~CBC_QRBitMatrixParser() }
m_version = NULL;
}
-CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(FX_INT32 &e)
+CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(int32_t &e)
{
if(m_parsedFormatInfo != NULL) {
return m_parsedFormatInfo;
}
- FX_INT32 formatInfoBits = 0;
- FX_INT32 j;
+ int32_t formatInfoBits = 0;
+ int32_t j;
for( j = 0; j < 6; j++) {
formatInfoBits = CopyBit(8, j, formatInfoBits);
}
formatInfoBits = CopyBit(8, 7, formatInfoBits);
formatInfoBits = CopyBit(8, 8, formatInfoBits);
formatInfoBits = CopyBit(7, 8, formatInfoBits);
- for(FX_INT32 i = 5; i >= 0; i--) {
+ for(int32_t i = 5; i >= 0; i--) {
formatInfoBits = CopyBit(i, 8, formatInfoBits);
}
m_parsedFormatInfo = CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
if(m_parsedFormatInfo != NULL) {
return m_parsedFormatInfo;
}
- FX_INT32 dimension = m_bitMatrix->GetDimension(e);
+ int32_t dimension = m_bitMatrix->GetDimension(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
formatInfoBits = 0;
- FX_INT32 iMin = dimension - 8;
+ int32_t iMin = dimension - 8;
for(j = dimension - 1; j >= iMin; j--) {
formatInfoBits = CopyBit(j, 8, formatInfoBits);
}
- for(FX_INT32 k = dimension - 7; k < dimension; k++) {
+ for(int32_t k = dimension - 7; k < dimension; k++) {
formatInfoBits = CopyBit(8, k , formatInfoBits);
}
m_parsedFormatInfo = CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
@@ -88,23 +88,23 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(FX_IN BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return NULL;
}
-CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e)
+CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t &e)
{
if(m_version != NULL) {
return m_version;
}
- FX_INT32 dimension = m_bitMatrix->GetDimension(e);
+ int32_t dimension = m_bitMatrix->GetDimension(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 provisionVersion = (dimension - 17) >> 2;
+ int32_t provisionVersion = (dimension - 17) >> 2;
if(provisionVersion <= 6) {
CBC_QRCoderVersion* qrv = CBC_QRCoderVersion::GetVersionForNumber(provisionVersion, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return qrv;
}
- FX_INT32 versionBits = 0;
- for (FX_INT32 i = 5; i >= 0; i--) {
- FX_INT32 jMin = dimension - 11;
- for (FX_INT32 j = dimension - 9; j >= jMin; j--) {
+ int32_t versionBits = 0;
+ for (int32_t i = 5; i >= 0; i--) {
+ int32_t jMin = dimension - 11;
+ for (int32_t j = dimension - 9; j >= jMin; j--) {
versionBits = CopyBit(i, j, versionBits);
}
}
@@ -114,9 +114,9 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e) return m_version;
}
versionBits = 0;
- for (FX_INT32 j = 5; j >= 0; j--) {
- FX_INT32 iMin = dimension - 11;
- for (FX_INT32 i = dimension - 9; i >= iMin; i--) {
+ for (int32_t j = 5; j >= 0; j--) {
+ int32_t iMin = dimension - 11;
+ for (int32_t i = dimension - 9; i >= iMin; i--) {
versionBits = CopyBit(i, j, versionBits);
}
}
@@ -129,19 +129,19 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return NULL;
}
-FX_INT32 CBC_QRBitMatrixParser::CopyBit(FX_INT32 i, FX_INT32 j, FX_INT32 versionBits)
+int32_t CBC_QRBitMatrixParser::CopyBit(int32_t i, int32_t j, int32_t versionBits)
{
return m_bitMatrix->Get(j, i) ? (versionBits << 1) | 0x1 : versionBits << 1;
}
-CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e)
+CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(int32_t &e)
{
CBC_QRCoderFormatInformation *formatInfo = ReadFormatInformation(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL)
CBC_QRCoderVersion *version = ReadVersion(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- CBC_QRDataMask *dataMask = CBC_QRDataMask::ForReference((FX_INT32)(formatInfo->GetDataMask()), e);
+ CBC_QRDataMask *dataMask = CBC_QRDataMask::ForReference((int32_t)(formatInfo->GetDataMask()), e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 dimension = m_bitMatrix->GetDimension(e);
+ int32_t dimension = m_bitMatrix->GetDimension(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
dataMask->UnmaskBitMatirx(m_bitMatrix, dimension);
CBC_CommonBitMatrix* cbm = version->BuildFunctionPattern(e);
@@ -151,16 +151,16 @@ CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e) CFX_ByteArray * temp = FX_NEW CFX_ByteArray;
temp->SetSize(version->GetTotalCodeWords());
CBC_AutoPtr<CFX_ByteArray> result(temp);
- FX_INT32 resultOffset = 0;
- FX_INT32 currentByte = 0;
- FX_INT32 bitsRead = 0;
- for(FX_INT32 j = dimension - 1; j > 0; j -= 2) {
+ int32_t resultOffset = 0;
+ int32_t currentByte = 0;
+ int32_t bitsRead = 0;
+ for(int32_t j = dimension - 1; j > 0; j -= 2) {
if(j == 6) {
j--;
}
- for(FX_INT32 count = 0; count < dimension; count++) {
- FX_INT32 i = readingUp ? dimension - 1 - count : count;
- for(FX_INT32 col = 0; col < 2; col++) {
+ for(int32_t count = 0; count < dimension; count++) {
+ int32_t i = readingUp ? dimension - 1 - count : count;
+ for(int32_t col = 0; col < 2; col++) {
if(!functionPattern->Get(j - col, i)) {
bitsRead++;
currentByte <<= 1;
@@ -168,7 +168,7 @@ CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e) currentByte |= 1;
}
if(bitsRead == 8) {
- (*result)[resultOffset++] = (FX_BYTE) currentByte;
+ (*result)[resultOffset++] = (uint8_t) currentByte;
bitsRead = 0;
currentByte = 0;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h index 0189ba7c81..6f378fff95 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h @@ -17,14 +17,14 @@ private: CBC_CommonBitMatrix *m_tempBitMatrix;
CBC_QRCoderVersion *m_version;
CBC_QRCoderFormatInformation *m_parsedFormatInfo;
- FX_INT32 m_dimension;
+ int32_t m_dimension;
public:
CBC_QRBitMatrixParser();
virtual ~CBC_QRBitMatrixParser();
- CBC_QRCoderFormatInformation *ReadFormatInformation(FX_INT32 &e);
- CBC_QRCoderVersion *ReadVersion(FX_INT32 &e);
- FX_INT32 CopyBit(FX_INT32 i, FX_INT32 j, FX_INT32 versionBits);
- CFX_ByteArray *ReadCodewords(FX_INT32 &e);
- virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+ CBC_QRCoderFormatInformation *ReadFormatInformation(int32_t &e);
+ CBC_QRCoderVersion *ReadVersion(int32_t &e);
+ int32_t CopyBit(int32_t i, int32_t j, int32_t versionBits);
+ CFX_ByteArray *ReadCodewords(int32_t &e);
+ virtual void Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp index f12c4e0ad3..ab28f3434d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp @@ -55,7 +55,7 @@ CBC_QRCodeReader::~CBC_QRCodeReader() }
m_decoder = NULL;
}
-CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e)
+CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e)
{
CBC_CommonBitMatrix *matrix = image->GetMatrix(e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -68,7 +68,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, CBC_AutoPtr<CBC_CommonDecoderResult> decodeResult(qdr2);
return (decodeResult->GetText());
}
-CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e)
+CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, int32_t hints, int32_t byteModeDecode, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(filename);
source.Init(e);
@@ -79,7 +79,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, "");
return bs;
}
-CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e)
+CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, int32_t hints, int32_t byteModeDecode, int32_t &e)
{
CBC_BufferedImageLuminanceSource source(pBitmap);
CBC_GlobalHistogramBinarizer binarizer(&source);
@@ -88,7 +88,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, F BC_EXCEPTION_CHECK_ReturnValue(e, "");
return bs;
}
-CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e)
+CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, int32_t &e)
{
CFX_ByteString bs = Decode(image, 0, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h index 71a1ad3dd6..73b83d390e 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h @@ -25,11 +25,11 @@ private: public:
CBC_QRCodeReader();
virtual ~CBC_QRCodeReader();
- CFX_ByteString Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e);
- CFX_ByteString Decode(const CFX_WideString &filename, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e);
+ CFX_ByteString Decode(CFX_DIBitmap *pBitmap, int32_t hints, int32_t byteModeDecode, int32_t &e);
+ CFX_ByteString Decode(const CFX_WideString &filename, int32_t hints, int32_t byteModeDecode, int32_t &e);
static void ReleaseAll();
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
- CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e);
virtual void Init();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp index ccc0220d6c..37d0277bec 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp @@ -42,7 +42,7 @@ void CBC_QRCodeWriter::ReleaseAll() {
CBC_QRCodeReader::ReleaseAll();
}
-FX_BOOL CBC_QRCodeWriter::SetVersion(FX_INT32 version)
+FX_BOOL CBC_QRCodeWriter::SetVersion(int32_t version)
{
if (version < 0 || version > 40) {
return FALSE;
@@ -50,7 +50,7 @@ FX_BOOL CBC_QRCodeWriter::SetVersion(FX_INT32 version) m_iVersion = version;
return TRUE;
}
-FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(FX_INT32 level)
+FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level)
{
if (level < 0 || level > 3) {
return FALSE;
@@ -58,7 +58,7 @@ FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(FX_INT32 level) m_iCorrectLevel = level;
return TRUE;
}
-FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
CBC_QRCoderErrorCorrectionLevel *ec = NULL;
switch(ecLevel) {
@@ -89,15 +89,15 @@ FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, FX_INT32 ecLev BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
outWidth = qr.GetMatrixWidth();
outHeight = qr.GetMatrixWidth();
- FX_BYTE* result = FX_Alloc(FX_BYTE, outWidth * outWidth);
+ uint8_t* result = FX_Alloc(uint8_t, outWidth * outWidth);
FXSYS_memcpy32(result, qr.GetMatrix()->GetArray(), outWidth * outHeight);
return result;
}
-FX_BYTE *CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t *CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
return NULL;
}
-FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
return NULL;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h index bf0ca71996..7cfd978c47 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h @@ -15,14 +15,14 @@ class CBC_QRCodeWriter : public CBC_TwoDimWriter public:
CBC_QRCodeWriter();
virtual ~CBC_QRCodeWriter();
- FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
- FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
- FX_BOOL SetVersion(FX_INT32 version);
- FX_BOOL SetErrorCorrectionLevel(FX_INT32 level);
+ uint8_t* Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e);
+ uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e);
+ FX_BOOL SetVersion(int32_t version);
+ FX_BOOL SetErrorCorrectionLevel(int32_t level);
static void ReleaseAll();
private:
- FX_INT32 m_iVersion;
+ int32_t m_iVersion;
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp index f650f83b48..1f642016e2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp @@ -62,31 +62,31 @@ CBC_QRCoderErrorCorrectionLevel* CBC_QRCoder::GetECLevel() {
return m_ecLevel;
}
-FX_INT32 CBC_QRCoder::GetVersion()
+int32_t CBC_QRCoder::GetVersion()
{
return m_version;
}
-FX_INT32 CBC_QRCoder::GetMatrixWidth()
+int32_t CBC_QRCoder::GetMatrixWidth()
{
return m_matrixWidth;
}
-FX_INT32 CBC_QRCoder::GetMaskPattern()
+int32_t CBC_QRCoder::GetMaskPattern()
{
return m_maskPattern;
}
-FX_INT32 CBC_QRCoder::GetNumTotalBytes()
+int32_t CBC_QRCoder::GetNumTotalBytes()
{
return m_numTotalBytes;
}
-FX_INT32 CBC_QRCoder::GetNumDataBytes()
+int32_t CBC_QRCoder::GetNumDataBytes()
{
return m_numDataBytes;
}
-FX_INT32 CBC_QRCoder::GetNumECBytes()
+int32_t CBC_QRCoder::GetNumECBytes()
{
return m_numECBytes;
}
-FX_INT32 CBC_QRCoder::GetNumRSBlocks()
+int32_t CBC_QRCoder::GetNumRSBlocks()
{
return m_numRSBlocks;
}
@@ -94,9 +94,9 @@ CBC_CommonByteMatrix* CBC_QRCoder::GetMatrix() {
return m_matrix;
}
-FX_INT32 CBC_QRCoder::At(FX_INT32 x, FX_INT32 y, FX_INT32 &e)
+int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t &e)
{
- FX_INT32 value = m_matrix->Get(x, y);
+ int32_t value = m_matrix->Get(x, y);
if(!(value == 0 || value == 1)) {
e = BCExceptionValueMustBeEither0or1;
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
@@ -129,35 +129,35 @@ void CBC_QRCoder::SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel) {
m_ecLevel = ecLevel;
}
-void CBC_QRCoder::SetVersion(FX_INT32 version)
+void CBC_QRCoder::SetVersion(int32_t version)
{
m_version = version;
}
-void CBC_QRCoder::SetMatrixWidth(FX_INT32 width)
+void CBC_QRCoder::SetMatrixWidth(int32_t width)
{
m_matrixWidth = width;
}
-void CBC_QRCoder::SetMaskPattern(FX_INT32 pattern)
+void CBC_QRCoder::SetMaskPattern(int32_t pattern)
{
m_maskPattern = pattern;
}
-void CBC_QRCoder::SetNumDataBytes(FX_INT32 bytes)
+void CBC_QRCoder::SetNumDataBytes(int32_t bytes)
{
m_numDataBytes = bytes;
}
-void CBC_QRCoder::SetNumTotalBytes(FX_INT32 value)
+void CBC_QRCoder::SetNumTotalBytes(int32_t value)
{
m_numTotalBytes = value;
}
-void CBC_QRCoder::SetNumRSBlocks(FX_INT32 block)
+void CBC_QRCoder::SetNumRSBlocks(int32_t block)
{
m_numRSBlocks = block;
}
-void CBC_QRCoder::SetNumECBytes(FX_INT32 value)
+void CBC_QRCoder::SetNumECBytes(int32_t value)
{
m_numECBytes = value;
}
-FX_BOOL CBC_QRCoder::IsValidMaskPattern(FX_INT32 maskPattern)
+FX_BOOL CBC_QRCoder::IsValidMaskPattern(int32_t maskPattern)
{
return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS;
}
@@ -165,4 +165,4 @@ void CBC_QRCoder::SetMatrix(CBC_CommonByteMatrix* value) {
m_matrix = value;
}
-const FX_INT32 CBC_QRCoder::NUM_MASK_PATTERNS = 8;
+const int32_t CBC_QRCoder::NUM_MASK_PATTERNS = 8;
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoder.h index 3c24dc2bc9..72db2fe487 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.h @@ -15,41 +15,41 @@ class CBC_QRCoder private:
CBC_QRCoderMode* m_mode;
CBC_QRCoderErrorCorrectionLevel* m_ecLevel;
- FX_INT32 m_version;
- FX_INT32 m_matrixWidth;
- FX_INT32 m_maskPattern;
- FX_INT32 m_numTotalBytes;
- FX_INT32 m_numDataBytes;
- FX_INT32 m_numECBytes;
- FX_INT32 m_numRSBlocks;
+ int32_t m_version;
+ int32_t m_matrixWidth;
+ int32_t m_maskPattern;
+ int32_t m_numTotalBytes;
+ int32_t m_numDataBytes;
+ int32_t m_numECBytes;
+ int32_t m_numRSBlocks;
CBC_CommonByteMatrix* m_matrix;
public:
- const static FX_INT32 NUM_MASK_PATTERNS;
+ const static int32_t NUM_MASK_PATTERNS;
CBC_QRCoder();
virtual ~CBC_QRCoder();
CBC_QRCoderMode* GetMode();
CBC_QRCoderErrorCorrectionLevel* GetECLevel();
- FX_INT32 GetVersion();
- FX_INT32 GetMatrixWidth();
- FX_INT32 GetMaskPattern();
- FX_INT32 GetNumTotalBytes();
- FX_INT32 GetNumDataBytes();
- FX_INT32 GetNumECBytes();
- FX_INT32 GetNumRSBlocks();
+ int32_t GetVersion();
+ int32_t GetMatrixWidth();
+ int32_t GetMaskPattern();
+ int32_t GetNumTotalBytes();
+ int32_t GetNumDataBytes();
+ int32_t GetNumECBytes();
+ int32_t GetNumRSBlocks();
CBC_CommonByteMatrix* GetMatrix();
- FX_INT32 At(FX_INT32 x, FX_INT32 y, FX_INT32 &e);
+ int32_t At(int32_t x, int32_t y, int32_t &e);
FX_BOOL IsValid();
void SetMode(CBC_QRCoderMode* value);
void SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel);
- void SetVersion(FX_INT32 version);
- void SetMatrixWidth(FX_INT32 width);
- void SetMaskPattern(FX_INT32 pattern);
- void SetNumDataBytes(FX_INT32 bytes);
- void SetNumTotalBytes(FX_INT32 value);
- void SetNumECBytes(FX_INT32 value);
- void SetNumRSBlocks(FX_INT32 block);
+ void SetVersion(int32_t version);
+ void SetMatrixWidth(int32_t width);
+ void SetMaskPattern(int32_t pattern);
+ void SetNumDataBytes(int32_t bytes);
+ void SetNumTotalBytes(int32_t value);
+ void SetNumECBytes(int32_t value);
+ void SetNumRSBlocks(int32_t block);
void SetMatrix(CBC_CommonByteMatrix* value);
- static FX_BOOL IsValidMaskPattern(FX_INT32 maskPattern);
+ static FX_BOOL IsValidMaskPattern(int32_t maskPattern);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp index b7a0a1c3a7..53a5e487a4 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp @@ -29,7 +29,7 @@ CBC_QRCoderBitVector::CBC_QRCoderBitVector() }
void CBC_QRCoderBitVector::Init()
{
- m_array = FX_Alloc(FX_BYTE, m_size);
+ m_array = FX_Alloc(uint8_t, m_size);
}
CBC_QRCoderBitVector::~CBC_QRCoderBitVector()
{
@@ -47,32 +47,32 @@ void CBC_QRCoderBitVector::Clear() }
m_sizeInBits = 0;
m_size = 32;
- m_array = FX_Alloc(FX_BYTE, m_size);
+ m_array = FX_Alloc(uint8_t, m_size);
}
-FX_INT32 CBC_QRCoderBitVector::At(FX_INT32 index, FX_INT32 &e)
+int32_t CBC_QRCoderBitVector::At(int32_t index, int32_t &e)
{
if(index < 0 || index >= m_sizeInBits) {
e = BCExceptionBadIndexException;
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
}
- FX_INT32 value = m_array[index >> 3] & 0xff;
+ int32_t value = m_array[index >> 3] & 0xff;
return (value >> (7 - (index & 0x7))) & 1;
}
-FX_INT32 CBC_QRCoderBitVector::sizeInBytes()
+int32_t CBC_QRCoderBitVector::sizeInBytes()
{
return (m_sizeInBits + 7) >> 3;
}
-FX_INT32 CBC_QRCoderBitVector::Size()
+int32_t CBC_QRCoderBitVector::Size()
{
return m_sizeInBits;
}
-void CBC_QRCoderBitVector::AppendBit(FX_INT32 bit, FX_INT32 &e)
+void CBC_QRCoderBitVector::AppendBit(int32_t bit, int32_t &e)
{
if(!(bit == 0 || bit == 1)) {
e = BCExceptionBadValueException;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 numBitsInLastByte = m_sizeInBits & 0x7;
+ int32_t numBitsInLastByte = m_sizeInBits & 0x7;
if(numBitsInLastByte == 0) {
AppendByte(0);
m_sizeInBits -= 8;
@@ -80,55 +80,55 @@ void CBC_QRCoderBitVector::AppendBit(FX_INT32 bit, FX_INT32 &e) m_array[m_sizeInBits >> 3] |= (bit << (7 - numBitsInLastByte));
++m_sizeInBits;
}
-void CBC_QRCoderBitVector::AppendBits(FX_INT32 value, FX_INT32 numBits, FX_INT32 &e)
+void CBC_QRCoderBitVector::AppendBits(int32_t value, int32_t numBits, int32_t &e)
{
if (numBits < 0 || numBits > 32) {
e = BCExceptionBadNumBitsException;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 numBitsLeft = numBits;
+ int32_t numBitsLeft = numBits;
while (numBitsLeft > 0) {
if ((m_sizeInBits & 0x7) == 0 && numBitsLeft >= 8) {
- FX_INT32 newByte = (value >> (numBitsLeft - 8)) & 0xff;
+ int32_t newByte = (value >> (numBitsLeft - 8)) & 0xff;
AppendByte(newByte);
numBitsLeft -= 8;
} else {
- FX_INT32 bit = (value >> (numBitsLeft - 1)) & 1;
+ int32_t bit = (value >> (numBitsLeft - 1)) & 1;
AppendBit(bit, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
--numBitsLeft;
}
}
}
-void CBC_QRCoderBitVector::AppendBitVector(CBC_QRCoderBitVector *bits, FX_INT32 &e)
+void CBC_QRCoderBitVector::AppendBitVector(CBC_QRCoderBitVector *bits, int32_t &e)
{
- FX_INT32 size = bits->Size();
- for(FX_INT32 i = 0; i < size; i++) {
- FX_INT32 num = bits->At(i, e);
+ int32_t size = bits->Size();
+ for(int32_t i = 0; i < size; i++) {
+ int32_t num = bits->At(i, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
AppendBit(num, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
}
}
-void CBC_QRCoderBitVector::XOR(CBC_QRCoderBitVector *other, FX_INT32 &e)
+void CBC_QRCoderBitVector::XOR(CBC_QRCoderBitVector *other, int32_t &e)
{
if(m_sizeInBits != other->Size()) {
e = BCExceptioncanNotOperatexorOperator;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 sizeInBytes = (m_sizeInBits + 7) >> 3;
- for(FX_INT32 i = 0; i < sizeInBytes; ++i) {
+ int32_t sizeInBytes = (m_sizeInBits + 7) >> 3;
+ for(int32_t i = 0; i < sizeInBytes; ++i) {
m_array[i] ^= (other->GetArray())[i];
}
}
-FX_BYTE* CBC_QRCoderBitVector::GetArray()
+uint8_t* CBC_QRCoderBitVector::GetArray()
{
return m_array;
}
-void CBC_QRCoderBitVector::AppendByte(FX_INT32 value)
+void CBC_QRCoderBitVector::AppendByte(int32_t value)
{
if((m_sizeInBits >> 3) == m_size) {
- FX_BYTE* newArray = FX_Alloc(FX_BYTE, m_size << 1);
+ uint8_t* newArray = FX_Alloc(uint8_t, m_size << 1);
FXSYS_memcpy32(newArray, m_array, m_size);
if(m_array != NULL) {
FX_Free(m_array);
@@ -136,6 +136,6 @@ void CBC_QRCoderBitVector::AppendByte(FX_INT32 value) m_array = newArray;
m_size = m_size << 1;
}
- m_array[m_sizeInBits >> 3] = (FX_BYTE) value;
+ m_array[m_sizeInBits >> 3] = (uint8_t) value;
m_sizeInBits += 8;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h index ae73fe8c88..49549ba0d2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h @@ -9,22 +9,22 @@ class CBC_QRCoderBitVector
{
private:
- FX_INT32 m_sizeInBits;
- FX_BYTE *m_array;
- FX_INT32 m_size;
+ int32_t m_sizeInBits;
+ uint8_t *m_array;
+ int32_t m_size;
- void AppendByte(FX_INT32 value);
+ void AppendByte(int32_t value);
public:
CBC_QRCoderBitVector();
virtual ~CBC_QRCoderBitVector();
- FX_INT32 At(FX_INT32 index, FX_INT32 &e);
- FX_INT32 Size();
- FX_INT32 sizeInBytes();
- void AppendBit(FX_INT32 bit, FX_INT32 &e);
- void AppendBits(FX_INT32 value, FX_INT32 numBits, FX_INT32 &e);
- void AppendBitVector(CBC_QRCoderBitVector *bits, FX_INT32 &e);
- void XOR(CBC_QRCoderBitVector *other, FX_INT32 &e);
- FX_BYTE* GetArray();
+ int32_t At(int32_t index, int32_t &e);
+ int32_t Size();
+ int32_t sizeInBytes();
+ void AppendBit(int32_t bit, int32_t &e);
+ void AppendBits(int32_t value, int32_t numBits, int32_t &e);
+ void AppendBitVector(CBC_QRCoderBitVector *bits, int32_t &e);
+ void XOR(CBC_QRCoderBitVector *other, int32_t &e);
+ uint8_t* GetArray();
void Clear();
virtual void Init();
};
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp index 6f16db6ad8..e866873d24 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp @@ -47,12 +47,12 @@ CBC_QRCoderDecoder::~CBC_QRCoderDecoder() }
m_rsDecoder = NULL;
}
-CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, FX_INT32 width, FX_INT32 height, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, int32_t width, int32_t height, int32_t &e)
{
CBC_CommonBitMatrix bits;
bits.Init(width);
- for(FX_INT32 i = 0; i < width; i++) {
- for(FX_INT32 j = 0; j < height; j++) {
+ for(int32_t i = 0; i < width; i++) {
+ for(int32_t j = 0; j < height; j++) {
if(image[i * width + j]) {
bits.Set(j, i);
}
@@ -62,7 +62,7 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, FX_INT32 wid BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return cdr;
}
-CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, FX_INT32 byteModeDecode, FX_INT32 &e)
+CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, int32_t byteModeDecode, int32_t &e)
{
CBC_QRBitMatrixParser parser;
parser.Init(bits, e);
@@ -77,19 +77,19 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F CBC_AutoPtr<CFX_ByteArray > codewords(ba);
CFX_PtrArray *dataBlocks = CBC_QRDataBlock::GetDataBlocks(codewords.get(), version, ecLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 totalBytes = 0;
- for (FX_INT32 i = 0; i < dataBlocks->GetSize(); i++) {
+ int32_t totalBytes = 0;
+ for (int32_t i = 0; i < dataBlocks->GetSize(); i++) {
totalBytes += ((CBC_QRDataBlock*) ((*dataBlocks)[i]))->GetNumDataCodewords();
}
CFX_ByteArray resultBytes;
- FX_INT32 resultOffset = 0;
- for (FX_INT32 j = 0; j < dataBlocks->GetSize(); j++) {
+ int32_t resultOffset = 0;
+ for (int32_t j = 0; j < dataBlocks->GetSize(); j++) {
CBC_QRDataBlock *dataBlock = (CBC_QRDataBlock *)((*dataBlocks)[j]);
CFX_ByteArray* codewordBytes = dataBlock->GetCodewords();
- FX_INT32 numDataCodewords = dataBlock->GetNumDataCodewords();
+ int32_t numDataCodewords = dataBlock->GetNumDataCodewords();
CorrectErrors(codewordBytes, numDataCodewords, e);
if (e != BCExceptionNO) {
- for(FX_INT32 k = 0; k < dataBlocks->GetSize(); k++) {
+ for(int32_t k = 0; k < dataBlocks->GetSize(); k++) {
delete (CBC_QRDataBlock*)(*dataBlocks)[k];
}
dataBlocks->RemoveAll();
@@ -97,11 +97,11 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F dataBlocks = NULL;
return NULL;
}
- for(FX_INT32 i = 0; i < numDataCodewords; i++) {
+ for(int32_t i = 0; i < numDataCodewords; i++) {
resultBytes.Add((*codewordBytes)[i]);
}
}
- for(FX_INT32 k = 0; k < dataBlocks->GetSize(); k++) {
+ for(int32_t k = 0; k < dataBlocks->GetSize(); k++) {
delete (CBC_QRDataBlock*)(*dataBlocks)[k] ;
}
dataBlocks->RemoveAll();
@@ -111,18 +111,18 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return cdr;
}
-void CBC_QRCoderDecoder::CorrectErrors(CFX_ByteArray* codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e)
+void CBC_QRCoderDecoder::CorrectErrors(CFX_ByteArray* codewordBytes, int32_t numDataCodewords, int32_t &e)
{
- FX_INT32 numCodewords = codewordBytes->GetSize();
+ int32_t numCodewords = codewordBytes->GetSize();
CFX_Int32Array codewordsInts;
codewordsInts.SetSize(numCodewords);
- for(FX_INT32 i = 0; i < numCodewords; i++) {
- codewordsInts[i] = (FX_INT32)((*codewordBytes)[i] & 0xff);
+ for(int32_t i = 0; i < numCodewords; i++) {
+ codewordsInts[i] = (int32_t)((*codewordBytes)[i] & 0xff);
}
- FX_INT32 numECCodewords = codewordBytes->GetSize() - numDataCodewords;
+ int32_t numECCodewords = codewordBytes->GetSize() - numDataCodewords;
m_rsDecoder->Decode(&codewordsInts, numECCodewords, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- for(FX_INT32 k = 0; k < numDataCodewords; k++) {
- (*codewordBytes)[k] = (FX_BYTE) codewordsInts[k];
+ for(int32_t k = 0; k < numDataCodewords; k++) {
+ (*codewordBytes)[k] = (uint8_t) codewordsInts[k];
}
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h index 00238544c3..7747c7ba5b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h @@ -20,9 +20,9 @@ public: CBC_QRCoderDecoder();
virtual ~CBC_QRCoderDecoder();
- CBC_CommonDecoderResult* Decode(FX_BOOL* image, FX_INT32 width, FX_INT32 height, FX_INT32 &e);
- CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, FX_INT32 byteModeDecode, FX_INT32 &e);
- void CorrectErrors(CFX_ByteArray* codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e);
+ CBC_CommonDecoderResult* Decode(FX_BOOL* image, int32_t width, int32_t height, int32_t &e);
+ CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, int32_t byteModeDecode, int32_t &e);
+ void CorrectErrors(CFX_ByteArray* codewordBytes, int32_t numDataCodewords, int32_t &e);
virtual void Init();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp index a475cecb37..7dfef9356d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp @@ -22,7 +22,7 @@ #include "../barcode.h"
#include "BC_QRCoderECB.h"
-CBC_QRCoderECB::CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords)
+CBC_QRCoderECB::CBC_QRCoderECB(int32_t count, int32_t dataCodeWords)
{
m_dataCodeWords = dataCodeWords;
m_count = count;
@@ -30,11 +30,11 @@ CBC_QRCoderECB::CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords) CBC_QRCoderECB::~CBC_QRCoderECB()
{
}
-FX_INT32 CBC_QRCoderECB::GetCount()
+int32_t CBC_QRCoderECB::GetCount()
{
return m_count;
}
-FX_INT32 CBC_QRCoderECB::GetDataCodeWords()
+int32_t CBC_QRCoderECB::GetDataCodeWords()
{
return m_dataCodeWords;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h index e8c2d36999..5a9c25bd53 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h @@ -9,12 +9,12 @@ class CBC_QRCoderECB
{
private:
- FX_INT32 m_count;
- FX_INT32 m_dataCodeWords;
+ int32_t m_count;
+ int32_t m_dataCodeWords;
public:
- CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords);
+ CBC_QRCoderECB(int32_t count, int32_t dataCodeWords);
virtual ~CBC_QRCoderECB();
- FX_INT32 GetCount();
- FX_INT32 GetDataCodeWords();
+ int32_t GetCount();
+ int32_t GetDataCodeWords();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp index 22485fe733..3c40cfd34b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp @@ -23,12 +23,12 @@ #include "../barcode.h"
#include "BC_QRCoderECB.h"
#include "BC_QRCoderECBlocks.h"
-CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks)
+CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks)
{
m_ecCodeWordsPerBlock = ecCodeWordsPerBlock;
m_ecBlocks.Add(ecBlocks);
}
-CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock,
+CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock,
CBC_QRCoderECB* ecBlocks1,
CBC_QRCoderECB* ecBlocks2)
{
@@ -38,24 +38,24 @@ CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, }
CBC_QRCoderECBlocks::~CBC_QRCoderECBlocks()
{
- for (FX_INT32 i = 0 ; i < m_ecBlocks.GetSize(); i++) {
+ for (int32_t i = 0 ; i < m_ecBlocks.GetSize(); i++) {
delete ( (CBC_QRCoderECB*)(m_ecBlocks[i]) ) ;
}
m_ecBlocks.RemoveAll();
}
-FX_INT32 CBC_QRCoderECBlocks::GetECCodeWordsPerBlock()
+int32_t CBC_QRCoderECBlocks::GetECCodeWordsPerBlock()
{
return m_ecCodeWordsPerBlock;
}
-FX_INT32 CBC_QRCoderECBlocks::GetNumBlocks()
+int32_t CBC_QRCoderECBlocks::GetNumBlocks()
{
- FX_INT32 total = 0;
- for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) {
+ int32_t total = 0;
+ for(int32_t i = 0; i < m_ecBlocks.GetSize(); i++) {
total += ( (CBC_QRCoderECB*)(m_ecBlocks[i]) )->GetCount();
}
return total;
}
-FX_INT32 CBC_QRCoderECBlocks::GetTotalECCodeWords()
+int32_t CBC_QRCoderECBlocks::GetTotalECCodeWords()
{
return m_ecCodeWordsPerBlock * GetNumBlocks();
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h index 7f229742ab..8a962e1627 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h @@ -10,15 +10,15 @@ class CBC_QRCoderECB; class CBC_QRCoderECBlocks
{
private:
- FX_INT32 m_ecCodeWordsPerBlock;
+ int32_t m_ecCodeWordsPerBlock;
CFX_PtrArray m_ecBlocks;
public:
- CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks);
- CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2);
+ CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks);
+ CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2);
virtual ~CBC_QRCoderECBlocks();
- FX_INT32 GetECCodeWordsPerBlock();
- FX_INT32 GetNumBlocks();
- FX_INT32 GetTotalECCodeWords();
+ int32_t GetECCodeWordsPerBlock();
+ int32_t GetNumBlocks();
+ int32_t GetTotalECCodeWords();
CFX_PtrArray* GetECBlocks();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 3f6a644f0f..2ec490f109 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -36,7 +36,7 @@ #include "BC_QRCoderMaskUtil.h"
#include "BC_QRCoderMatrixUtil.h"
#include "BC_QRCoderBitVector.h"
-const FX_INT32 CBC_QRCoderEncoder::m_alphaNumbericTable[] = {
+const int32_t CBC_QRCoderEncoder::m_alphaNumbericTable[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43,
@@ -71,7 +71,7 @@ public: ~Make_Pair() {}
};
void CBC_QRCoderEncoder::Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- CBC_QRCoder *qrCode, FX_INT32 &e, FX_INT32 versionSpecify)
+ CBC_QRCoder *qrCode, int32_t &e, int32_t versionSpecify)
{
if(versionSpecify == 0) {
EncodeWithAutoVersion(content, ecLevel, qrCode, e);
@@ -88,9 +88,9 @@ void CBC_QRCoderEncoder::AppendECI(CBC_QRCoderBitVector* bits) {
}
void CBC_QRCoderEncoder::AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits,
- CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, FX_INT32 &e)
+ CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, int32_t &e)
{
- for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) {
+ for(int32_t i = 0; i < splitResult.GetSize(); i++) {
tempMode = ((Make_Pair*)splitResult[i])->m_mode;
if(tempMode == CBC_QRCoderMode::sGBK) {
AppendModeInfo(tempMode, &headerAndDataBits, e);
@@ -130,9 +130,9 @@ void CBC_QRCoderEncoder::AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_ }
void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray &result)
{
- FX_INT32 index = 0, flag = 0;
- while((((FX_BYTE)content[index] >= 0xA1 && (FX_BYTE)content[index] <= 0xAA) ||
- ((FX_BYTE)content[index] >= 0xB0 && (FX_BYTE)content[index] <= 0xFA)) && (index < content.GetLength())) {
+ int32_t index = 0, flag = 0;
+ while((((uint8_t)content[index] >= 0xA1 && (uint8_t)content[index] <= 0xAA) ||
+ ((uint8_t)content[index] >= 0xB0 && (uint8_t)content[index] <= 0xFA)) && (index < content.GetLength())) {
index += 2;
}
if(index != flag) {
@@ -142,14 +142,14 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) {
return;
}
- while(GetAlphaNumericCode((FX_BYTE)content[index]) == -1
- && !(((FX_BYTE)content[index] >= 0xA1 && (FX_BYTE)content[index] <= 0xAA) ||
- ((FX_BYTE)content[index] >= 0xB0 && (FX_BYTE)content[index] <= 0xFA))
+ while(GetAlphaNumericCode((uint8_t)content[index]) == -1
+ && !(((uint8_t)content[index] >= 0xA1 && (uint8_t)content[index] <= 0xAA) ||
+ ((uint8_t)content[index] >= 0xB0 && (uint8_t)content[index] <= 0xFA))
&& (index < content.GetLength())) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if(IsDBCSLeadByte((FX_BYTE)content[index]))
+ if(IsDBCSLeadByte((uint8_t)content[index]))
#else
- if((FX_BYTE)content[index] > 127)
+ if((uint8_t)content[index] > 127)
#endif
{
index += 2;
@@ -164,7 +164,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) {
return;
}
- while(FXSYS_Isdigit((FX_BYTE)content[index]) && (index < content.GetLength())) {
+ while(FXSYS_Isdigit((uint8_t)content[index]) && (index < content.GetLength())) {
index++;
}
if(index != flag) {
@@ -174,7 +174,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) {
return;
}
- while(GetAlphaNumericCode((FX_BYTE)content[index]) != -1 && (index < content.GetLength())) {
+ while(GetAlphaNumericCode((uint8_t)content[index]) != -1 && (index < content.GetLength())) {
index++;
}
if(index != flag) {
@@ -186,7 +186,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray }
SplitString(content.Mid(index, content.GetLength() - index), result);
}
-FX_INT32 CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, FX_INT32 versionNum, FX_INT32 &e)
+int32_t CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, int32_t versionNum, int32_t &e)
{
if(versionNum == 0) {
return 0;
@@ -230,17 +230,17 @@ FX_INT32 CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QR }
return -1;
}
-void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, FX_INT32 &e)
+void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, int32_t versionNum, int32_t &e)
{
Make_Pair *first = NULL;
Make_Pair *second = NULL;
size_t mergeNum = 0;
- FX_INT32 i;
+ int32_t i;
for(i = 0; ((i < result.GetSize()) && (i + 1 < result.GetSize())); i++) {
first = (Make_Pair*)result[i];
second = (Make_Pair*)result[i + 1];
if(first->m_mode == CBC_QRCoderMode::sALPHANUMERIC) {
- FX_INT32 tmp = GetSpanByVersion(CBC_QRCoderMode::sALPHANUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e);
+ int32_t tmp = GetSpanByVersion(CBC_QRCoderMode::sALPHANUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if((second->m_mode == CBC_QRCoderMode::sBYTE)
&& (first->m_string.GetLength() < tmp)) {
@@ -260,7 +260,7 @@ void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, mergeNum++;
}
} else if(first->m_mode == CBC_QRCoderMode::sNUMERIC) {
- FX_INT32 tmp = GetSpanByVersion(CBC_QRCoderMode::sNUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e);
+ int32_t tmp = GetSpanByVersion(CBC_QRCoderMode::sNUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if((second->m_mode == CBC_QRCoderMode::sBYTE)
&& (first->m_string.GetLength() < tmp)) {
@@ -290,18 +290,18 @@ void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, MergeString(result, versionNum, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumber,
- CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e)
+void CBC_QRCoderEncoder::InitQRCode(int32_t numInputBytes, int32_t versionNumber,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e)
{
qrCode->SetECLevel(ecLevel);
qrCode->SetMode(mode);
CBC_QRCoderVersion* version = CBC_QRCoderVersion::GetVersionForNumber(versionNumber, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 numBytes = version->GetTotalCodeWords();
+ int32_t numBytes = version->GetTotalCodeWords();
CBC_QRCoderECBlocks* ecBlocks = version->GetECBlocksForLevel(ecLevel);
- FX_INT32 numEcBytes = ecBlocks->GetTotalECCodeWords();
- FX_INT32 numRSBlocks = ecBlocks->GetNumBlocks();
- FX_INT32 numDataBytes = numBytes - numEcBytes;
+ int32_t numEcBytes = ecBlocks->GetTotalECCodeWords();
+ int32_t numRSBlocks = ecBlocks->GetNumBlocks();
+ int32_t numDataBytes = numBytes - numEcBytes;
if(numDataBytes >= numInputBytes + 3) {
qrCode->SetVersion(versionNumber);
qrCode->SetNumTotalBytes(numBytes);
@@ -315,7 +315,7 @@ void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumb BC_EXCEPTION_CHECK_ReturnVoid(e);
}
void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- CBC_QRCoder *qrCode, FX_INT32 versionSpecify, FX_INT32 &e)
+ CBC_QRCoder *qrCode, int32_t versionSpecify, int32_t &e)
{
CFX_ByteString encoding = "utf8";
CBC_QRCoderMode *mode = CBC_QRCoderMode::sBYTE;
@@ -326,22 +326,22 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, MergeString(splitResult, versionSpecify, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
CBC_QRCoderMode *tempMode = NULL;
- for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) {
+ for(int32_t i = 0; i < splitResult.GetSize(); i++) {
AppendBytes(((Make_Pair*)splitResult[i])->m_string, ((Make_Pair*)splitResult[i])->m_mode, &dataBits, encoding, e);
if(e != BCExceptionNO) {
- for(FX_INT32 y = 0; y < splitResult.GetSize(); y++) {
+ for(int32_t y = 0; y < splitResult.GetSize(); y++) {
delete (Make_Pair*)splitResult[y];
}
splitResult.RemoveAll();
return;
}
}
- FX_INT32 numInputBytes = dataBits.sizeInBytes();
+ int32_t numInputBytes = dataBits.sizeInBytes();
CBC_QRCoderBitVector headerAndDataBits;
headerAndDataBits.Init();
InitQRCode(numInputBytes, versionSpecify, ecLevel, mode, qrCode, e);
if(e != BCExceptionNO) {
- for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) {
+ for(int32_t k = 0; k < splitResult.GetSize(); k++) {
delete (Make_Pair*)splitResult[k];
}
splitResult.RemoveAll();
@@ -349,7 +349,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, }
AppendDataModeLenghInfo(splitResult, headerAndDataBits, tempMode, qrCode, encoding, e);
if(e != BCExceptionNO) {
- for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) {
+ for(int32_t k = 0; k < splitResult.GetSize(); k++) {
delete (Make_Pair*)splitResult[k];
}
splitResult.RemoveAll();
@@ -358,13 +358,13 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, numInputBytes = headerAndDataBits.sizeInBytes();
TerminateBits(qrCode->GetNumDataBytes(), &headerAndDataBits, e);
if(e != BCExceptionNO) {
- for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) {
+ for(int32_t k = 0; k < splitResult.GetSize(); k++) {
delete (Make_Pair*)splitResult[k];
}
splitResult.RemoveAll();
return ;
}
- for(FX_INT32 j = 0; j < splitResult.GetSize(); j++) {
+ for(int32_t j = 0; j < splitResult.GetSize(); j++) {
delete (Make_Pair*)splitResult[j];
}
splitResult.RemoveAll();
@@ -376,7 +376,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth());
pDecoder->Init();
CBC_AutoPtr<CBC_CommonByteMatrix> matrix(pDecoder);
- FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
+ int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
qrCode->SetMaskPattern(maskPattern);
CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e);
@@ -387,7 +387,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e)
+void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e)
{
CFX_ByteString encoding = "utf8";
CBC_QRCoderMode *mode = CBC_QRCoderMode::sBYTE;
@@ -398,23 +398,23 @@ void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CB MergeString(splitResult, 8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
CBC_QRCoderMode *tempMode = NULL;
- for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) {
+ for(int32_t i = 0; i < splitResult.GetSize(); i++) {
AppendBytes(((Make_Pair*)splitResult[i])->m_string, ((Make_Pair*)splitResult[i])->m_mode, &dataBits, encoding, e);
if(e != BCExceptionNO) {
- for(FX_INT32 l = 0; l < splitResult.GetSize(); l++) {
+ for(int32_t l = 0; l < splitResult.GetSize(); l++) {
delete (Make_Pair*)splitResult[l];
}
splitResult.RemoveAll();
return;
}
}
- FX_INT32 numInputBytes = dataBits.sizeInBytes();
+ int32_t numInputBytes = dataBits.sizeInBytes();
InitQRCode(numInputBytes, ecLevel, mode, qrCode, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
CBC_QRCoderBitVector headerAndDataBits;
headerAndDataBits.Init();
tempMode = NULL;
- FX_INT32 versionNum = qrCode->GetVersion();
+ int32_t versionNum = qrCode->GetVersion();
sign:
AppendDataModeLenghInfo(splitResult, headerAndDataBits, tempMode, qrCode, encoding, e);
if (e != BCExceptionNO) {
@@ -427,7 +427,7 @@ sign: }
catchException:
if (e != BCExceptionNO) {
- FX_INT32 e1 = BCExceptionNO;
+ int32_t e1 = BCExceptionNO;
InitQRCode(numInputBytes, ecLevel, mode, qrCode, e1);
if (e1 != BCExceptionNO) {
e = e1;
@@ -439,14 +439,14 @@ catchException: e = BCExceptionNO;
goto sign;
} else {
- for (FX_INT32 j = 0; j < splitResult.GetSize(); j++) {
+ for (int32_t j = 0; j < splitResult.GetSize(); j++) {
delete (Make_Pair*)splitResult[j];
}
splitResult.RemoveAll();
return;
}
}
- for (FX_INT32 k = 0; k < splitResult.GetSize(); k++) {
+ for (int32_t k = 0; k < splitResult.GetSize(); k++) {
delete (Make_Pair*)splitResult[k];
}
splitResult.RemoveAll();
@@ -458,7 +458,7 @@ catchException: CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth());
pDecoder->Init();
CBC_AutoPtr<CBC_CommonByteMatrix> matrix(pDecoder);
- FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
+ int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
qrCode->SetMaskPattern(maskPattern);
CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e);
@@ -469,7 +469,7 @@ catchException: BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e)
+void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e)
{
CFX_ByteString encoding = "utf8";
CFX_ByteString utf8Data;
@@ -479,14 +479,14 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC dataBits.Init();
AppendBytes(utf8Data, mode, &dataBits, encoding, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 numInputBytes = dataBits.sizeInBytes();
+ int32_t numInputBytes = dataBits.sizeInBytes();
InitQRCode(numInputBytes, ecLevel, mode, qrCode, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
CBC_QRCoderBitVector headerAndDataBits;
headerAndDataBits.Init();
AppendModeInfo(mode, &headerAndDataBits, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 numLetters = mode == CBC_QRCoderMode::sBYTE ? dataBits.sizeInBytes() : content.GetLength();
+ int32_t numLetters = mode == CBC_QRCoderMode::sBYTE ? dataBits.sizeInBytes() : content.GetLength();
AppendLengthInfo(numLetters, qrCode->GetVersion(), mode, &headerAndDataBits, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
headerAndDataBits.AppendBitVector(&dataBits, e);
@@ -501,7 +501,7 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth());
pDecoder->Init();
CBC_AutoPtr<CBC_CommonByteMatrix> matrix(pDecoder);
- FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
+ int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
qrCode->SetMaskPattern(maskPattern);
CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e);
@@ -512,21 +512,21 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::TerminateBits(int32_t numDataBytes, CBC_QRCoderBitVector* bits, int32_t &e)
{
- FX_INT32 capacity = numDataBytes << 3;
+ int32_t capacity = numDataBytes << 3;
if(bits->Size() > capacity) {
e = BCExceptionDataTooMany;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for (FX_INT32 i = 0; i < 4 && bits->Size() < capacity; ++i) {
+ for (int32_t i = 0; i < 4 && bits->Size() < capacity; ++i) {
bits->AppendBit(0, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 numBitsInLastByte = bits->Size() % 8;
+ int32_t numBitsInLastByte = bits->Size() % 8;
if (numBitsInLastByte > 0) {
- FX_INT32 numPaddingBits = 8 - numBitsInLastByte;
- for (FX_INT32 j = 0; j < numPaddingBits; ++j) {
+ int32_t numPaddingBits = 8 - numBitsInLastByte;
+ for (int32_t j = 0; j < numPaddingBits; ++j) {
bits->AppendBit(0, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
}
@@ -535,8 +535,8 @@ void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVect e = BCExceptionDigitLengthMustBe8;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 numPaddingBytes = numDataBytes - bits->sizeInBytes();
- for (FX_INT32 k = 0; k < numPaddingBytes; ++k) {
+ int32_t numPaddingBytes = numDataBytes - bits->sizeInBytes();
+ for (int32_t k = 0; k < numPaddingBytes; ++k) {
if (k % 2 == 0) {
bits->AppendBits(0xec, 8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -550,14 +550,14 @@ void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVect BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-FX_INT32 CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+int32_t CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e)
{
- FX_INT32 minPenalty = 65535;
- FX_INT32 bestMaskPattern = -1;
- for(FX_INT32 maskPattern = 0; maskPattern < CBC_QRCoder::NUM_MASK_PATTERNS; maskPattern++) {
+ int32_t minPenalty = 65535;
+ int32_t bestMaskPattern = -1;
+ for(int32_t maskPattern = 0; maskPattern < CBC_QRCoder::NUM_MASK_PATTERNS; maskPattern++) {
CBC_QRCoderMatrixUtil::BuildMatrix(bits, ecLevel, version, maskPattern, matrix, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
- FX_INT32 penalty = CalculateMaskPenalty(matrix);
+ int32_t penalty = CalculateMaskPenalty(matrix);
if(penalty < minPenalty) {
minPenalty = penalty;
bestMaskPattern = maskPattern;
@@ -565,9 +565,9 @@ FX_INT32 CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_Q }
return bestMaskPattern;
}
-FX_INT32 CBC_QRCoderEncoder::CalculateMaskPenalty(CBC_CommonByteMatrix* matrix)
+int32_t CBC_QRCoderEncoder::CalculateMaskPenalty(CBC_CommonByteMatrix* matrix)
{
- FX_INT32 penalty = 0;
+ int32_t penalty = 0;
penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(matrix);
penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(matrix);
penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(matrix);
@@ -581,10 +581,10 @@ CBC_QRCoderMode *CBC_QRCoderEncoder::ChooseMode(const CFX_ByteString &content, C }
FX_BOOL hasNumeric = FALSE;
FX_BOOL hasAlphaNumeric = FALSE;
- for(FX_INT32 i = 0; i < content.GetLength(); i++) {
- if(isdigit((FX_BYTE)content[i])) {
+ for(int32_t i = 0; i < content.GetLength(); i++) {
+ if(isdigit((uint8_t)content[i])) {
hasNumeric = TRUE;
- } else if(GetAlphaNumericCode((FX_BYTE)content[i]) != -1) {
+ } else if(GetAlphaNumericCode((uint8_t)content[i]) != -1) {
hasAlphaNumeric = TRUE;
} else {
return CBC_QRCoderMode::sBYTE;
@@ -597,14 +597,14 @@ CBC_QRCoderMode *CBC_QRCoderEncoder::ChooseMode(const CFX_ByteString &content, C }
return CBC_QRCoderMode::sBYTE;
}
-FX_INT32 CBC_QRCoderEncoder::GetAlphaNumericCode(FX_INT32 code)
+int32_t CBC_QRCoderEncoder::GetAlphaNumericCode(int32_t code)
{
if(code < 96 && code >= 0) {
return m_alphaNumbericTable[code];
}
return -1;
}
-void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e)
{
if(mode == CBC_QRCoderMode::sNUMERIC) {
AppendNumericBytes(content, bits, e);
@@ -626,20 +626,20 @@ void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderM BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e)
{
- FX_INT32 length = content.GetLength();
- FX_INT32 i = 0;
+ int32_t length = content.GetLength();
+ int32_t i = 0;
while(i < length) {
- FX_INT32 num1 = content[i] - '0';
+ int32_t num1 = content[i] - '0';
if(i + 2 < length) {
- FX_INT32 num2 = content[i + 1] - '0';
- FX_INT32 num3 = content[i + 2] - '0';
+ int32_t num2 = content[i + 1] - '0';
+ int32_t num3 = content[i + 2] - '0';
bits->AppendBits(num1 * 100 + num2 * 10 + num3, 10, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
i += 3;
} else if(i + 1 < length) {
- FX_INT32 num2 = content[i + 1] - '0';
+ int32_t num2 = content[i + 1] - '0';
bits->AppendBits(num1 * 10 + num2, 7, e);
BC_EXCEPTION_CHECK_ReturnVoid(e)
i += 2;
@@ -650,18 +650,18 @@ void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_Q }
}
}
-void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e)
{
- FX_INT32 length = content.GetLength();
- FX_INT32 i = 0;
+ int32_t length = content.GetLength();
+ int32_t i = 0;
while(i < length) {
- FX_INT32 code1 = GetAlphaNumericCode(content[i]);
+ int32_t code1 = GetAlphaNumericCode(content[i]);
if(code1 == -1) {
e = BCExceptionInvalidateCharacter;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
if(i + 1 < length) {
- FX_INT32 code2 = GetAlphaNumericCode(content[i + 1]);
+ int32_t code2 = GetAlphaNumericCode(content[i + 1]);
if(code2 == -1) {
e = BCExceptionInvalidateCharacter;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -676,12 +676,12 @@ void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, }
}
}
-void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e)
{
- FX_INT32 length = content.GetLength();
+ int32_t length = content.GetLength();
FX_DWORD value = 0;
- for(FX_INT32 i = 0; i < length; i += 2) {
- value = (FX_DWORD)((FX_BYTE)content[i] << 8 | (FX_BYTE)content[i + 1]);
+ for(int32_t i = 0; i < length; i += 2) {
+ value = (FX_DWORD)((uint8_t)content[i] << 8 | (uint8_t)content[i + 1]);
if(value <= 0xAAFE && value >= 0xA1A1) {
value -= 0xA1A1;
} else if(value <= 0xFAFE && value >= 0xB0A1) {
@@ -695,26 +695,26 @@ void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCod BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e)
+void CBC_QRCoderEncoder::Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e)
{
- for(FX_INT32 i = 0; i < content.GetLength(); i++) {
+ for(int32_t i = 0; i < content.GetLength(); i++) {
bits->AppendBits(content[i], 8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, int32_t &e)
{
- for(FX_INT32 i = 0; i < bytes.GetSize(); i++) {
+ for(int32_t i = 0; i < bytes.GetSize(); i++) {
bits->AppendBits(bytes[i], 8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e)
{
CFX_ByteArray bytes;
FX_DWORD value = 0, h = 0;
- for(FX_INT32 i = 0; i < bytes.GetSize(); i += 2) {
- value = (FX_DWORD)((FX_BYTE)(content[i] << 8) | (FX_BYTE)content[i + 1]);
+ for(int32_t i = 0; i < bytes.GetSize(); i += 2) {
+ value = (FX_DWORD)((uint8_t)(content[i] << 8) | (uint8_t)content[i + 1]);
if(value <= 0x9ffc && value >= 0x8140) {
value -= 0x8140;
} else if(value <= 0xebbf && value >= 0xe040) {
@@ -728,19 +728,19 @@ void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRC BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e)
+void CBC_QRCoderEncoder::InitQRCode(int32_t numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e)
{
qrCode->SetECLevel(ecLevel);
qrCode->SetMode(mode);
- for(FX_INT32 versionNum = 1; versionNum <= 40; versionNum++) {
+ for(int32_t versionNum = 1; versionNum <= 40; versionNum++) {
CBC_QRCoderVersion* version = CBC_QRCoderVersion::GetVersionForNumber(versionNum, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 numBytes = version->GetTotalCodeWords();
+ int32_t numBytes = version->GetTotalCodeWords();
CBC_QRCoderECBlocks* ecBlocks = version->GetECBlocksForLevel(ecLevel);
- FX_INT32 numEcBytes = ecBlocks->GetTotalECCodeWords();
- FX_INT32 numRSBlocks = ecBlocks->GetNumBlocks();
- FX_INT32 numDataBytes = numBytes - numEcBytes;
+ int32_t numEcBytes = ecBlocks->GetTotalECCodeWords();
+ int32_t numRSBlocks = ecBlocks->GetNumBlocks();
+ int32_t numDataBytes = numBytes - numEcBytes;
if(numDataBytes >= numInputBytes + 3) {
qrCode->SetVersion(versionNum);
qrCode->SetNumTotalBytes(numBytes);
@@ -754,7 +754,7 @@ void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorr e = BCExceptionCannotFindBlockInfo;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e)
{
bits->AppendBits(mode->GetBits(), 4, e);
if(mode == CBC_QRCoderMode::sGBK) {
@@ -762,11 +762,11 @@ void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVec BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderEncoder::AppendLengthInfo(int32_t numLetters, int32_t version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e)
{
CBC_QRCoderVersion* qcv = CBC_QRCoderVersion::GetVersionForNumber(version, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 numBits = mode->GetCharacterCountBits(qcv, e);
+ int32_t numBits = mode->GetCharacterCountBits(qcv, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(numBits > ((1 << numBits) - 1)) {
return;
@@ -778,20 +778,20 @@ void CBC_QRCoderEncoder::AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, bits->AppendBits(numLetters, numBits, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_INT32 numTotalBytes, FX_INT32 numDataBytes, FX_INT32 numRSBlocks, CBC_QRCoderBitVector* result, FX_INT32 &e)
+void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, int32_t numTotalBytes, int32_t numDataBytes, int32_t numRSBlocks, CBC_QRCoderBitVector* result, int32_t &e)
{
if(bits->sizeInBytes() != numDataBytes) {
e = BCExceptionBitsBytesNotMatch;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 dataBytesOffset = 0;
- FX_INT32 maxNumDataBytes = 0;
- FX_INT32 maxNumEcBytes = 0;
+ int32_t dataBytesOffset = 0;
+ int32_t maxNumDataBytes = 0;
+ int32_t maxNumEcBytes = 0;
CFX_PtrArray blocks;
- FX_INT32 i;
+ int32_t i;
for(i = 0; i < numRSBlocks; i++) {
- FX_INT32 numDataBytesInBlock;
- FX_INT32 numEcBytesInBlosk;
+ int32_t numDataBytesInBlock;
+ int32_t numEcBytesInBlosk;
GetNumDataBytesAndNumECBytesForBlockID(numTotalBytes, numDataBytes, numRSBlocks, i,
numDataBytesInBlock, numEcBytesInBlosk);
CBC_CommonByteArray* dataBytes = FX_NEW CBC_CommonByteArray;
@@ -807,8 +807,8 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN e = BCExceptionBytesNotMatchOffset;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 x = 0; x < maxNumDataBytes; x++) {
- for(FX_INT32 j = 0; j < blocks.GetSize(); j++) {
+ for(int32_t x = 0; x < maxNumDataBytes; x++) {
+ for(int32_t j = 0; j < blocks.GetSize(); j++) {
CBC_CommonByteArray* dataBytes = ((CBC_QRCoderBlockPair*)blocks[j])->GetDataBytes();
if(x < dataBytes->Size()) {
result->AppendBits(dataBytes->At(x), 8, e);
@@ -816,8 +816,8 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN }
}
}
- for(FX_INT32 y = 0; y < maxNumEcBytes; y++) {
- for(FX_INT32 l = 0; l < blocks.GetSize(); l++) {
+ for(int32_t y = 0; y < maxNumEcBytes; y++) {
+ for(int32_t l = 0; l < blocks.GetSize(); l++) {
CBC_CommonByteArray* ecBytes = ((CBC_QRCoderBlockPair*)blocks[l])->GetErrorCorrectionBytes();
if(y < ecBytes->Size()) {
result->AppendBits(ecBytes->At(y), 8, e);
@@ -825,7 +825,7 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN }
}
}
- for(FX_INT32 k = 0; k < blocks.GetSize(); k++) {
+ for(int32_t k = 0; k < blocks.GetSize(); k++) {
delete (CBC_QRCoderBlockPair*)blocks[k];
}
if(numTotalBytes != result->sizeInBytes()) {
@@ -833,21 +833,21 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTotalBytes, FX_INT32 numDataBytes,
- FX_INT32 numRSBlocks, FX_INT32 blockID,
- FX_INT32 &numDataBytesInBlock, FX_INT32& numECBytesInBlock)
+void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(int32_t numTotalBytes, int32_t numDataBytes,
+ int32_t numRSBlocks, int32_t blockID,
+ int32_t &numDataBytesInBlock, int32_t& numECBytesInBlock)
{
if(blockID >= numRSBlocks) {
return;
}
- FX_INT32 numRsBlocksInGroup2 = numTotalBytes % numRSBlocks;
- FX_INT32 numRsBlocksInGroup1 = numRSBlocks - numRsBlocksInGroup2;
- FX_INT32 numTotalBytesInGroup1 = numTotalBytes / numRSBlocks;
- FX_INT32 numTotalBytesInGroup2 = numTotalBytesInGroup1 + 1;
- FX_INT32 numDataBytesInGroup1 = numDataBytes / numRSBlocks;
- FX_INT32 numDataBytesInGroup2 = numDataBytesInGroup1 + 1;
- FX_INT32 numEcBytesInGroup1 = numTotalBytesInGroup1 - numDataBytesInGroup1;
- FX_INT32 numEcBytesInGroup2 = numTotalBytesInGroup2 - numDataBytesInGroup2;
+ int32_t numRsBlocksInGroup2 = numTotalBytes % numRSBlocks;
+ int32_t numRsBlocksInGroup1 = numRSBlocks - numRsBlocksInGroup2;
+ int32_t numTotalBytesInGroup1 = numTotalBytes / numRSBlocks;
+ int32_t numTotalBytesInGroup2 = numTotalBytesInGroup1 + 1;
+ int32_t numDataBytesInGroup1 = numDataBytes / numRSBlocks;
+ int32_t numDataBytesInGroup2 = numDataBytesInGroup1 + 1;
+ int32_t numEcBytesInGroup1 = numTotalBytesInGroup1 - numDataBytesInGroup1;
+ int32_t numEcBytesInGroup2 = numTotalBytesInGroup2 - numDataBytesInGroup2;
if (blockID < numRsBlocksInGroup1) {
numDataBytesInBlock = numDataBytesInGroup1;
numECBytesInBlock = numEcBytesInGroup1;
@@ -856,12 +856,12 @@ void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTota numECBytesInBlock = numEcBytesInGroup2;
}
}
-CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* dataBytes, FX_INT32 numEcBytesInBlock, FX_INT32 &e)
+CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* dataBytes, int32_t numEcBytesInBlock, int32_t &e)
{
- FX_INT32 numDataBytes = dataBytes->Size();
+ int32_t numDataBytes = dataBytes->Size();
CFX_Int32Array toEncode;
toEncode.SetSize(numDataBytes + numEcBytesInBlock);
- for(FX_INT32 i = 0; i < numDataBytes; i++) {
+ for(int32_t i = 0; i < numDataBytes; i++) {
toEncode[i] = (dataBytes->At(i));
}
CBC_ReedSolomonEncoder encode(CBC_ReedSolomonGF256::QRCodeFild);
@@ -869,7 +869,7 @@ CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* da encode.Encode(&toEncode, numEcBytesInBlock, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_CommonByteArray* ecBytes = FX_NEW CBC_CommonByteArray(numEcBytesInBlock);
- for(FX_INT32 j = 0; j < numEcBytesInBlock; j++) {
+ for(int32_t j = 0; j < numEcBytesInBlock; j++) {
ecBytes->Set(j, toEncode[numDataBytes + j]);
}
return ecBytes;
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h index f08d608fb8..303dbcb767 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h @@ -17,44 +17,44 @@ class CBC_QRCoderEncoder; class CBC_QRCoderEncoder
{
private:
- const static FX_INT32 m_alphaNumbericTable[96];
+ const static int32_t m_alphaNumbericTable[96];
public:
CBC_QRCoderEncoder();
virtual ~CBC_QRCoderEncoder();
- static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e, FX_INT32 versionSpecify = 0);
- static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e);
+ static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e, int32_t versionSpecify = 0);
+ static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e);
static void EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- CBC_QRCoder *qrCode, FX_INT32 versionSpecify, FX_INT32 &e);
- static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e);
+ CBC_QRCoder *qrCode, int32_t versionSpecify, int32_t &e);
+ static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e);
static CBC_QRCoderMode* ChooseMode(const CFX_ByteString & content, CFX_ByteString encoding);
- static FX_INT32 GetAlphaNumericCode(FX_INT32 code);
+ static int32_t GetAlphaNumericCode(int32_t code);
static void AppendECI(CBC_QRCoderBitVector* bits);
- static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e);
- static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e);
- static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, FX_INT32 &e);
- static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumber,
- CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e);
- static void InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e);
- static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e);
+ static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e);
+ static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, int32_t &e);
+ static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void InitQRCode(int32_t numInputBytes, int32_t versionNumber,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e);
+ static void InitQRCode(int32_t numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e);
+ static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void AppendLengthInfo(int32_t numLetters, int32_t version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e);
- static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_INT32 numTotalBytes, FX_INT32 numDataBytes, FX_INT32 numRSBlocks, CBC_QRCoderBitVector* result, FX_INT32 &e);
- static void GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTotalBytes, FX_INT32 numDataBytes,
- FX_INT32 numRSBlocks, FX_INT32 blockID,
- FX_INT32 &numDataBytesInBlock, FX_INT32& numECBytesInBlocks);
- static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, FX_INT32 numEcBytesInBlock, FX_INT32 &e);
- static FX_INT32 ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static FX_INT32 CalculateMaskPenalty(CBC_CommonByteMatrix* matrix);
- static void TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static FX_INT32 GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, FX_INT32 versionNum, FX_INT32 &e);
- static void MergeString(CFX_PtrArray &result, FX_INT32 versionNum, FX_INT32 &e);
+ static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, int32_t numTotalBytes, int32_t numDataBytes, int32_t numRSBlocks, CBC_QRCoderBitVector* result, int32_t &e);
+ static void GetNumDataBytesAndNumECBytesForBlockID(int32_t numTotalBytes, int32_t numDataBytes,
+ int32_t numRSBlocks, int32_t blockID,
+ int32_t &numDataBytesInBlock, int32_t& numECBytesInBlocks);
+ static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, int32_t numEcBytesInBlock, int32_t &e);
+ static int32_t ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix);
+ static void TerminateBits(int32_t numDataBytes, CBC_QRCoderBitVector* bits, int32_t &e);
+ static int32_t GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, int32_t versionNum, int32_t &e);
+ static void MergeString(CFX_PtrArray &result, int32_t versionNum, int32_t &e);
static void SplitString(const CFX_ByteString &content, CFX_PtrArray &result);
- static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, FX_INT32 &e);
+ static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp index f8aae491da..cccaf86da0 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp @@ -26,7 +26,7 @@ CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::L = NULL; CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::M = NULL;
CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::Q = NULL;
CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::H = NULL;
-CBC_QRCoderErrorCorrectionLevel::CBC_QRCoderErrorCorrectionLevel(FX_INT32 ordinal, FX_INT32 bits, FX_CHAR* name)
+CBC_QRCoderErrorCorrectionLevel::CBC_QRCoderErrorCorrectionLevel(int32_t ordinal, int32_t bits, FX_CHAR* name)
{
m_name += name;
m_ordinal = ordinal;
@@ -49,11 +49,11 @@ void CBC_QRCoderErrorCorrectionLevel::Finalize() delete Q;
delete H;
}
-FX_INT32 CBC_QRCoderErrorCorrectionLevel::Ordinal()
+int32_t CBC_QRCoderErrorCorrectionLevel::Ordinal()
{
return m_ordinal;
}
-FX_INT32 CBC_QRCoderErrorCorrectionLevel::GetBits()
+int32_t CBC_QRCoderErrorCorrectionLevel::GetBits()
{
return m_bits;
}
@@ -61,7 +61,7 @@ CFX_ByteString CBC_QRCoderErrorCorrectionLevel::GetName() {
return m_name;
}
-CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::ForBits(FX_INT32 bits)
+CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::ForBits(int32_t bits)
{
switch(bits) {
case 0x00:
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h index 907c20d1cc..e38abbcae9 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h @@ -9,10 +9,10 @@ class CBC_QRCoderErrorCorrectionLevel
{
private:
- FX_INT32 m_ordinal;
- FX_INT32 m_bits;
+ int32_t m_ordinal;
+ int32_t m_bits;
CFX_ByteString m_name;
- CBC_QRCoderErrorCorrectionLevel(FX_INT32 ordinal, FX_INT32 bits, FX_CHAR* name);
+ CBC_QRCoderErrorCorrectionLevel(int32_t ordinal, int32_t bits, FX_CHAR* name);
CBC_QRCoderErrorCorrectionLevel();
public:
static CBC_QRCoderErrorCorrectionLevel* L;
@@ -22,10 +22,10 @@ public: virtual ~CBC_QRCoderErrorCorrectionLevel();
static void Initialize();
static void Finalize();
- FX_INT32 Ordinal();
- FX_INT32 GetBits();
+ int32_t Ordinal();
+ int32_t GetBits();
CFX_ByteString GetName();
static void Destroy();
- static CBC_QRCoderErrorCorrectionLevel* ForBits(FX_INT32 bits);
+ static CBC_QRCoderErrorCorrectionLevel* ForBits(int32_t bits);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp index 5a205480ae..9c72140241 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp @@ -23,8 +23,8 @@ #include "../barcode.h"
#include "BC_QRCoderErrorCorrectionLevel.h"
#include "BC_QRCoderFormatInformation.h"
-const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_MASK_QR = 0X5412;
-const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = {
+const int32_t CBC_QRCoderFormatInformation::FORMAT_INFO_MASK_QR = 0X5412;
+const int32_t CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = {
{0x5412, 0x00},
{0x5125, 0x01},
{0x5E7C, 0x02},
@@ -58,17 +58,17 @@ const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = {0x2EDA, 0x1E},
{0x2BED, 0x1F},
};
-const FX_INT32 CBC_QRCoderFormatInformation::BITS_SET_IN_HALF_BYTE[] =
+const int32_t CBC_QRCoderFormatInformation::BITS_SET_IN_HALF_BYTE[] =
{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
-CBC_QRCoderFormatInformation::CBC_QRCoderFormatInformation(FX_INT32 formatInfo)
+CBC_QRCoderFormatInformation::CBC_QRCoderFormatInformation(int32_t formatInfo)
{
m_errorCorrectLevl = CBC_QRCoderErrorCorrectionLevel::ForBits((formatInfo >> 3) & 0x03);
- m_dataMask = (FX_BYTE) (formatInfo & 0x07);
+ m_dataMask = (uint8_t) (formatInfo & 0x07);
}
CBC_QRCoderFormatInformation::~CBC_QRCoderFormatInformation()
{
}
-FX_INT32 CBC_QRCoderFormatInformation::NumBitsDiffering(FX_INT32 a, FX_INT32 b)
+int32_t CBC_QRCoderFormatInformation::NumBitsDiffering(int32_t a, int32_t b)
{
a ^= b;
return BITS_SET_IN_HALF_BYTE[a & 0x0F] +
@@ -80,7 +80,7 @@ FX_INT32 CBC_QRCoderFormatInformation::NumBitsDiffering(FX_INT32 a, FX_INT32 b) BITS_SET_IN_HALF_BYTE[(a >> 24) & 0x0F] +
BITS_SET_IN_HALF_BYTE[(a >> 28) & 0x0F];
}
-FX_BYTE CBC_QRCoderFormatInformation::GetDataMask()
+uint8_t CBC_QRCoderFormatInformation::GetDataMask()
{
return m_dataMask;
}
@@ -88,7 +88,7 @@ CBC_QRCoderErrorCorrectionLevel *CBC_QRCoderFormatInformation::GetErrorCorrectio {
return m_errorCorrectLevl;
}
-CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformation(FX_INT32 maskedFormatInfo)
+CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformation(int32_t maskedFormatInfo)
{
CBC_QRCoderFormatInformation* formatInfo = DoDecodeFormatInformation(maskedFormatInfo);
if(formatInfo != NULL) {
@@ -96,17 +96,17 @@ CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformat }
return DoDecodeFormatInformation(maskedFormatInfo ^ FORMAT_INFO_MASK_QR);
}
-CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DoDecodeFormatInformation(FX_INT32 maskedFormatInfo)
+CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DoDecodeFormatInformation(int32_t maskedFormatInfo)
{
- FX_INT32 bestDifference = (FX_INT32)FXSYS_nan();
- FX_INT32 bestFormatInfo = 0;
- for(FX_INT32 i = 0; i < 32; i++) {
- FX_INT32 const* decodeInfo = &FORMAT_INFO_DECODE_LOOKUP[i][0];
- FX_INT32 targetInfo = decodeInfo[0];
+ int32_t bestDifference = (int32_t)FXSYS_nan();
+ int32_t bestFormatInfo = 0;
+ for(int32_t i = 0; i < 32; i++) {
+ int32_t const* decodeInfo = &FORMAT_INFO_DECODE_LOOKUP[i][0];
+ int32_t targetInfo = decodeInfo[0];
if(targetInfo == maskedFormatInfo) {
return FX_NEW CBC_QRCoderFormatInformation(decodeInfo[1]);
}
- FX_INT32 bitsDifference = NumBitsDiffering(maskedFormatInfo, targetInfo);
+ int32_t bitsDifference = NumBitsDiffering(maskedFormatInfo, targetInfo);
if(bitsDifference < bestDifference) {
bestFormatInfo = decodeInfo[1];
bestDifference = bitsDifference;
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h index 49265e5033..5a0f15064c 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h @@ -10,19 +10,19 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRCoderFormatInformation
{
private:
- const static FX_INT32 FORMAT_INFO_MASK_QR;
- const static FX_INT32 FORMAT_INFO_DECODE_LOOKUP[32][2];
- const static FX_INT32 BITS_SET_IN_HALF_BYTE[16];
+ const static int32_t FORMAT_INFO_MASK_QR;
+ const static int32_t FORMAT_INFO_DECODE_LOOKUP[32][2];
+ const static int32_t BITS_SET_IN_HALF_BYTE[16];
CBC_QRCoderErrorCorrectionLevel* m_errorCorrectLevl;
- FX_BYTE m_dataMask;
+ uint8_t m_dataMask;
public:
- CBC_QRCoderFormatInformation(FX_INT32 formatInfo);
+ CBC_QRCoderFormatInformation(int32_t formatInfo);
virtual ~CBC_QRCoderFormatInformation();
- FX_BYTE GetDataMask();
+ uint8_t GetDataMask();
CBC_QRCoderErrorCorrectionLevel* GetErrorCorrectionLevel();
- static FX_INT32 NumBitsDiffering(FX_INT32 a, FX_INT32 b);
- static CBC_QRCoderFormatInformation* DecodeFormatInformation(FX_INT32 maskedFormatInfo);
- static CBC_QRCoderFormatInformation* DoDecodeFormatInformation(FX_INT32 maskedFormatInfo);
+ static int32_t NumBitsDiffering(int32_t a, int32_t b);
+ static CBC_QRCoderFormatInformation* DecodeFormatInformation(int32_t maskedFormatInfo);
+ static CBC_QRCoderFormatInformation* DoDecodeFormatInformation(int32_t maskedFormatInfo);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp index bc01eff442..f0e777c6eb 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp @@ -31,20 +31,20 @@ CBC_QRCoderMaskUtil::CBC_QRCoderMaskUtil() CBC_QRCoderMaskUtil::~CBC_QRCoderMaskUtil()
{
}
-FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix)
+int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix)
{
return ApplyMaskPenaltyRule1Internal(matrix, TRUE) +
ApplyMaskPenaltyRule1Internal(matrix, FALSE);
}
-FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix)
+int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix)
{
- FX_INT32 penalty = 0;
- FX_BYTE* array = matrix->GetArray();
- FX_INT32 width = matrix->GetWidth();
- FX_INT32 height = matrix->GetHeight();
- for(FX_INT32 y = 0; y < height - 1; y++) {
- for(FX_INT32 x = 0; x < width - 1; x++) {
- FX_INT32 value = array[y * width + x];
+ int32_t penalty = 0;
+ uint8_t* array = matrix->GetArray();
+ int32_t width = matrix->GetWidth();
+ int32_t height = matrix->GetHeight();
+ for(int32_t y = 0; y < height - 1; y++) {
+ for(int32_t x = 0; x < width - 1; x++) {
+ int32_t value = array[y * width + x];
if(value == array[y * width + x + 1] &&
value == array[(y + 1) * width + x] &&
value == array[(y + 1) * width + x + 1]) {
@@ -54,14 +54,14 @@ FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix }
return 3 * penalty;
}
-FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix)
+int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix)
{
- FX_INT32 penalty = 0;
- FX_BYTE* array = matrix->GetArray();
- FX_INT32 width = matrix->GetWidth();
- FX_INT32 height = matrix->GetHeight();
- for (FX_INT32 y = 0; y < height; ++y) {
- for (FX_INT32 x = 0; x < width; ++x) {
+ int32_t penalty = 0;
+ uint8_t* array = matrix->GetArray();
+ int32_t width = matrix->GetWidth();
+ int32_t height = matrix->GetHeight();
+ for (int32_t y = 0; y < height; ++y) {
+ for (int32_t x = 0; x < width; ++x) {
if (x == 0 && ((y >= 0 && y <= 6) || (y >= height - 7 && y <= height - 1))) {
continue;
}
@@ -118,30 +118,30 @@ FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix }
return penalty;
}
-FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix)
+int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix)
{
- FX_INT32 numDarkCells = 0;
- FX_BYTE* array = matrix->GetArray();
- FX_INT32 width = matrix->GetWidth();
- FX_INT32 height = matrix->GetHeight();
- for (FX_INT32 y = 0; y < height; ++y) {
- for (FX_INT32 x = 0; x < width; ++x) {
+ int32_t numDarkCells = 0;
+ uint8_t* array = matrix->GetArray();
+ int32_t width = matrix->GetWidth();
+ int32_t height = matrix->GetHeight();
+ for (int32_t y = 0; y < height; ++y) {
+ for (int32_t x = 0; x < width; ++x) {
if (array[y * width + x] == 1) {
numDarkCells += 1;
}
}
}
- FX_INT32 numTotalCells = matrix->GetHeight() * matrix->GetWidth();
+ int32_t numTotalCells = matrix->GetHeight() * matrix->GetWidth();
double darkRatio = (double) numDarkCells / numTotalCells;
- return abs( (FX_INT32) (darkRatio * 100 - 50) / 5 ) * 5 * 10;
+ return abs( (int32_t) (darkRatio * 100 - 50) / 5 ) * 5 * 10;
}
-FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX_INT32 y, FX_INT32 &e)
+FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(int32_t maskPattern, int32_t x, int32_t y, int32_t &e)
{
if(!CBC_QRCoder::IsValidMaskPattern(maskPattern)) {
e = (BCExceptionInvalidateMaskPattern);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
}
- FX_INT32 intermediate = 0, temp = 0;
+ int32_t intermediate = 0, temp = 0;
switch(maskPattern) {
case 0:
intermediate = (y + x) & 0x1;
@@ -177,19 +177,19 @@ FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX }
return intermediate == 0;
}
-FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal)
+int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal)
{
- FX_INT32 penalty = 0;
- FX_INT32 numSameBitCells = 0;
- FX_INT32 prevBit = -1;
- FX_INT32 width = matrix->GetWidth();
- FX_INT32 height = matrix->GetHeight();
- FX_INT32 iLimit = isHorizontal ? height : width;
- FX_INT32 jLimit = isHorizontal ? width : height;
- FX_BYTE* array = matrix->GetArray();
- for (FX_INT32 i = 0; i < iLimit; ++i) {
- for (FX_INT32 j = 0; j < jLimit; ++j) {
- FX_INT32 bit = isHorizontal ? array[i * width + j] : array[j * width + i];
+ int32_t penalty = 0;
+ int32_t numSameBitCells = 0;
+ int32_t prevBit = -1;
+ int32_t width = matrix->GetWidth();
+ int32_t height = matrix->GetHeight();
+ int32_t iLimit = isHorizontal ? height : width;
+ int32_t jLimit = isHorizontal ? width : height;
+ uint8_t* array = matrix->GetArray();
+ for (int32_t i = 0; i < iLimit; ++i) {
+ for (int32_t j = 0; j < jLimit; ++j) {
+ int32_t bit = isHorizontal ? array[i * width + j] : array[j * width + i];
if (bit == prevBit) {
numSameBitCells += 1;
if (numSameBitCells == 5) {
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h index 13bb11691a..10ff964e97 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h @@ -12,12 +12,12 @@ class CBC_QRCoderMaskUtil public:
CBC_QRCoderMaskUtil();
virtual ~CBC_QRCoderMaskUtil();
- static FX_BOOL GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX_INT32 y, FX_INT32 &e);
+ static FX_BOOL GetDataMaskBit(int32_t maskPattern, int32_t x, int32_t y, int32_t &e);
- static FX_INT32 ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix);
- static FX_INT32 ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix);
- static FX_INT32 ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix);
- static FX_INT32 ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix);
- static FX_INT32 ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal);
+ static int32_t ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix);
+ static int32_t ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix);
+ static int32_t ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix);
+ static int32_t ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix);
+ static int32_t ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp index 4c2db5e34e..7caa6b5bab 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp @@ -27,7 +27,7 @@ #include "BC_QRCoderMaskUtil.h"
#include "BC_QRCoderMatrixUtil.h"
#include "BC_QRCoderBitVector.h"
-const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = {
+const int32_t CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = {
1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0, 1,
1, 0, 1, 1, 1, 0, 1,
@@ -36,20 +36,20 @@ const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = { 1, 0, 0, 0, 0, 0, 1,
1, 1, 1, 1, 1, 1, 1
};
-const FX_INT32 CBC_QRCoderMatrixUtil::HORIZONTAL_SEPARATION_PATTERN[1][8] = {
+const int32_t CBC_QRCoderMatrixUtil::HORIZONTAL_SEPARATION_PATTERN[1][8] = {
0, 0, 0, 0, 0, 0, 0, 0
};
-const FX_INT32 CBC_QRCoderMatrixUtil::VERTICAL_SEPARATION_PATTERN[7][1] = {
+const int32_t CBC_QRCoderMatrixUtil::VERTICAL_SEPARATION_PATTERN[7][1] = {
0, 0, 0, 0, 0, 0, 0
};
-const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN[5][5] = {
+const int32_t CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN[5][5] = {
1, 1, 1, 1, 1,
1, 0, 0, 0, 1,
1, 0, 1, 0, 1,
1, 0, 0, 0, 1,
1, 1, 1, 1, 1
};
-const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7] = {
+const int32_t CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7] = {
{ -1, -1, -1, -1, -1, -1, -1},
{ 6, 18, -1, -1, -1, -1, -1},
{ 6, 22, -1, -1, -1, -1, -1},
@@ -91,7 +91,7 @@ const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TAB { 6, 26, 54, 82, 110, 138, 166},
{ 6, 30, 58, 86, 114, 142, 170},
};
-const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = {
+const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = {
{8, 0},
{8, 1},
{8, 2},
@@ -108,21 +108,21 @@ const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = { {1, 8},
{0, 8},
};
-const FX_INT32 CBC_QRCoderMatrixUtil::VERSION_INFO_POLY = 0x1f25;
-const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_POLY = 0x0537;
-const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_MASK_PATTERN = 0x5412;
-void CBC_QRCoderMatrixUtil::ClearMatrix(CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+const int32_t CBC_QRCoderMatrixUtil::VERSION_INFO_POLY = 0x1f25;
+const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_POLY = 0x0537;
+const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_MASK_PATTERN = 0x5412;
+void CBC_QRCoderMatrixUtil::ClearMatrix(CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- matrix->clear((FX_BYTE) - 1);
+ matrix->clear((uint8_t) - 1);
}
void CBC_QRCoderMatrixUtil::BuildMatrix(CBC_QRCoderBitVector* dataBits,
CBC_QRCoderErrorCorrectionLevel* ecLevel,
- FX_INT32 version, FX_INT32 maskPattern,
- CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+ int32_t version, int32_t maskPattern,
+ CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -139,7 +139,7 @@ void CBC_QRCoderMatrixUtil::BuildMatrix(CBC_QRCoderBitVector* dataBits, EmbedDataBits(dataBits, maskPattern, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -155,7 +155,7 @@ void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteM BC_EXCEPTION_CHECK_ReturnVoid(e);
}
void CBC_QRCoderMatrixUtil::EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel,
- FX_INT32 maskPattern, CBC_CommonByteMatrix *matrix, FX_INT32 &e)
+ int32_t maskPattern, CBC_CommonByteMatrix *matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -165,24 +165,24 @@ void CBC_QRCoderMatrixUtil::EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLev typeInfoBits.Init();
MakeTypeInfoBits(ecLevel, maskPattern, &typeInfoBits, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- for(FX_INT32 i = 0; i < typeInfoBits.Size(); i++) {
- FX_INT32 bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i, e);
+ for(int32_t i = 0; i < typeInfoBits.Size(); i++) {
+ int32_t bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 x1 = TYPE_INFO_COORDINATES[i][0];
- FX_INT32 y1 = TYPE_INFO_COORDINATES[i][1];
+ int32_t x1 = TYPE_INFO_COORDINATES[i][0];
+ int32_t y1 = TYPE_INFO_COORDINATES[i][1];
matrix->Set(x1, y1, bit);
if(i < 8) {
- FX_INT32 x2 = matrix->GetWidth() - i - 1;
- FX_INT32 y2 = 8;
+ int32_t x2 = matrix->GetWidth() - i - 1;
+ int32_t y2 = 8;
matrix->Set(x2, y2, bit);
} else {
- FX_INT32 x2 = 8;
- FX_INT32 y2 = matrix->GetHeight() - 7 + (i - 8);
+ int32_t x2 = 8;
+ int32_t y2 = matrix->GetHeight() - 7 + (i - 8);
matrix->Set(x2, y2, bit);
}
}
}
-void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -195,10 +195,10 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonBy versionInfoBits.Init();
MakeVersionInfoBits(version, &versionInfoBits, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 bitIndex = 6 * 3 - 1;
- for(FX_INT32 i = 0; i < 6; i++) {
- for(FX_INT32 j = 0; j < 3; j++) {
- FX_INT32 bit = versionInfoBits.At(bitIndex, e);
+ int32_t bitIndex = 6 * 3 - 1;
+ for(int32_t i = 0; i < 6; i++) {
+ for(int32_t j = 0; j < 3; j++) {
+ int32_t bit = versionInfoBits.At(bitIndex, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
bitIndex--;
matrix->Set(i, matrix->GetHeight() - 11 + j, bit);
@@ -207,16 +207,16 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonBy }
}
void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits,
- FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+ int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL || dataBits == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 bitIndex = 0;
- FX_INT32 direction = -1;
- FX_INT32 x = matrix->GetWidth() - 1;
- FX_INT32 y = matrix->GetHeight() - 1;
+ int32_t bitIndex = 0;
+ int32_t direction = -1;
+ int32_t x = matrix->GetWidth() - 1;
+ int32_t y = matrix->GetHeight() - 1;
while(x > 0) {
if (x == 6) {
x -= 1;
@@ -226,12 +226,12 @@ void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits, y += direction;
continue;
}
- for(FX_INT32 i = 0; i < 2; i++) {
- FX_INT32 xx = x - i;
+ for(int32_t i = 0; i < 2; i++) {
+ int32_t xx = x - i;
if(!IsEmpty(matrix->Get(xx, y))) {
continue;
}
- FX_INT32 bit;
+ int32_t bit;
if(bitIndex < dataBits->Size()) {
bit = dataBits->At(bitIndex, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -258,9 +258,9 @@ void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits, return;
}
}
-FX_INT32 CBC_QRCoderMatrixUtil::CalculateBCHCode(FX_INT32 value, FX_INT32 poly)
+int32_t CBC_QRCoderMatrixUtil::CalculateBCHCode(int32_t value, int32_t poly)
{
- FX_INT32 msbSetInPoly = FindMSBSet(poly);
+ int32_t msbSetInPoly = FindMSBSet(poly);
value <<= msbSetInPoly - 1;
while(FindMSBSet(value) >= msbSetInPoly) {
value ^= poly << (FindMSBSet(value) - msbSetInPoly);
@@ -268,7 +268,7 @@ FX_INT32 CBC_QRCoderMatrixUtil::CalculateBCHCode(FX_INT32 value, FX_INT32 poly) return value;
}
void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel,
- FX_INT32 maskPattern, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+ int32_t maskPattern, CBC_QRCoderBitVector* bits, int32_t &e)
{
if(bits == NULL) {
e = BCExceptionNullPointer;
@@ -278,10 +278,10 @@ void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ec e = BCExceptionBadMask;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 typeInfo = (ecLevel->GetBits() << 3) | maskPattern;
+ int32_t typeInfo = (ecLevel->GetBits() << 3) | maskPattern;
BC_EXCEPTION_CHECK_ReturnVoid(e);
bits->AppendBits(typeInfo, 5, e);
- FX_INT32 bchCode = CalculateBCHCode(typeInfo, TYPE_INFO_POLY);
+ int32_t bchCode = CalculateBCHCode(typeInfo, TYPE_INFO_POLY);
BC_EXCEPTION_CHECK_ReturnVoid(e);
bits->AppendBits(bchCode, 10, e);
CBC_QRCoderBitVector maskBits;
@@ -295,7 +295,7 @@ void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ec BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBitVector* bits, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(int32_t version, CBC_QRCoderBitVector* bits, int32_t &e)
{
if(bits == NULL) {
e = BCExceptionNullPointer;
@@ -303,7 +303,7 @@ void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBit }
bits->AppendBits(version, 6, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 bchCode = CalculateBCHCode(version, VERSION_INFO_POLY);
+ int32_t bchCode = CalculateBCHCode(version, VERSION_INFO_POLY);
bits->AppendBits(bchCode, 12, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(bits->Size() != 18) {
@@ -311,22 +311,22 @@ void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBit BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-FX_BOOL CBC_QRCoderMatrixUtil::IsEmpty(FX_INT32 value)
+FX_BOOL CBC_QRCoderMatrixUtil::IsEmpty(int32_t value)
{
- return (FX_BYTE)value == 0xff;
+ return (uint8_t)value == 0xff;
}
-FX_BOOL CBC_QRCoderMatrixUtil::IsValidValue(FX_INT32 value)
+FX_BOOL CBC_QRCoderMatrixUtil::IsValidValue(int32_t value)
{
- return ((FX_BYTE)value == 0xff || (FX_BYTE)value == 0x00 || (FX_BYTE)value == 0x01);
+ return ((uint8_t)value == 0xff || (uint8_t)value == 0x00 || (uint8_t)value == 0x01);
}
-void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 i = 8; i < matrix->GetWidth() - 8; i++) {
- FX_INT32 bit = (i + 1) % 2;
+ for(int32_t i = 8; i < matrix->GetWidth() - 8; i++) {
+ int32_t bit = (i + 1) % 2;
if(!IsValidValue(matrix->Get(i, 6))) {
e = BCExceptionInvalidateImageData;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -343,7 +343,7 @@ void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX }
}
}
-void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -355,14 +355,14 @@ void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* }
matrix->Set(8, matrix->GetHeight() - 8, 1);
}
-void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart,
- CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(int32_t xStart, int32_t yStart,
+ CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 x = 0; x < 8; x++) {
+ for(int32_t x = 0; x < 8; x++) {
if(!IsEmpty(matrix->Get(xStart + x, yStart))) {
e = BCExceptionInvalidateData;
BC_EXCEPTION_CHECK_ReturnVoid(e)
@@ -370,14 +370,14 @@ void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX matrix->Set(xStart + x, yStart, HORIZONTAL_SEPARATION_PATTERN[0][x]);
}
}
-void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart,
- CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(int32_t xStart, int32_t yStart,
+ CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 y = 0; y < 7; y++) {
+ for(int32_t y = 0; y < 7; y++) {
if(!IsEmpty(matrix->Get(xStart, yStart + y))) {
e = BCExceptionInvalidateData;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -385,15 +385,15 @@ void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_I matrix->Set(xStart, yStart + y, VERTICAL_SEPARATION_PATTERN[y][0]);
}
}
-void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_INT32 yStart,
- CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(int32_t xStart, int32_t yStart,
+ CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 y = 0; y < 5; y++) {
- for(FX_INT32 x = 0; x < 5; x++) {
+ for(int32_t y = 0; y < 5; y++) {
+ for(int32_t x = 0; x < 5; x++) {
if(!IsEmpty(matrix->Get(xStart + x, y + yStart))) {
e = BCExceptionInvalidateData;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -402,15 +402,15 @@ void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_I }
}
}
-void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (FX_INT32 xStart, FX_INT32 yStart,
- CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (int32_t xStart, int32_t yStart,
+ CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- for(FX_INT32 y = 0; y < 7; y++) {
- for(FX_INT32 x = 0; x < 7; x++) {
+ for(int32_t y = 0; y < 7; y++) {
+ for(int32_t x = 0; x < 7; x++) {
if(!IsEmpty(matrix->Get(xStart + x, yStart + y))) {
e = BCExceptionInvalidateData;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -419,27 +419,27 @@ void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (FX_INT32 xStart, FX_I }
}
}
-void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 pdpWidth = 7;
+ int32_t pdpWidth = 7;
EmbedPositionDetectionPattern(0, 0, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
EmbedPositionDetectionPattern(matrix->GetWidth() - pdpWidth, 0, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
EmbedPositionDetectionPattern(0, matrix->GetWidth() - pdpWidth, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 hspWidth = 8;
+ int32_t hspWidth = 8;
EmbedHorizontalSeparationPattern(0, hspWidth - 1, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
EmbedHorizontalSeparationPattern(matrix->GetWidth() - hspWidth, hspWidth - 1, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
EmbedHorizontalSeparationPattern(0, matrix->GetWidth() - hspWidth, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 vspSize = 7;
+ int32_t vspSize = 7;
EmbedVerticalSeparationPattern(vspSize, 0, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
EmbedVerticalSeparationPattern(matrix->GetHeight() - vspSize - 1, 0, matrix, e);
@@ -447,7 +447,7 @@ void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_Comm EmbedVerticalSeparationPattern(vspSize, matrix->GetHeight() - vspSize, matrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
-void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e)
+void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e)
{
if(matrix == NULL) {
e = BCExceptionNullPointer;
@@ -456,13 +456,13 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 versio if(version < 2) {
return;
}
- FX_INT32 index = version - 1;
- FX_INT32 const* coordinates = &(POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index][0]);
- FX_INT32 numCoordinate = 7;
- for(FX_INT32 i = 0; i < numCoordinate; i++) {
- for(FX_INT32 j = 0; j < numCoordinate; j++) {
- FX_INT32 y = coordinates[i];
- FX_INT32 x = coordinates[j];
+ int32_t index = version - 1;
+ int32_t const* coordinates = &(POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index][0]);
+ int32_t numCoordinate = 7;
+ for(int32_t i = 0; i < numCoordinate; i++) {
+ for(int32_t j = 0; j < numCoordinate; j++) {
+ int32_t y = coordinates[i];
+ int32_t x = coordinates[j];
if(x == -1 || y == -1) {
continue;
}
@@ -473,9 +473,9 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 versio }
}
}
-FX_INT32 CBC_QRCoderMatrixUtil::FindMSBSet(FX_INT32 value)
+int32_t CBC_QRCoderMatrixUtil::FindMSBSet(int32_t value)
{
- FX_INT32 numDigits = 0;
+ int32_t numDigits = 0;
while(value != 0) {
value >>= 1;
++numDigits;
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h index ce1e65d4c2..5da32441fc 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h @@ -12,38 +12,38 @@ class CBC_QRCoderBitVector; class CBC_QRCoderMatrixUtil
{
private:
- const static FX_INT32 POSITION_DETECTION_PATTERN[7][7];
- const static FX_INT32 VERTICAL_SEPARATION_PATTERN[7][1];
- const static FX_INT32 HORIZONTAL_SEPARATION_PATTERN[1][8];
- const static FX_INT32 POSITION_ADJUSTMENT_PATTERN[5][5];
- const static FX_INT32 POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7];
- const static FX_INT32 TYPE_INFO_COORDINATES[15][2];
- const static FX_INT32 VERSION_INFO_POLY;
- const static FX_INT32 TYPE_INFO_POLY;
- const static FX_INT32 TYPE_INFO_MASK_PATTERN;
+ const static int32_t POSITION_DETECTION_PATTERN[7][7];
+ const static int32_t VERTICAL_SEPARATION_PATTERN[7][1];
+ const static int32_t HORIZONTAL_SEPARATION_PATTERN[1][8];
+ const static int32_t POSITION_ADJUSTMENT_PATTERN[5][5];
+ const static int32_t POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7];
+ const static int32_t TYPE_INFO_COORDINATES[15][2];
+ const static int32_t VERSION_INFO_POLY;
+ const static int32_t TYPE_INFO_POLY;
+ const static int32_t TYPE_INFO_MASK_PATTERN;
public:
CBC_QRCoderMatrixUtil();
virtual ~CBC_QRCoderMatrixUtil();
- static void ClearMatrix(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void ClearMatrix(CBC_CommonByteMatrix* matrix, int32_t &e);
static void BuildMatrix(CBC_QRCoderBitVector* dataBits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- FX_INT32 version, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_CommonByteMatrix *matrix, FX_INT32 &e);
- static void EmbedDataBits(CBC_QRCoderBitVector* dataBits, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static FX_INT32 FindMSBSet(FX_INT32 value);
- static FX_INT32 CalculateBCHCode(FX_INT32 code, FX_INT32 poly);
- static void MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static void MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBitVector* bits, FX_INT32 &e);
- static FX_BOOL IsEmpty(FX_INT32 value);
- static FX_BOOL IsValidValue(FX_INT32 value);
- static void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedPositionDetectionPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
- static void MaybeEmbedPositionAdjustmentPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ int32_t version, int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t maskPattern, CBC_CommonByteMatrix *matrix, int32_t &e);
+ static void EmbedDataBits(CBC_QRCoderBitVector* dataBits, int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static int32_t FindMSBSet(int32_t value);
+ static int32_t CalculateBCHCode(int32_t code, int32_t poly);
+ static void MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t maskPattern, CBC_QRCoderBitVector* bits, int32_t &e);
+ static void MakeVersionInfoBits(int32_t version, CBC_QRCoderBitVector* bits, int32_t &e);
+ static FX_BOOL IsEmpty(int32_t value);
+ static FX_BOOL IsValidValue(int32_t value);
+ static void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedHorizontalSeparationPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedVerticalSeparationPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedPositionAdjustmentPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedPositionDetectionPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, int32_t &e);
+ static void MaybeEmbedPositionAdjustmentPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp index 00c7e47cb7..5bc2fe0623 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp @@ -33,9 +33,9 @@ CBC_QRCoderMode* CBC_QRCoderMode::sTERMINATOR = NULL; CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = NULL;
CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = NULL;
CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = NULL;
-CBC_QRCoderMode::CBC_QRCoderMode(FX_INT32 *characterCountBitsForVersions,
- FX_INT32 x1, FX_INT32 x2, FX_INT32 x3,
- FX_INT32 bits, CFX_ByteString name)
+CBC_QRCoderMode::CBC_QRCoderMode(int32_t *characterCountBitsForVersions,
+ int32_t x1, int32_t x2, int32_t x3,
+ int32_t bits, CFX_ByteString name)
{
m_characterCountBitsForVersions = characterCountBitsForVersions;
if (m_characterCountBitsForVersions != NULL) {
@@ -54,16 +54,16 @@ CBC_QRCoderMode::~CBC_QRCoderMode() }
void CBC_QRCoderMode::Initialize()
{
- sBYTE = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 16, 16, 0x4, "BYTE");
- sALPHANUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 9, 11, 13, 0x2, "ALPHANUMERIC");
+ sBYTE = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE");
+ sALPHANUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, "ALPHANUMERIC");
sECI = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI");
- sKANJI = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 10, 12, 0x8, "KANJI");
- sNUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 10, 12, 14, 0x1, "NUMERIC");
- sGBK = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 10, 12, 0x0D, "GBK");
- sTERMINATOR = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 0, 0, 0, 0x00, "TERMINATOR");
+ sKANJI = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI");
+ sNUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC");
+ sGBK = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK");
+ sTERMINATOR = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x00, "TERMINATOR");
sFNC1_FIRST_POSITION = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x05, "FNC1_FIRST_POSITION");
sFNC1_SECOND_POSITION = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x09, "FNC1_SECOND_POSITION");
- sSTRUCTURED_APPEND = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 0, 0, 0, 0x03, "STRUCTURED_APPEND");
+ sSTRUCTURED_APPEND = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x03, "STRUCTURED_APPEND");
}
void CBC_QRCoderMode::Finalize()
{
@@ -78,7 +78,7 @@ void CBC_QRCoderMode::Finalize() delete sFNC1_SECOND_POSITION;
delete sSTRUCTURED_APPEND;
}
-CBC_QRCoderMode* CBC_QRCoderMode::ForBits(FX_INT32 bits, FX_INT32 &e)
+CBC_QRCoderMode* CBC_QRCoderMode::ForBits(int32_t bits, int32_t &e)
{
switch (bits) {
case 0x0:
@@ -108,7 +108,7 @@ CBC_QRCoderMode* CBC_QRCoderMode::ForBits(FX_INT32 bits, FX_INT32 &e) }
return NULL;
}
-FX_INT32 CBC_QRCoderMode::GetBits()
+int32_t CBC_QRCoderMode::GetBits()
{
return m_bits;
}
@@ -116,14 +116,14 @@ CFX_ByteString CBC_QRCoderMode::GetName() {
return m_name;
}
-FX_INT32 CBC_QRCoderMode::GetCharacterCountBits(CBC_QRCoderVersion* version, FX_INT32 &e)
+int32_t CBC_QRCoderMode::GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t &e)
{
if(m_characterCountBitsForVersions == NULL) {
e = BCExceptionCharacterNotThisMode;
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
}
- FX_INT32 number = version->GetVersionNumber();
- FX_INT32 offset;
+ int32_t number = version->GetVersionNumber();
+ int32_t offset;
if(number <= 9) {
offset = 0;
} else if(number <= 26) {
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h index fbd90871cf..472d3b1198 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h @@ -10,10 +10,10 @@ class CBC_QRCoderVersion; class CBC_QRCoderMode
{
private:
- FX_INT32* m_characterCountBitsForVersions;
- FX_INT32 m_bits;
+ int32_t* m_characterCountBitsForVersions;
+ int32_t m_bits;
CFX_ByteString m_name;
- CBC_QRCoderMode(FX_INT32 *characterCountBitsForVersions, FX_INT32 x1, FX_INT32 x2, FX_INT32 x3, FX_INT32 bits, CFX_ByteString name);
+ CBC_QRCoderMode(int32_t *characterCountBitsForVersions, int32_t x1, int32_t x2, int32_t x3, int32_t bits, CFX_ByteString name);
CBC_QRCoderMode();
public:
static CBC_QRCoderMode* sBYTE;
@@ -30,9 +30,9 @@ public: static void Initialize();
static void Finalize();
- static CBC_QRCoderMode* ForBits(FX_INT32 bits, FX_INT32 &e);
- FX_INT32 GetCharacterCountBits(CBC_QRCoderVersion* version, FX_INT32 &e);
- FX_INT32 GetBits();
+ static CBC_QRCoderMode* ForBits(int32_t bits, int32_t &e);
+ int32_t GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t &e);
+ int32_t GetBits();
CFX_ByteString GetName();
static void Destroy();
};
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp index 9ff54f2a13..e0acf46fb9 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp @@ -29,7 +29,7 @@ #include "BC_QRCoderBitVector.h"
#include "BC_QRCoderECBlocks.h"
#include "BC_QRCoderVersion.h"
-const FX_INT32 CBC_QRCoderVersion::VERSION_DECODE_INFO[] = {
+const int32_t CBC_QRCoderVersion::VERSION_DECODE_INFO[] = {
0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6,
0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78,
0x1145D, 0x12A17, 0x13532, 0x149A6, 0x15683,
@@ -45,13 +45,13 @@ void CBC_QRCoderVersion::Initialize() }
void CBC_QRCoderVersion::Finalize()
{
- for(FX_INT32 i = 0 ; i < VERSION->GetSize(); i++) {
+ for(int32_t i = 0 ; i < VERSION->GetSize(); i++) {
CBC_QRCoderVersion* v = (CBC_QRCoderVersion*)(VERSION->GetAt(i));
delete v;
}
delete VERSION;
}
-CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber,
+CBC_QRCoderVersion::CBC_QRCoderVersion(int32_t versionNumber,
CBC_QRCoderECBlocks* ecBlocks1,
CBC_QRCoderECBlocks* ecBlocks2,
CBC_QRCoderECBlocks* ecBlocks3,
@@ -62,10 +62,10 @@ CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber, m_ecBlocks.Add(ecBlocks2);
m_ecBlocks.Add(ecBlocks3);
m_ecBlocks.Add(ecBlocks4);
- FX_INT32 total = 0;
- FX_INT32 ecCodeWords = ecBlocks1->GetECCodeWordsPerBlock();
+ int32_t total = 0;
+ int32_t ecCodeWords = ecBlocks1->GetECCodeWordsPerBlock();
CFX_PtrArray* ecbArray = ecBlocks1->GetECBlocks();
- for(FX_INT32 i = 0; i < ecbArray->GetSize(); i++) {
+ for(int32_t i = 0; i < ecbArray->GetSize(); i++) {
CBC_QRCoderECB* ecBlock = (CBC_QRCoderECB*)((*ecbArray)[i]);
total += ecBlock->GetCount() * (ecBlock->GetDataCodeWords() + ecCodeWords);
}
@@ -334,15 +334,15 @@ CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber, CBC_QRCoderVersion::~CBC_QRCoderVersion()
{
if(m_ecBlocks.GetSize() != 0) {
- FX_INT32 itBeg = 0;
- FX_INT32 itEnd = m_ecBlocks.GetSize();
+ int32_t itBeg = 0;
+ int32_t itEnd = m_ecBlocks.GetSize();
while(itBeg != itEnd) {
delete ( (CBC_QRCoderECBlocks*)(m_ecBlocks[itBeg]) );
itBeg++;
}
}
}
-FX_INT32 CBC_QRCoderVersion::GetVersionNumber()
+int32_t CBC_QRCoderVersion::GetVersionNumber()
{
return m_versionNumber;
}
@@ -350,11 +350,11 @@ CFX_Int32Array* CBC_QRCoderVersion::GetAlignmentPatternCenters() {
return &m_alignmentPatternCenters;
}
-FX_INT32 CBC_QRCoderVersion::GetTotalCodeWords()
+int32_t CBC_QRCoderVersion::GetTotalCodeWords()
{
return m_totalCodeWords;
}
-FX_INT32 CBC_QRCoderVersion::GetDimensionForVersion()
+int32_t CBC_QRCoderVersion::GetDimensionForVersion()
{
return 17 + 4 * m_versionNumber;
}
@@ -362,7 +362,7 @@ CBC_QRCoderECBlocks* CBC_QRCoderVersion::GetECBlocksForLevel(CBC_QRCoderErrorCor {
return (CBC_QRCoderECBlocks*)m_ecBlocks[ecLevel->Ordinal()];
}
-CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(FX_INT32 dimension, FX_INT32 &e)
+CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(int32_t dimension, int32_t &e)
{
if((dimension % 4) != 1) {
e = BCExceptionRead;
@@ -372,18 +372,18 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(FX_INT BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return qcv;
}
-CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(FX_INT32 versionBits, FX_INT32 &e)
+CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(int32_t versionBits, int32_t &e)
{
- FX_INT32 bestDifference = FXSYS_IntMax;
- FX_INT32 bestVersion = 0;
- for (FX_INT32 i = 0; i < 34; i++) {
- FX_INT32 targetVersion = VERSION_DECODE_INFO[i];
+ int32_t bestDifference = FXSYS_IntMax;
+ int32_t bestVersion = 0;
+ for (int32_t i = 0; i < 34; i++) {
+ int32_t targetVersion = VERSION_DECODE_INFO[i];
if(targetVersion == versionBits) {
CBC_QRCoderVersion* qcv = GetVersionForNumber(i + 7, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return qcv;
}
- FX_INT32 bitsDifference = CBC_QRCoderFormatInformation::NumBitsDiffering(versionBits, targetVersion);
+ int32_t bitsDifference = CBC_QRCoderFormatInformation::NumBitsDiffering(versionBits, targetVersion);
if(bitsDifference < bestDifference) {
bestVersion = i + 7;
bestDifference = bitsDifference;
@@ -396,9 +396,9 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(FX_INT32 versio }
return NULL;
}
-CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e)
+CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(int32_t &e)
{
- FX_INT32 dimension = GetDimensionForVersion();
+ int32_t dimension = GetDimensionForVersion();
CBC_CommonBitMatrix* bitMatrix = FX_NEW CBC_CommonBitMatrix();
bitMatrix->Init(dimension);
bitMatrix->SetRegion(0, 0 , 9, 9, e);
@@ -407,10 +407,10 @@ CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
bitMatrix->SetRegion(0, dimension - 8, 9, 8, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 max = m_alignmentPatternCenters.GetSize();
- for (FX_INT32 x = 0; x < max; x++) {
- FX_INT32 i = m_alignmentPatternCenters[x] - 2;
- for (FX_INT32 y = 0; y < max; y++) {
+ int32_t max = m_alignmentPatternCenters.GetSize();
+ for (int32_t x = 0; x < max; x++) {
+ int32_t i = m_alignmentPatternCenters[x] - 2;
+ for (int32_t y = 0; y < max; y++) {
if ((x == 0 && (y == 0 || y == max - 1)) || (x == max - 1 && y == 0)) {
continue;
}
@@ -430,7 +430,7 @@ CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e) }
return bitMatrix;
}
-CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(FX_INT32 versionNumber, FX_INT32 &e)
+CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(int32_t versionNumber, int32_t &e)
{
if(VERSION->GetSize() == 0) {
VERSION->Add(FX_NEW CBC_QRCoderVersion(1,
@@ -770,7 +770,7 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(FX_INT32 versionNumb }
void CBC_QRCoderVersion::Destroy()
{
- FX_INT32 i;
+ int32_t i;
for(i = 0; i < VERSION->GetSize(); i++) {
delete ( (CBC_QRCoderVersion*)(*VERSION)[i] );
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h index 17d392121d..46a80c8d09 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h @@ -12,30 +12,30 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRCoderVersion
{
private:
- const static FX_INT32 VERSION_DECODE_INFO[34];
+ const static int32_t VERSION_DECODE_INFO[34];
static CFX_PtrArray *VERSION;
- FX_INT32 m_versionNumber;
- FX_INT32 m_totalCodeWords;
+ int32_t m_versionNumber;
+ int32_t m_totalCodeWords;
CFX_Int32Array m_alignmentPatternCenters;
CFX_PtrArray m_ecBlocks;
CBC_QRCoderVersion();
- CBC_QRCoderVersion(FX_INT32 versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2,
+ CBC_QRCoderVersion(int32_t versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2,
CBC_QRCoderECBlocks* ecBlocks3, CBC_QRCoderECBlocks* ecBlocks4);
public:
virtual ~CBC_QRCoderVersion();
static void Initialize();
static void Finalize();
- FX_INT32 GetVersionNumber();
- FX_INT32 GetTotalCodeWords();
- FX_INT32 GetDimensionForVersion();
- CBC_CommonBitMatrix *BuildFunctionPattern(FX_INT32 &e);
+ int32_t GetVersionNumber();
+ int32_t GetTotalCodeWords();
+ int32_t GetDimensionForVersion();
+ CBC_CommonBitMatrix *BuildFunctionPattern(int32_t &e);
CFX_Int32Array* GetAlignmentPatternCenters();
CBC_QRCoderECBlocks* GetECBlocksForLevel(CBC_QRCoderErrorCorrectionLevel *ecLevel);
- static CBC_QRCoderVersion* GetVersionForNumber(FX_INT32 versionNumber, FX_INT32 &e);
- static CBC_QRCoderVersion* GetProvisionalVersionForDimension(FX_INT32 dimension, FX_INT32 &e);
- static CBC_QRCoderVersion* DecodeVersionInformation(FX_INT32 versionBits, FX_INT32 &e);
+ static CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber, int32_t &e);
+ static CBC_QRCoderVersion* GetProvisionalVersionForDimension(int32_t dimension, int32_t &e);
+ static CBC_QRCoderVersion* DecodeVersionInformation(int32_t versionBits, int32_t &e);
static void Destroy();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp index 87c14deac9..2877d2f82b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp @@ -25,7 +25,7 @@ #include "BC_QRCoderECB.h"
#include "BC_QRDataBlock.h"
#include "BC_QRCoderVersion.h"
-CBC_QRDataBlock::CBC_QRDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords)
+CBC_QRDataBlock::CBC_QRDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords)
: m_numDataCodewords(numDataCodewords)
, m_codewords(codewords)
{
@@ -37,7 +37,7 @@ CBC_QRDataBlock::~CBC_QRDataBlock() m_codewords = NULL;
}
}
-FX_INT32 CBC_QRDataBlock::GetNumDataCodewords()
+int32_t CBC_QRDataBlock::GetNumDataCodewords()
{
return m_numDataCodewords;
}
@@ -45,47 +45,47 @@ CFX_ByteArray *CBC_QRDataBlock::GetCodewords() {
return m_codewords;
}
-CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e)
+CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e)
{
if(rawCodewords->GetSize() != version->GetTotalCodeWords()) {
e = BCExceptionIllegalArgument;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_QRCoderECBlocks *ecBlocks = version->GetECBlocksForLevel(ecLevel);
- FX_INT32 totalBlocks = 0;
+ int32_t totalBlocks = 0;
CFX_PtrArray* ecBlockArray = ecBlocks->GetECBlocks();
- FX_INT32 i = 0;
+ int32_t i = 0;
for(i = 0; i < ecBlockArray->GetSize(); i++) {
totalBlocks += ((CBC_QRCoderECB*)(*ecBlockArray)[i])->GetCount();
}
CFX_PtrArray *datablock = FX_NEW CFX_PtrArray();
datablock->SetSize(totalBlocks);
CBC_AutoPtr<CFX_PtrArray > result(datablock);
- FX_INT32 numResultBlocks = 0;
- for(FX_INT32 j = 0; j < ecBlockArray->GetSize(); j++) {
+ int32_t numResultBlocks = 0;
+ for(int32_t j = 0; j < ecBlockArray->GetSize(); j++) {
CBC_QRCoderECB *ecBlock = (CBC_QRCoderECB*)(*ecBlockArray)[j];
- for(FX_INT32 k = 0; k < ecBlock->GetCount(); k++) {
- FX_INT32 numDataCodewords = ecBlock->GetDataCodeWords();
- FX_INT32 numBlockCodewords = ecBlocks->GetECCodeWordsPerBlock() + numDataCodewords;
+ for(int32_t k = 0; k < ecBlock->GetCount(); k++) {
+ int32_t numDataCodewords = ecBlock->GetDataCodeWords();
+ int32_t numBlockCodewords = ecBlocks->GetECCodeWordsPerBlock() + numDataCodewords;
CFX_ByteArray *bytearray = FX_NEW CFX_ByteArray();
bytearray->SetSize(numBlockCodewords);
(*result)[numResultBlocks++] = FX_NEW CBC_QRDataBlock(numDataCodewords, bytearray);
}
}
- FX_INT32 shorterBlocksTotalCodewords = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize();
- FX_INT32 longerBlocksStartAt = result->GetSize() - 1;
+ int32_t shorterBlocksTotalCodewords = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize();
+ int32_t longerBlocksStartAt = result->GetSize() - 1;
while(longerBlocksStartAt >= 0) {
- FX_INT32 numCodewords = ((CBC_QRDataBlock*)(*result)[longerBlocksStartAt])->m_codewords->GetSize();
+ int32_t numCodewords = ((CBC_QRDataBlock*)(*result)[longerBlocksStartAt])->m_codewords->GetSize();
if(numCodewords == shorterBlocksTotalCodewords) {
break;
}
longerBlocksStartAt--;
}
longerBlocksStartAt++;
- FX_INT32 shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks->GetECCodeWordsPerBlock();
- FX_INT32 rawCodewordsOffset = 0;
- FX_INT32 x = 0;
- for(FX_INT32 k = 0; k < shorterBlocksNumDataCodewords; k++) {
+ int32_t shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks->GetECCodeWordsPerBlock();
+ int32_t rawCodewordsOffset = 0;
+ int32_t x = 0;
+ for(int32_t k = 0; k < shorterBlocksNumDataCodewords; k++) {
for(x = 0; x < numResultBlocks; x++) {
(*(((CBC_QRDataBlock*)(*result)[x])->m_codewords))[k] = (*rawCodewords)[rawCodewordsOffset++];
}
@@ -93,10 +93,10 @@ CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QR for(x = longerBlocksStartAt; x < numResultBlocks; x++) {
(*(((CBC_QRDataBlock*)(*result)[x])->m_codewords))[shorterBlocksNumDataCodewords] = (*rawCodewords)[rawCodewordsOffset++];
}
- FX_INT32 max = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize();
+ int32_t max = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize();
for(i = shorterBlocksNumDataCodewords; i < max; i++) {
- for(FX_INT32 y = 0; y < numResultBlocks; y++) {
- FX_INT32 iOffset = y < longerBlocksStartAt ? i : i + 1;
+ for(int32_t y = 0; y < numResultBlocks; y++) {
+ int32_t iOffset = y < longerBlocksStartAt ? i : i + 1;
(*(((CBC_QRDataBlock*)(*result)[y])->m_codewords))[iOffset] = (*rawCodewords)[rawCodewordsOffset++];
}
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h index d5697ff724..4502398e92 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h @@ -13,14 +13,14 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRDataBlock
{
private:
- FX_INT32 m_numDataCodewords;
+ int32_t m_numDataCodewords;
CFX_ByteArray *m_codewords;
- CBC_QRDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords);
+ CBC_QRDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords);
public:
virtual ~CBC_QRDataBlock();
- FX_INT32 GetNumDataCodewords();
+ int32_t GetNumDataCodewords();
CFX_ByteArray* GetCodewords();
static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords,
- CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);
+ CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp index fd81b20f1b..bfea8e2d4d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp @@ -23,7 +23,7 @@ #include "../barcode.h"
#include "../common/BC_CommonBitMatrix.h"
#include "BC_QRDataMask.h"
-static FX_INT32 N_DATA_MASKS = 0;
+static int32_t N_DATA_MASKS = 0;
CFX_PtrArray* CBC_QRDataMask::DATA_MASKS = NULL;
void CBC_QRDataMask::Initialize()
{
@@ -37,7 +37,7 @@ void CBC_QRDataMask::Finalize() }
void CBC_QRDataMask::Destroy()
{
- FX_INT32 i;
+ int32_t i;
for(i = 0; i < N_DATA_MASKS; i++) {
CBC_QRDataMask* p = (CBC_QRDataMask*)(*DATA_MASKS)[i];
if (p) {
@@ -45,17 +45,17 @@ void CBC_QRDataMask::Destroy() }
}
}
-void CBC_QRDataMask::UnmaskBitMatirx(CBC_CommonBitMatrix *bits, FX_INT32 dimension)
+void CBC_QRDataMask::UnmaskBitMatirx(CBC_CommonBitMatrix *bits, int32_t dimension)
{
- for(FX_INT32 i = 0; i < dimension; i++) {
- for(FX_INT32 j = 0; j < dimension; j++) {
+ for(int32_t i = 0; i < dimension; i++) {
+ for(int32_t j = 0; j < dimension; j++) {
if(IsMasked(i, j)) {
bits->Flip(j, i);
}
}
}
}
-CBC_QRDataMask* CBC_QRDataMask::ForReference(FX_INT32 reference, FX_INT32 &e)
+CBC_QRDataMask* CBC_QRDataMask::ForReference(int32_t reference, int32_t &e)
{
if(reference < 0 || reference > 7) {
e = BCExceptionReferenceMustBeBetween0And7;
@@ -66,7 +66,7 @@ CBC_QRDataMask* CBC_QRDataMask::ForReference(FX_INT32 reference, FX_INT32 &e) class DataMask000 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return ((x + y) % 2) == 0;
}
@@ -74,7 +74,7 @@ public: class DataMask001 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return (x % 2) == 0;
}
@@ -82,7 +82,7 @@ public: class DataMask010 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return y % 3 == 0;
}
@@ -90,7 +90,7 @@ public: class DataMask011 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return (x + y) % 3 == 0;
}
@@ -98,7 +98,7 @@ public: class DataMask100 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return (((x >> 1) + (y / 3)) % 2) == 0;
}
@@ -106,7 +106,7 @@ public: class DataMask101 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
size_t temp = x * y;
return (temp % 2) + (temp % 3) == 0;
@@ -115,7 +115,7 @@ public: class DataMask110 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
size_t temp = x * y;
return (((temp % 2) + (temp % 3)) % 2) == 0;
@@ -124,12 +124,12 @@ public: class DataMask111 : public CBC_QRDataMask
{
public:
- FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y)
+ FX_BOOL IsMasked(int32_t x, int32_t y)
{
return ((((x + y) % 2) + ((x * y) % 3)) % 2) == 0;
}
};
-FX_INT32 CBC_QRDataMask::BuildDataMasks()
+int32_t CBC_QRDataMask::BuildDataMasks()
{
DATA_MASKS->Add(FX_NEW DataMask000);
DATA_MASKS->Add(FX_NEW DataMask001);
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h index 221218f34a..79ae4901b6 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h @@ -15,10 +15,10 @@ public: virtual ~CBC_QRDataMask();
static void Initialize();
static void Finalize();
- virtual FX_BOOL IsMasked(FX_INT32 i, FX_INT32 j) = 0;
- void UnmaskBitMatirx(CBC_CommonBitMatrix *bits, FX_INT32 dimension);
- static CBC_QRDataMask* ForReference(FX_INT32 reference, FX_INT32 &e);
- static FX_INT32 BuildDataMasks();
+ virtual FX_BOOL IsMasked(int32_t i, int32_t j) = 0;
+ void UnmaskBitMatirx(CBC_CommonBitMatrix *bits, int32_t dimension);
+ static CBC_QRDataMask* ForReference(int32_t reference, int32_t &e);
+ static int32_t BuildDataMasks();
static void Destroy();
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp index 0fe4d1b2b6..b521222f00 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp @@ -42,7 +42,7 @@ CBC_QRDecodedBitStreamParser::~CBC_QRDecodedBitStreamParser() {
}
CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version,
- CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e)
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t byteModeDecode, int32_t &e)
{
CBC_CommonBitSource bits(bytes);
CFX_ByteString result;
@@ -54,7 +54,7 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt if(bits.Available() < 4) {
mode = CBC_QRCoderMode::sTERMINATOR;
} else {
- FX_INT32 iTemp1 = bits.ReadBits(4, e);
+ int32_t iTemp1 = bits.ReadBits(4, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
mode = CBC_QRCoderMode::ForBits(iTemp1, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -70,7 +70,7 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt bits.ReadBits(16, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
} else if(mode == CBC_QRCoderMode::sECI) {
- FX_INT32 value = ParseECIValue(&bits, e);
+ int32_t value = ParseECIValue(&bits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
currentCharacterSetECI = CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(value);
} else {
@@ -78,9 +78,9 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt bits.ReadBits(4, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 numBits = mode->GetCharacterCountBits(version, e);
+ int32_t numBits = mode->GetCharacterCountBits(version, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 count = bits.ReadBits(numBits, e);
+ int32_t count = bits.ReadBits(numBits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
if(mode == CBC_QRCoderMode::sNUMERIC) {
DecodeNumericSegment(&bits, result, count, e);
@@ -109,46 +109,46 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return tempCd;
}
-void CBC_QRDecodedBitStreamParser::DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e)
+void CBC_QRDecodedBitStreamParser::DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e)
{
CFX_ByteString buffer;
- FX_INT32 offset = 0;
+ int32_t offset = 0;
while (count > 0) {
- FX_INT32 twoBytes = bits->ReadBits(13, e);
+ int32_t twoBytes = bits->ReadBits(13, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060);
+ int32_t assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060);
if (assembledTwoBytes <= 0x0095d) {
assembledTwoBytes += 0x0a1a1;
} else {
assembledTwoBytes += 0x0a6a1;
}
- buffer += (FX_BYTE) (assembledTwoBytes >> 8);
- buffer += (FX_BYTE) assembledTwoBytes;
+ buffer += (uint8_t) (assembledTwoBytes >> 8);
+ buffer += (uint8_t) assembledTwoBytes;
count--;
}
CBC_UtilCodingConvert::LocaleToUtf8(buffer, result);
}
-void CBC_QRDecodedBitStreamParser::DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e)
+void CBC_QRDecodedBitStreamParser::DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e)
{
CFX_ByteString buffer;
while (count > 0) {
- FX_INT32 twoBytes = bits->ReadBits(13, e);
+ int32_t twoBytes = bits->ReadBits(13, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- FX_INT32 assembledTwoBytes = ((twoBytes / 0x0c0) << 8) | (twoBytes % 0x0c0);
+ int32_t assembledTwoBytes = ((twoBytes / 0x0c0) << 8) | (twoBytes % 0x0c0);
if (assembledTwoBytes <= 0x01f00) {
assembledTwoBytes += 0x08140;
} else {
assembledTwoBytes += 0x0c140;
}
- buffer += (FX_BYTE) (assembledTwoBytes >> 8);
- buffer += (FX_BYTE) assembledTwoBytes;
+ buffer += (uint8_t) (assembledTwoBytes >> 8);
+ buffer += (uint8_t) assembledTwoBytes;
count--;
}
CBC_UtilCodingConvert::LocaleToUtf8(buffer, result);
}
-void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count,
+void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count,
CBC_CommonCharacterSetECI *currentCharacterSetECI,
- CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e)
+ CFX_Int32Array *byteSegments, int32_t byteModeDecode, int32_t &e)
{
if(count < 0) {
e = BCExceptionNotFound;
@@ -158,10 +158,10 @@ void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_BYTE *readBytes = FX_Alloc(FX_BYTE, count);
+ uint8_t *readBytes = FX_Alloc(uint8_t, count);
FXSYS_memset32(readBytes, 0x00, count);
- for(FX_INT32 i = 0; i < count; i++) {
- readBytes[i] = (FX_BYTE) bits->ReadBits(8, e);
+ for(int32_t i = 0; i < count; i++) {
+ readBytes[i] = (uint8_t) bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
CFX_ByteString bs(readBytes, count);
@@ -169,23 +169,23 @@ void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, FX_Free(readBytes);
}
void CBC_QRDecodedBitStreamParser::DecodeAlphanumericSegment(CBC_CommonBitSource* bits,
- CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e)
+ CFX_ByteString &result, int32_t count, FX_BOOL fac1InEffect, int32_t &e)
{
- FX_INT32 start = result.GetLength();
+ int32_t start = result.GetLength();
while(count > 1) {
- FX_INT32 nextTwoCharsBits = bits->ReadBits(11, e);
+ int32_t nextTwoCharsBits = bits->ReadBits(11, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[nextTwoCharsBits / 45]);
BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[nextTwoCharsBits % 45]);
count -= 2;
}
if(count == 1) {
- FX_INT32 itemp = bits->ReadBits(6, e);
+ int32_t itemp = bits->ReadBits(6, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[itemp]);
}
if(fac1InEffect) {
- for(FX_INT32 i = start; i < result.GetLength(); i++) {
+ for(int32_t i = start; i < result.GetLength(); i++) {
if(result[i] == '%') {
if((i < result.GetLength() - 1) && result[i + 1] == '%') {
result.Delete(i + 1, 1);
@@ -196,10 +196,10 @@ void CBC_QRDecodedBitStreamParser::DecodeAlphanumericSegment(CBC_CommonBitSource }
}
}
-void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e)
+void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e)
{
while(count >= 3) {
- FX_INT32 threeDigitsBits = bits->ReadBits(10, e);
+ int32_t threeDigitsBits = bits->ReadBits(10, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(threeDigitsBits >= 1000) {
e = BCExceptionRead;
@@ -211,7 +211,7 @@ void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bit count -= 3;
}
if(count == 2) {
- FX_INT32 twoDigitBits = bits->ReadBits(7, e);
+ int32_t twoDigitBits = bits->ReadBits(7, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(twoDigitBits >= 100) {
e = BCExceptionRead;
@@ -220,7 +220,7 @@ void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bit BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[twoDigitBits / 10]);
BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[twoDigitBits % 10]);
} else if(count == 1) {
- FX_INT32 digitBits = bits->ReadBits(4, e);
+ int32_t digitBits = bits->ReadBits(4, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(digitBits >= 10) {
e = BCExceptionRead;
@@ -233,18 +233,18 @@ const CFX_ByteString CBC_QRDecodedBitStreamParser::GuessEncoding(CFX_ByteArray * {
return *UTF_8;
}
-FX_INT32 CBC_QRDecodedBitStreamParser::ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e)
+int32_t CBC_QRDecodedBitStreamParser::ParseECIValue(CBC_CommonBitSource* bits, int32_t &e)
{
- FX_INT32 firstByte = bits->ReadBits(8, e);
+ int32_t firstByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
if((firstByte & 0x80) == 0) {
return firstByte & 0x7f;
} else if((firstByte & 0xc0) == 0x80) {
- FX_INT32 secondByte = bits->ReadBits(8, e);
+ int32_t secondByte = bits->ReadBits(8, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
return ((firstByte & 0x3f) << 8) | secondByte;
} else if((firstByte & 0xe0) == 0xc0) {
- FX_INT32 secondThirdByte = bits->ReadBits(16, e);
+ int32_t secondThirdByte = bits->ReadBits(16, e);
BC_EXCEPTION_CHECK_ReturnValue(e, 0);
return ((firstByte & 0x1f) << 16) | secondThirdByte;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h index f4ac06b984..d607e72da8 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h @@ -20,15 +20,15 @@ private: public:
virtual ~CBC_QRDecodedBitStreamParser();
static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version,
- CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e);
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t byteModeDecode, int32_t &e);
static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes);
- static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e);
- static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
- static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
- static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
- static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e);
- static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI,
- CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e);
+ static int32_t ParseECIValue(CBC_CommonBitSource* bits, int32_t &e);
+ static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e);
+ static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e);
+ static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e);
+ static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, FX_BOOL fac1InEffect, int32_t &e);
+ static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, CBC_CommonCharacterSetECI *currentCharacterSetECI,
+ CFX_Int32Array *byteSegments, int32_t byteModeDecode, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp index 01d90832b9..0b75da7bec 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp @@ -37,7 +37,7 @@ CBC_QRDetector::CBC_QRDetector(CBC_CommonBitMatrix *image): m_image(image) CBC_QRDetector::~CBC_QRDetector()
{
}
-CBC_QRDetectorResult *CBC_QRDetector::Detect(FX_INT32 hints, FX_INT32 &e)
+CBC_QRDetectorResult *CBC_QRDetector::Detect(int32_t hints, int32_t &e)
{
CBC_QRFinderPatternFinder finder(m_image);
CBC_QRFinderPatternInfo* qpi = finder.Find(hints, e);
@@ -47,7 +47,7 @@ CBC_QRDetectorResult *CBC_QRDetector::Detect(FX_INT32 hints, FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return qdr;
}
-CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e)
+CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, int32_t &e)
{
CBC_AutoPtr<CBC_QRFinderPattern> topLeft(info->GetTopLeft());
CBC_AutoPtr<CBC_QRFinderPattern> topRight(info->GetTopRight());
@@ -57,21 +57,21 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatte e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 dimension = ComputeDimension(topLeft.get(), topRight.get(), bottomLeft.get(), moduleSize, e);
+ int32_t dimension = ComputeDimension(topLeft.get(), topRight.get(), bottomLeft.get(), moduleSize, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_QRCoderVersion *provisionalVersion = CBC_QRCoderVersion::GetProvisionalVersionForDimension(dimension, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 modulesBetweenFPCenters = provisionalVersion->GetDimensionForVersion() - 7;
+ int32_t modulesBetweenFPCenters = provisionalVersion->GetDimensionForVersion() - 7;
CBC_QRAlignmentPattern * alignmentPattern = NULL;
if(provisionalVersion->GetAlignmentPatternCenters()->GetSize() > 0) {
FX_FLOAT bottomRightX = topRight->GetX() - topLeft->GetX() + bottomLeft->GetX();
FX_FLOAT bottomRightY = topRight->GetY() - topLeft->GetY() + bottomLeft->GetY();
FX_FLOAT correctionToTopLeft = 1.0f - 3.0f / (FX_FLOAT) modulesBetweenFPCenters;
FX_FLOAT xtemp = (topLeft->GetX() + correctionToTopLeft * (bottomRightX - topLeft->GetX()));
- FX_INT32 estAlignmentX = (FX_INT32)xtemp ;
+ int32_t estAlignmentX = (int32_t)xtemp ;
FX_FLOAT ytemp = (topLeft->GetY() + correctionToTopLeft * (bottomRightY - topLeft->GetY()));
- FX_INT32 estAlignmentY = (FX_INT32)ytemp;
- for(FX_INT32 i = 4; i <= 16; i <<= 1) {
+ int32_t estAlignmentY = (int32_t)ytemp;
+ for(int32_t i = 4; i <= 16; i <<= 1) {
CBC_QRAlignmentPattern *temp = FindAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT) i, e);
alignmentPattern = temp;
break;
@@ -94,7 +94,7 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatte }
CBC_CommonBitMatrix *CBC_QRDetector::SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,
CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern,
- FX_INT32 dimension, FX_INT32 &e)
+ int32_t dimension, int32_t &e)
{
FX_FLOAT dimMinusThree = (FX_FLOAT) dimension - 3.5f;
FX_FLOAT bottomRightX;
@@ -132,12 +132,12 @@ CBC_CommonBitMatrix *CBC_QRDetector::SampleGrid(CBC_CommonBitMatrix *image, CBC_ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return cbm;
}
-FX_INT32 CBC_QRDetector::ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,
- CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e)
+int32_t CBC_QRDetector::ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,
+ CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, int32_t &e)
{
- FX_INT32 tltrCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, topRight) / moduleSize);
- FX_INT32 tlblCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, bottomLeft) / moduleSize);
- FX_INT32 dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;
+ int32_t tltrCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, topRight) / moduleSize);
+ int32_t tlblCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, bottomLeft) / moduleSize);
+ int32_t dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;
switch(dimension & 0x03) {
case 0:
dimension++;
@@ -158,14 +158,14 @@ FX_FLOAT CBC_QRDetector::CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_Resul }
FX_FLOAT CBC_QRDetector::CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern)
{
- FX_FLOAT moduleSizeEst1 = SizeOfBlackWhiteBlackRunBothWays((FX_INT32) pattern->GetX(),
- (FX_INT32) pattern->GetY(),
- (FX_INT32) otherPattern->GetX(),
- (FX_INT32) otherPattern->GetY());
- FX_FLOAT moduleSizeEst2 = SizeOfBlackWhiteBlackRunBothWays((FX_INT32) otherPattern->GetX(),
- (FX_INT32) otherPattern->GetY(),
- (FX_INT32) pattern->GetX(),
- (FX_INT32) pattern->GetY());
+ FX_FLOAT moduleSizeEst1 = SizeOfBlackWhiteBlackRunBothWays((int32_t) pattern->GetX(),
+ (int32_t) pattern->GetY(),
+ (int32_t) otherPattern->GetX(),
+ (int32_t) otherPattern->GetY());
+ FX_FLOAT moduleSizeEst2 = SizeOfBlackWhiteBlackRunBothWays((int32_t) otherPattern->GetX(),
+ (int32_t) otherPattern->GetY(),
+ (int32_t) pattern->GetX(),
+ (int32_t) pattern->GetY());
if (FXSYS_isnan(moduleSizeEst1)) {
return moduleSizeEst2;
}
@@ -174,20 +174,20 @@ FX_FLOAT CBC_QRDetector::CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC }
return (moduleSizeEst1 + moduleSizeEst2) / 14.0f;
}
-FX_INT32 CBC_QRDetector::Round(FX_FLOAT d)
+int32_t CBC_QRDetector::Round(FX_FLOAT d)
{
- return (FX_INT32)(d + 0.5f);
+ return (int32_t)(d + 0.5f);
}
-FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY)
+FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY)
{
FX_FLOAT result = SizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);
- FX_INT32 otherToX = fromX - (toX - fromX);
+ int32_t otherToX = fromX - (toX - fromX);
if (otherToX < 0) {
otherToX = -1;
} else if (otherToX >= m_image->GetWidth()) {
otherToX = m_image->GetWidth();
}
- FX_INT32 otherToY = fromY - (toY - fromY);
+ int32_t otherToY = fromY - (toY - fromY);
if (otherToY < 0) {
otherToY = -1;
} else if (otherToY >= m_image->GetHeight()) {
@@ -196,26 +196,26 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT result += SizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);
return result - 1.0f;
}
-FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY)
+FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY)
{
FX_BOOL steep = FXSYS_abs(toY - fromY) > FXSYS_abs(toX - fromX);
if (steep) {
- FX_INT32 temp = fromX;
+ int32_t temp = fromX;
fromX = fromY;
fromY = temp;
temp = toX;
toX = toY;
toY = temp;
}
- FX_INT32 dx = FXSYS_abs(toX - fromX);
- FX_INT32 dy = FXSYS_abs(toY - fromY);
- FX_INT32 error = -dx >> 1;
- FX_INT32 ystep = fromY < toY ? 1 : -1;
- FX_INT32 xstep = fromX < toX ? 1 : -1;
- FX_INT32 state = 0;
- for (FX_INT32 x = fromX, y = fromY; x != toX; x += xstep) {
- FX_INT32 realX = steep ? y : x;
- FX_INT32 realY = steep ? x : y;
+ int32_t dx = FXSYS_abs(toX - fromX);
+ int32_t dy = FXSYS_abs(toY - fromY);
+ int32_t error = -dx >> 1;
+ int32_t ystep = fromY < toY ? 1 : -1;
+ int32_t xstep = fromX < toX ? 1 : -1;
+ int32_t state = 0;
+ for (int32_t x = fromX, y = fromY; x != toX; x += xstep) {
+ int32_t realX = steep ? y : x;
+ int32_t realY = steep ? x : y;
if (state == 1) {
if (m_image->Get(realX, realY)) {
state++;
@@ -226,8 +226,8 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY }
}
if (state == 3) {
- FX_INT32 diffX = x - fromX;
- FX_INT32 diffY = y - fromY;
+ int32_t diffX = x - fromX;
+ int32_t diffY = y - fromY;
return (FX_FLOAT) sqrt((double) (diffX * diffX + diffY * diffY));
}
error += dy;
@@ -236,22 +236,22 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY error -= dx;
}
}
- FX_INT32 diffX = toX - fromX;
- FX_INT32 diffY = toY - fromY;
+ int32_t diffX = toX - fromX;
+ int32_t diffY = toY - fromY;
return (FX_FLOAT) sqrt((double) (diffX * diffX + diffY * diffY));
}
-CBC_QRAlignmentPattern *CBC_QRDetector::FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX,
- FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e)
+CBC_QRAlignmentPattern *CBC_QRDetector::FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, int32_t estAlignmentX,
+ int32_t estAlignmentY, FX_FLOAT allowanceFactor, int32_t &e)
{
- FX_INT32 allowance = (FX_INT32) (allowanceFactor * overallEstModuleSize);
- FX_INT32 alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance);
- FX_INT32 alignmentAreaRightX = FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance);
+ int32_t allowance = (int32_t) (allowanceFactor * overallEstModuleSize);
+ int32_t alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance);
+ int32_t alignmentAreaRightX = FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance);
if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance);
- FX_INT32 alignmentAreaBottomY = FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance);
+ int32_t alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance);
+ int32_t alignmentAreaBottomY = FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance);
CBC_QRAlignmentPatternFinder alignmentFinder(m_image,
alignmentAreaLeftX,
alignmentAreaTopY,
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.h b/xfa/src/fxbarcode/qrcode/BC_QRDetector.h index 60c301cb7b..298ccf4d4c 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.h @@ -26,16 +26,16 @@ public: virtual ~CBC_QRDetector();
CBC_CommonBitMatrix* GetImage();
- CBC_QRDetectorResult* Detect(FX_INT32 hints, FX_INT32 &e);
- CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e);
+ CBC_QRDetectorResult* Detect(int32_t hints, int32_t &e);
+ CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, int32_t &e);
FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft);
FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern);
- FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);
- FX_FLOAT SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);
- CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX, FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e);
- static FX_INT32 Round(FX_FLOAT d);
- static FX_INT32 ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e);
+ FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY);
+ FX_FLOAT SizeOfBlackWhiteBlackRun(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY);
+ CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, int32_t estAlignmentX, int32_t estAlignmentY, FX_FLOAT allowanceFactor, int32_t &e);
+ static int32_t Round(FX_FLOAT d);
+ static int32_t ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, int32_t &e);
static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,
- CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, FX_INT32 dimension, FX_INT32 &e);
+ CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, int32_t dimension, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp index 369dc3a527..3734fab24d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp @@ -30,7 +30,7 @@ CBC_QRDetectorResult::CBC_QRDetectorResult(CBC_CommonBitMatrix *bits, CFX_PtrArr }
CBC_QRDetectorResult::~CBC_QRDetectorResult()
{
- for(FX_INT32 i = 0; i < m_points->GetSize(); i++) {
+ for(int32_t i = 0; i < m_points->GetSize(); i++) {
delete (CBC_ResultPoint*) (*m_points)[i];
}
m_points->RemoveAll();
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp index 8d1385e99a..dc08fc1e77 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp @@ -45,7 +45,7 @@ FX_FLOAT CBC_QRFinderPattern::GetEstimatedModuleSize() {
return m_estimatedModuleSize;
}
-FX_INT32 CBC_QRFinderPattern::GetCount()
+int32_t CBC_QRFinderPattern::GetCount()
{
return m_count;
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h index af88a727d9..919b0c1534 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h @@ -12,12 +12,12 @@ class CBC_QRFinderPattern : public CBC_ResultPoint {
private:
FX_FLOAT m_estimatedModuleSize;
- FX_INT32 m_count;
+ int32_t m_count;
public:
CBC_QRFinderPattern(FX_FLOAT x, FX_FLOAT posY, FX_FLOAT estimatedModuleSize);
virtual ~CBC_QRFinderPattern();
- FX_INT32 GetCount();
+ int32_t GetCount();
FX_FLOAT GetX();
FX_FLOAT GetY();
FX_FLOAT GetEstimatedModuleSize();
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp index da2d1231f8..975776db3f 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp @@ -26,10 +26,10 @@ #include "BC_QRFinderPatternFinder.h"
#include "BC_FinderPatternInfo.h"
#include "BC_QRFinderPattern.h"
-const FX_INT32 CBC_QRFinderPatternFinder::CENTER_QUORUM = 2;
-const FX_INT32 CBC_QRFinderPatternFinder::MIN_SKIP = 3;
-const FX_INT32 CBC_QRFinderPatternFinder::MAX_MODULES = 57;
-const FX_INT32 CBC_QRFinderPatternFinder::INTEGER_MATH_SHIFT = 8;
+const int32_t CBC_QRFinderPatternFinder::CENTER_QUORUM = 2;
+const int32_t CBC_QRFinderPatternFinder::MIN_SKIP = 3;
+const int32_t CBC_QRFinderPatternFinder::MAX_MODULES = 57;
+const int32_t CBC_QRFinderPatternFinder::INTEGER_MATH_SHIFT = 8;
CBC_QRFinderPatternFinder::CBC_QRFinderPatternFinder(CBC_CommonBitMatrix* image)
{
m_image = image;
@@ -38,7 +38,7 @@ CBC_QRFinderPatternFinder::CBC_QRFinderPatternFinder(CBC_CommonBitMatrix* image) }
CBC_QRFinderPatternFinder::~CBC_QRFinderPatternFinder()
{
- for(FX_INT32 i = 0; i < m_possibleCenters.GetSize(); i++) {
+ for(int32_t i = 0; i < m_possibleCenters.GetSize(); i++) {
delete (CBC_QRFinderPattern*)m_possibleCenters[i];
}
m_possibleCenters.RemoveAll();
@@ -51,7 +51,7 @@ public: ClosestToAverageComparator(FX_FLOAT averageModuleSize) : m_averageModuleSize(averageModuleSize)
{
}
- FX_INT32 operator()(FinderPattern *a, FinderPattern *b)
+ int32_t operator()(FinderPattern *a, FinderPattern *b)
{
FX_FLOAT dA = (FX_FLOAT)fabs(a->GetEstimatedModuleSize() - m_averageModuleSize);
FX_FLOAT dB = (FX_FLOAT)fabs(b->GetEstimatedModuleSize() - m_averageModuleSize);
@@ -61,7 +61,7 @@ public: class CenterComparator
{
public:
- FX_INT32 operator()(FinderPattern *a, FinderPattern *b)
+ int32_t operator()(FinderPattern *a, FinderPattern *b)
{
return b->GetCount() - a->GetCount();
}
@@ -83,25 +83,25 @@ CFX_PtrArray *CBC_QRFinderPatternFinder::GetPossibleCenters() {
return &m_possibleCenters;
}
-CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(FX_INT32 hint, FX_INT32 &e)
+CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(int32_t hint, int32_t &e)
{
- FX_INT32 maxI = m_image->GetHeight();
- FX_INT32 maxJ = m_image->GetWidth();
- FX_INT32 iSkip = (3 * maxI) / (4 * MAX_MODULES);
+ int32_t maxI = m_image->GetHeight();
+ int32_t maxJ = m_image->GetWidth();
+ int32_t iSkip = (3 * maxI) / (4 * MAX_MODULES);
if(iSkip < MIN_SKIP || 0) {
iSkip = MIN_SKIP;
}
FX_BOOL done = FALSE;
CFX_Int32Array stateCount;
stateCount.SetSize(5);
- for(FX_INT32 i = iSkip - 1; i < maxI && !done; i += iSkip) {
+ for(int32_t i = iSkip - 1; i < maxI && !done; i += iSkip) {
stateCount[0] = 0;
stateCount[1] = 0;
stateCount[2] = 0;
stateCount[3] = 0;
stateCount[4] = 0;
- FX_INT32 currentState = 0;
- for(FX_INT32 j = 0; j < maxJ; j++) {
+ int32_t currentState = 0;
+ for(int32_t j = 0; j < maxJ; j++) {
if(m_image->Get(j, i)) {
if((currentState & 1) == 1) {
currentState++;
@@ -117,7 +117,7 @@ CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(FX_INT32 hint, FX_INT32 if(m_hasSkipped) {
done = HaveMultiplyConfirmedCenters();
} else {
- FX_INT32 rowSkip = FindRowSkip();
+ int32_t rowSkip = FindRowSkip();
if(rowSkip > stateCount[2]) {
i += rowSkip - stateCount[2] - iSkip;
j = maxJ - 1;
@@ -202,15 +202,15 @@ FX_FLOAT CBC_QRFinderPatternFinder::Distance(CBC_ResultPoint* point1, CBC_Result FX_FLOAT dy = point1->GetY() - point2->GetY();
return (FX_FLOAT)FXSYS_sqrt(dx * dx + dy * dy);
}
-FX_FLOAT CBC_QRFinderPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end)
+FX_FLOAT CBC_QRFinderPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end)
{
return (FX_FLOAT)(end - stateCount[4] - stateCount[3]) - stateCount[2] / 2.0f;
}
FX_BOOL CBC_QRFinderPatternFinder::FoundPatternCross(const CFX_Int32Array &stateCount)
{
- FX_INT32 totalModuleSize = 0;
- for (FX_INT32 i = 0; i < 5; i++) {
- FX_INT32 count = stateCount[i];
+ int32_t totalModuleSize = 0;
+ for (int32_t i = 0; i < 5; i++) {
+ int32_t count = stateCount[i];
if (count == 0) {
return FALSE;
}
@@ -219,21 +219,21 @@ FX_BOOL CBC_QRFinderPatternFinder::FoundPatternCross(const CFX_Int32Array &state if (totalModuleSize < 7) {
return FALSE;
}
- FX_INT32 moduleSize = (totalModuleSize << INTEGER_MATH_SHIFT) / 7;
- FX_INT32 maxVariance = moduleSize / 2;
+ int32_t moduleSize = (totalModuleSize << INTEGER_MATH_SHIFT) / 7;
+ int32_t maxVariance = moduleSize / 2;
return FXSYS_abs(moduleSize - (stateCount[0] << INTEGER_MATH_SHIFT)) < maxVariance &&
FXSYS_abs(moduleSize - (stateCount[1] << INTEGER_MATH_SHIFT)) < maxVariance &&
FXSYS_abs(3 * moduleSize - (stateCount[2] << INTEGER_MATH_SHIFT)) < 3 * maxVariance &&
FXSYS_abs(moduleSize - (stateCount[3] << INTEGER_MATH_SHIFT)) < maxVariance &&
FXSYS_abs(moduleSize - (stateCount[4] << INTEGER_MATH_SHIFT)) < maxVariance;
}
-FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount,
- FX_INT32 originalStateCountTotal)
+FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount,
+ int32_t originalStateCountTotal)
{
CBC_CommonBitMatrix *image = m_image;
- FX_INT32 maxI = image->GetHeight();
+ int32_t maxI = image->GetHeight();
CFX_Int32Array &stateCount = GetCrossCheckStateCount();
- FX_INT32 i = startI;
+ int32_t i = startI;
while(i >= 0 && image->Get(centerJ, i)) {
stateCount[2]++;
i--;
@@ -277,18 +277,18 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 if (stateCount[4] >= maxCount) {
return FXSYS_nan();
}
- FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
+ int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
if (5 * FXSYS_abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) {
return FXSYS_nan();
}
return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, i) : FXSYS_nan();
}
-FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT32 centerI, FX_INT32 maxCount, FX_INT32 originalStateCountTotal)
+FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(int32_t startJ, int32_t centerI, int32_t maxCount, int32_t originalStateCountTotal)
{
CBC_CommonBitMatrix *image = m_image;
- FX_INT32 maxJ = image->GetWidth();
+ int32_t maxJ = image->GetWidth();
CFX_Int32Array &stateCount = GetCrossCheckStateCount();
- FX_INT32 j = startJ;
+ int32_t j = startJ;
while (j >= 0 && image->Get(j, centerI)) {
stateCount[2]++;
j--;
@@ -332,7 +332,7 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT if (stateCount[4] >= maxCount) {
return FXSYS_nan();
}
- FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] +
+ int32_t stateCountTotal = stateCount[0] + stateCount[1] +
stateCount[2] + stateCount[3] +
stateCount[4];
if (5 * FXSYS_abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) {
@@ -340,18 +340,18 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT }
return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, j) : FXSYS_nan();
}
-FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j)
+FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j)
{
- FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
+ int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
FX_FLOAT centerJ = CenterFromEnd(stateCount, j);
- FX_FLOAT centerI = CrossCheckVertical(i, (FX_INT32) centerJ, stateCount[2], stateCountTotal);
+ FX_FLOAT centerI = CrossCheckVertical(i, (int32_t) centerJ, stateCount[2], stateCountTotal);
if(!FXSYS_isnan(centerI)) {
- centerJ = CrossCheckHorizontal((FX_INT32) centerJ, (FX_INT32) centerI, stateCount[2], stateCountTotal);
+ centerJ = CrossCheckHorizontal((int32_t) centerJ, (int32_t) centerI, stateCount[2], stateCountTotal);
if(!FXSYS_isnan(centerJ)) {
FX_FLOAT estimatedModuleSize = (FX_FLOAT) stateCountTotal / 7.0f;
FX_BOOL found = FALSE;
- FX_INT32 max = m_possibleCenters.GetSize();
- for(FX_INT32 index = 0; index < max; index++) {
+ int32_t max = m_possibleCenters.GetSize();
+ for(int32_t index = 0; index < max; index++) {
CBC_QRFinderPattern *center = (CBC_QRFinderPattern*)(m_possibleCenters[index]);
if(center->AboutEquals(estimatedModuleSize, centerI, centerJ)) {
center->IncrementCount();
@@ -367,21 +367,21 @@ FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &st }
return FALSE;
}
-FX_INT32 CBC_QRFinderPatternFinder::FindRowSkip()
+int32_t CBC_QRFinderPatternFinder::FindRowSkip()
{
- FX_INT32 max = m_possibleCenters.GetSize();
+ int32_t max = m_possibleCenters.GetSize();
if (max <= 1) {
return 0;
}
FinderPattern *firstConfirmedCenter = NULL;
- for (FX_INT32 i = 0; i < max; i++) {
+ for (int32_t i = 0; i < max; i++) {
CBC_QRFinderPattern *center = (CBC_QRFinderPattern*)m_possibleCenters[i];
if (center->GetCount() >= CENTER_QUORUM) {
if (firstConfirmedCenter == NULL) {
firstConfirmedCenter = center;
} else {
m_hasSkipped = TRUE;
- return (FX_INT32) ((fabs(firstConfirmedCenter->GetX() - center->GetX()) -
+ return (int32_t) ((fabs(firstConfirmedCenter->GetX() - center->GetX()) -
fabs(firstConfirmedCenter->GetY() - center->GetY())) / 2);
}
}
@@ -390,10 +390,10 @@ FX_INT32 CBC_QRFinderPatternFinder::FindRowSkip() }
FX_BOOL CBC_QRFinderPatternFinder::HaveMultiplyConfirmedCenters()
{
- FX_INT32 confirmedCount = 0;
+ int32_t confirmedCount = 0;
FX_FLOAT totalModuleSize = 0.0f;
- FX_INT32 max = m_possibleCenters.GetSize();
- FX_INT32 i;
+ int32_t max = m_possibleCenters.GetSize();
+ int32_t i;
for (i = 0; i < max; i++) {
CBC_QRFinderPattern *pattern = (CBC_QRFinderPattern*)m_possibleCenters[i];
if (pattern->GetCount() >= CENTER_QUORUM) {
@@ -416,9 +416,9 @@ inline FX_BOOL centerComparator(FX_LPVOID a, FX_LPVOID b) {
return ((CBC_QRFinderPattern*)b)->GetCount() < ((CBC_QRFinderPattern*)a)->GetCount();
}
-CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(FX_INT32 &e)
+CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(int32_t &e)
{
- FX_INT32 startSize = m_possibleCenters.GetSize();
+ int32_t startSize = m_possibleCenters.GetSize();
if(m_possibleCenters.GetSize() < 3) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -426,11 +426,11 @@ CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(FX_INT32 &e) FX_FLOAT average = 0.0f;
if(startSize > 3) {
FX_FLOAT totalModuleSize = 0.0f;
- for(FX_INT32 i = 0; i < startSize; i++) {
+ for(int32_t i = 0; i < startSize; i++) {
totalModuleSize += ((CBC_QRFinderPattern*)m_possibleCenters[i])->GetEstimatedModuleSize();
}
average = totalModuleSize / (FX_FLOAT)startSize;
- for(FX_INT32 j = 0; j < m_possibleCenters.GetSize() && m_possibleCenters.GetSize() > 3; j++) {
+ for(int32_t j = 0; j < m_possibleCenters.GetSize() && m_possibleCenters.GetSize() > 3; j++) {
CBC_QRFinderPattern *pattern = (CBC_QRFinderPattern*)m_possibleCenters[j];
if(fabs(pattern->GetEstimatedModuleSize() - average) > 0.2f * average) {
delete pattern;
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h index d0fde46542..f24d22bed2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h @@ -14,10 +14,10 @@ class CBC_QRFinderPatternInfo; class CBC_QRFinderPatternFinder
{
private:
- const static FX_INT32 CENTER_QUORUM;
- const static FX_INT32 MIN_SKIP;
- const static FX_INT32 MAX_MODULES;
- const static FX_INT32 INTEGER_MATH_SHIFT;
+ const static int32_t CENTER_QUORUM;
+ const static int32_t MIN_SKIP;
+ const static int32_t MAX_MODULES;
+ const static int32_t INTEGER_MATH_SHIFT;
FX_BOOL m_hasSkipped;
CBC_CommonBitMatrix* m_image;
CFX_Int32Array m_crossCheckStateCount;
@@ -25,19 +25,19 @@ private: public:
CBC_QRFinderPatternFinder(CBC_CommonBitMatrix *image);
virtual ~CBC_QRFinderPatternFinder();
- FX_INT32 FindRowSkip();
+ int32_t FindRowSkip();
CBC_CommonBitMatrix* GetImage();
- CBC_QRFinderPatternInfo* Find(FX_INT32 hint, FX_INT32 &e);
+ CBC_QRFinderPatternInfo* Find(int32_t hint, int32_t &e);
CFX_Int32Array &GetCrossCheckStateCount();
CFX_PtrArray *GetPossibleCenters();
- CFX_PtrArray *SelectBestpatterns(FX_INT32 &e);
+ CFX_PtrArray *SelectBestpatterns(int32_t &e);
- FX_BOOL HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j);
+ FX_BOOL HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j);
FX_BOOL HaveMultiplyConfirmedCenters();
- FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end);
- FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal);
- FX_FLOAT CrossCheckHorizontal(FX_INT32 startJ, FX_INT32 CenterI, FX_INT32 maxCOunt, FX_INT32 originalStateCountTotal);
+ FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end);
+ FX_FLOAT CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount, int32_t originalStateCountTotal);
+ FX_FLOAT CrossCheckHorizontal(int32_t startJ, int32_t CenterI, int32_t maxCOunt, int32_t originalStateCountTotal);
static void OrderBestPatterns(CFX_PtrArray *patterns);
static FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount);
static FX_FLOAT Distance(CBC_ResultPoint* point1, CBC_ResultPoint* point2);
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp index 8783078690..a5e478e1da 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp @@ -35,15 +35,15 @@ CBC_QRGridSampler &CBC_QRGridSampler::GetInstance() {
return m_gridSampler;
}
-void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, FX_INT32 &e)
+void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, int32_t &e)
{
- FX_INT32 width = image->GetWidth();
- FX_INT32 height = image->GetHeight();
+ int32_t width = image->GetWidth();
+ int32_t height = image->GetHeight();
FX_BOOL nudged = TRUE;
- FX_INT32 offset;
+ int32_t offset;
for (offset = 0; offset < points->GetSize() && nudged; offset += 2) {
- FX_INT32 x = (FX_INT32) (*points)[offset];
- FX_INT32 y = (FX_INT32) (*points)[offset + 1];
+ int32_t x = (int32_t) (*points)[offset];
+ int32_t y = (int32_t) (*points)[offset + 1];
if (x < -1 || x > width || y < -1 || y > height) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -66,8 +66,8 @@ void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_Floa }
nudged = TRUE;
for (offset = (*points).GetSize() - 2; offset >= 0 && nudged; offset -= 2) {
- FX_INT32 x = (FX_INT32) (*points)[offset];
- FX_INT32 y = (FX_INT32) (*points)[offset + 1];
+ int32_t x = (int32_t) (*points)[offset];
+ int32_t y = (int32_t) (*points)[offset + 1];
if (x < -1 || x > width || y < -1 || y > height) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -89,7 +89,7 @@ void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_Floa }
}
}
-CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, FX_INT32 dimensionX, FX_INT32 dimensionY,
+CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, int32_t dimensionX, int32_t dimensionY,
FX_FLOAT p1ToX, FX_FLOAT p1ToY,
FX_FLOAT p2ToX, FX_FLOAT p2ToY,
FX_FLOAT p3ToX, FX_FLOAT p3ToY,
@@ -97,7 +97,7 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F FX_FLOAT p1FromX, FX_FLOAT p1FromY,
FX_FLOAT p2FromX, FX_FLOAT p2FromY,
FX_FLOAT p3FromX, FX_FLOAT p3FromY,
- FX_FLOAT p4FromX, FX_FLOAT p4FromY, FX_INT32 &e)
+ FX_FLOAT p4FromX, FX_FLOAT p4FromY, int32_t &e)
{
CBC_AutoPtr<CBC_CommonPerspectiveTransform> transform(CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(
p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY,
@@ -107,10 +107,10 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F CBC_AutoPtr<CBC_CommonBitMatrix> bits(tempBitM);
CFX_FloatArray points;
points.SetSize(dimensionX << 1);
- for (FX_INT32 y = 0; y < dimensionY; y++) {
- FX_INT32 max = points.GetSize();
+ for (int32_t y = 0; y < dimensionY; y++) {
+ int32_t max = points.GetSize();
FX_FLOAT iValue = (FX_FLOAT) (y + 0.5f);
- FX_INT32 x;
+ int32_t x;
for (x = 0; x < max; x += 2) {
points[x] = (FX_FLOAT) ((x >> 1) + 0.5f);
points[x + 1] = iValue;
@@ -119,7 +119,7 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F CheckAndNudgePoints(image, &points, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
for (x = 0; x < max; x += 2) {
- if (image->Get((FX_INT32) points[x], (FX_INT32) points[x + 1])) {
+ if (image->Get((int32_t) points[x], (int32_t) points[x + 1])) {
bits->Set(x >> 1, y);
}
}
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h index 0b8c7d3ab7..c7abf75f8d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h @@ -17,7 +17,7 @@ private: public:
CBC_QRGridSampler();
virtual ~CBC_QRGridSampler();
- virtual CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, FX_INT32 dimensionX, FX_INT32 dimensionY,
+ virtual CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, int32_t dimensionX, int32_t dimensionY,
FX_FLOAT p1ToX, FX_FLOAT p1ToY,
FX_FLOAT p2ToX, FX_FLOAT p2ToY,
FX_FLOAT p3ToX, FX_FLOAT p3ToY,
@@ -25,9 +25,9 @@ public: FX_FLOAT p1FromX, FX_FLOAT p1FromY,
FX_FLOAT p2FromX, FX_FLOAT p2FromY,
FX_FLOAT p3FromX, FX_FLOAT p3FromY,
- FX_FLOAT p4FromX, FX_FLOAT p4FromY, FX_INT32 &e);
+ FX_FLOAT p4FromX, FX_FLOAT p4FromY, int32_t &e);
static CBC_QRGridSampler &GetInstance();
- static void CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, FX_INT32 &e);
+ static void CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/utils.h b/xfa/src/fxbarcode/utils.h index ecaadccef0..9639ba8504 100644 --- a/xfa/src/fxbarcode/utils.h +++ b/xfa/src/fxbarcode/utils.h @@ -6,9 +6,9 @@ #ifndef _BC_UTILS_H_
#define _BC_UTILS_H_
-typedef CFX_MapPtrTemplate<FX_LPVOID, FX_INT32> CFX_PtrToInt32;
-FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c);
-void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c);
+typedef CFX_MapPtrTemplate<FX_LPVOID, int32_t> CFX_PtrToInt32;
+FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, int32_t count, FX_CHAR c);
+void BC_FX_ByteString_Append(CFX_ByteString &dst, int32_t count, FX_CHAR c);
void BC_FX_ByteString_Append(CFX_ByteString &dst, const CFX_ByteArray &ba);
typedef FX_BOOL (*BC_PtrArrayCompareCallback)(FX_LPVOID l, FX_LPVOID r);
void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun);
diff --git a/xfa/src/fxfa/src/app/xfa_checksum.cpp b/xfa/src/fxfa/src/app/xfa_checksum.cpp index 0ed07bb579..9f4345f408 100644 --- a/xfa/src/fxfa/src/app/xfa_checksum.cpp +++ b/xfa/src/fxfa/src/app/xfa_checksum.cpp @@ -112,7 +112,7 @@ void CXFA_SAXReaderHandler::OnTargetData(FX_LPVOID pTag, FX_SAXNODE eType, FX_BS }
void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace)
{
- FX_INT32 iLength = m_SAXContext.m_TextBuf.GetLength();
+ int32_t iLength = m_SAXContext.m_TextBuf.GetLength();
if (iLength < 1) {
return;
}
@@ -120,7 +120,7 @@ void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) FX_BOOL bUpdata = TRUE;
if (bCheckSpace) {
bUpdata = FALSE;
- for (FX_INT32 i = 0; i < iLength; i++) {
+ for (int32_t i = 0; i < iLength; i++) {
bUpdata = (pBuffer[i] > 0x20);
if (bUpdata) {
break;
@@ -148,7 +148,7 @@ CXFA_ChecksumContext::~CXFA_ChecksumContext() FX_BOOL CXFA_ChecksumContext::StartChecksum()
{
FinishChecksum();
- m_pByteContext = FX_Alloc(FX_BYTE, 128);
+ m_pByteContext = FX_Alloc(uint8_t, 128);
FXSYS_assert(m_pByteContext != NULL);
CRYPT_SHA1Start(m_pByteContext);
m_bsChecksum.Empty();
@@ -180,10 +180,10 @@ void CXFA_ChecksumContext::FinishChecksum() m_pSAXReader = NULL;
}
if (m_pByteContext) {
- FX_BYTE digest[20];
+ uint8_t digest[20];
FXSYS_memset(digest, 0, 20);
CRYPT_SHA1Finish(m_pByteContext, digest);
- FX_INT32 nLen = FX_Base64EncodeA(digest, 20, NULL);
+ int32_t nLen = FX_Base64EncodeA(digest, 20, NULL);
FX_LPSTR pBuffer = m_bsChecksum.GetBuffer(nLen);
FX_Base64EncodeA(digest, 20, pBuffer);
m_bsChecksum.ReleaseBuffer(nLen);
diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp index de46a33b32..ad68812aa9 100644 --- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp @@ -15,20 +15,20 @@ CXFA_FFConfigAcc::CXFA_FFConfigAcc(CXFA_Node *pNode) CXFA_FFConfigAcc::~CXFA_FFConfigAcc()
{
}
-FX_INT32 CXFA_FFConfigAcc::CountChildren()
+int32_t CXFA_FFConfigAcc::CountChildren()
{
GetPsMapNode();
if (m_pPsMapNode == NULL) {
return 0;
}
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_Node* pNode = m_pPsMapNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
iCount++;
}
return iCount;
}
-FX_BOOL CXFA_FFConfigAcc::GetFontInfo(FX_INT32 index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic)
+FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic)
{
if (index < 0 || index >= CountChildren()) {
return FALSE;
diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h index 73237b9f01..5a21fd3a00 100644 --- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h +++ b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h @@ -11,8 +11,8 @@ class CXFA_FFConfigAcc public:
CXFA_FFConfigAcc(CXFA_Node *pNode);
~CXFA_FFConfigAcc();
- FX_INT32 CountChildren();
- FX_BOOL GetFontInfo(FX_INT32 index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic);
+ int32_t CountChildren();
+ FX_BOOL GetFontInfo(int32_t index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic);
private:
void GetPsMapNode();
CXFA_Node *m_pNode;
diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.cpp b/xfa/src/fxfa/src/app/xfa_ffapp.cpp index ea5136955b..2fc52722ef 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffapp.cpp @@ -28,10 +28,10 @@ FX_FILESIZE CXFA_FileRead::GetSize() if (m_StreamSize.GetSize() > 0) {
return m_dwSize;
}
- FX_INT32 iCount = m_Streams.GetSize();
+ int32_t iCount = m_Streams.GetSize();
FX_DWORD iBufferSize = 4096;
- FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, iBufferSize);
- for (FX_INT32 i = 0; i < iCount; i++) {
+ FX_LPBYTE pBuf = FX_Alloc(uint8_t, iBufferSize);
+ for (int32_t i = 0; i < iCount; i++) {
CPDF_StreamFilter* pStreamFilter = m_Streams[i]->GetStreamFilter(FALSE);
FX_DWORD dwCurSize = 0;
while (TRUE) {
@@ -51,8 +51,8 @@ FX_FILESIZE CXFA_FileRead::GetSize() FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
FX_FILESIZE dwLen = 0;
- FX_INT32 iCount = m_Streams.GetSize();
- FX_INT32 i = 0;
+ int32_t iCount = m_Streams.GetSize();
+ int32_t i = 0;
for (; i < iCount; i++) {
dwLen += m_StreamSize[i];
if (dwLen > offset) {
@@ -65,7 +65,7 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) }
CPDF_StreamFilter* pStreamFilter = m_Streams[i]->GetStreamFilter(FALSE);
if ((offset -= dwLen) > 0) {
- FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, offset);
+ FX_LPBYTE pBuf = FX_Alloc(uint8_t, offset);
FX_DWORD dwRead = pStreamFilter->ReadBlock(pBuf, offset);
FX_Free(pBuf);
}
@@ -76,7 +76,7 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) return TRUE;
}
FX_DWORD dwReadSize = dwHadRead;
- for (FX_INT32 iStart = i + 1; iStart < iCount; iStart++) {
+ for (int32_t iStart = i + 1; iStart < iCount; iStart++) {
CPDF_StreamFilter* pStreamFilter = m_Streams[iStart]->GetStreamFilter(FALSE);
FX_DWORD dwHadRead = pStreamFilter->ReadBlock(((FX_LPBYTE)buffer) + dwReadSize, size);
delete pStreamFilter;
@@ -90,8 +90,8 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) }
CXFA_FileRead2::CXFA_FileRead2(const CFX_ArrayTemplate<CPDF_Stream*> &streams)
{
- FX_INT32 iCount = streams.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = streams.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CPDF_StreamAcc &acc = m_Data.Add();
acc.LoadAllData(streams[i]);
}
@@ -99,8 +99,8 @@ CXFA_FileRead2::CXFA_FileRead2(const CFX_ArrayTemplate<CPDF_Stream*> &streams) FX_FILESIZE CXFA_FileRead2::GetSize()
{
FX_DWORD dwSize = 0;
- FX_INT32 iCount = m_Data.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_Data.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CPDF_StreamAcc &acc = m_Data[i];
dwSize += acc.GetSize();
}
@@ -108,8 +108,8 @@ FX_FILESIZE CXFA_FileRead2::GetSize() }
FX_BOOL CXFA_FileRead2::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
- FX_INT32 iCount = m_Data.GetSize();
- FX_INT32 index = 0;
+ int32_t iCount = m_Data.GetSize();
+ int32_t index = 0;
while (index < iCount) {
CPDF_StreamAcc &acc = m_Data[index];
FX_FILESIZE dwSize = acc.GetSize();
diff --git a/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp b/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp index f87009daf3..39f11b5a32 100644 --- a/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp @@ -40,7 +40,7 @@ FX_BOOL CXFA_FFBarcode::LoadWidget() m_pNormalWidget->UnlockUpdate();
return CXFA_FFField::LoadWidget();
}
-void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -69,7 +69,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo = XFA_GetBarcodeTypeByName(wsType);
pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType);
CXFA_WidgetAcc *pAcc = GetDataAcc();
- FX_INT32 intVal;
+ int32_t intVal;
FX_CHAR charVal;
FX_BOOL boolVal;
FX_FLOAT floatVal;
@@ -107,7 +107,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() pBarCodeWidget->SetTruncated(boolVal);
}
if (pAcc->GetBarcodeAttribute_WideNarrowRatio(floatVal)) {
- pBarCodeWidget->SetWideNarrowRatio((FX_INT32)floatVal);
+ pBarCodeWidget->SetWideNarrowRatio((int32_t)floatVal);
}
if (pBarcodeTypeInfo->eName == XFA_BARCODETYPE_code3Of9
|| pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8
@@ -199,17 +199,17 @@ extern const XFA_BARCODETYPEENUMINFO g_XFABarCodeTypeEnumData[] = { {0xfaeaf37f, L"postUSStandard", XFA_BARCODETYPE_postUSStandard, BC_UNKNOWN},
{0xfb48155c, L"code3Of9", XFA_BARCODETYPE_code3Of9, BC_CODE39},
};
-extern const FX_INT32 g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO);
+extern const int32_t g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO);
static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(FX_WSTR wsName)
{
- FX_INT32 iLength = wsName.GetLength();
+ int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE);
- FX_INT32 iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE);
+ int32_t iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCBARCODETYPEENUMINFO pInfo = g_XFABarCodeTypeEnumData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
diff --git a/xfa/src/fxfa/src/app/xfa_ffbarcode.h b/xfa/src/fxfa/src/app/xfa_ffbarcode.h index 35b4212efa..d6589c090a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffbarcode.h +++ b/xfa/src/fxfa/src/app/xfa_ffbarcode.h @@ -13,7 +13,7 @@ public: CXFA_FFBarcode(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFBarcode();
virtual FX_BOOL LoadWidget();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual void UpdateWidgetProperty();
virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -83,7 +83,7 @@ enum XFA_BARCODETYPEENUM { XFA_BARCODETYPE_upsMaxicode
};
struct XFA_BARCODETYPEENUMINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
XFA_BARCODETYPEENUM eName;
BC_TYPE eBCType;
diff --git a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp index 6115d61bcd..3cb3628aca 100644 --- a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp @@ -54,7 +54,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() FX_FLOAT fSize = m_pDataAcc->GetCheckButtonSize();
pCheckBox->SetBoxSize(fSize);
FX_DWORD dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross;
- FX_INT32 iCheckMark = m_pDataAcc->GetCheckButtonMark();
+ int32_t iCheckMark = m_pDataAcc->GetCheckButtonMark();
switch(iCheckMark) {
case XFA_ATTRIBUTEENUM_Check:
dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck;
@@ -74,7 +74,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() dwStyleEx = FWL_STYLEEXT_CKB_SignShapeStar;
break;
default: {
- FX_INT32 iShape = m_pDataAcc->GetCheckButtonShape();
+ int32_t iShape = m_pDataAcc->GetCheckButtonShape();
if (iShape == XFA_ATTRIBUTEENUM_Round) {
dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle;
}
@@ -96,7 +96,7 @@ FX_BOOL CXFA_FFCheckButton::LayoutWidget() if (mgWidget.IsExistInXML()) {
XFA_RectWidthoutMargin(rtWidget, mgWidget);
}
- FX_INT32 iCapPlacement = -1;
+ int32_t iCapPlacement = -1;
FX_FLOAT fCapReserve = 0;
CXFA_Caption caption = m_pDataAcc->GetCaption();
if (caption.IsExistInXML() && caption.GetPresence()) {
@@ -111,8 +111,8 @@ FX_BOOL CXFA_FFCheckButton::LayoutWidget() }
}
}
- FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left;
- FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top;
+ int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left;
+ int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
iHorzAlign = para.GetHorizontalAlign();
iVertAlign = para.GetVerticalAlign();
@@ -194,7 +194,7 @@ void CXFA_FFCheckButton::CapLeftRightPlacement(CXFA_Margin mgCap) m_rtCaption.width = -m_rtCaption.width;
}
}
-void CXFA_FFCheckButton::AddUIMargin(FX_INT32 iCapPlacement)
+void CXFA_FFCheckButton::AddUIMargin(int32_t iCapPlacement)
{
CFX_RectF rtUIMargin;
m_pDataAcc->GetUIMargin(rtUIMargin);
@@ -217,7 +217,7 @@ void CXFA_FFCheckButton::AddUIMargin(FX_INT32 iCapPlacement) m_rtUI.height += 2 * (fTopAddBottom - m_rtUI.height);
}
}
-void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -296,7 +296,7 @@ FX_BOOL CXFA_FFCheckButton::UpdateFWLData() m_pNormalWidget->Update();
return TRUE;
}
-FX_INT32 CXFA_FFCheckButton::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h index 5c32a6d966..a3abfb6891 100644 --- a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h +++ b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h @@ -12,7 +12,7 @@ class CXFA_FFCheckButton : public CXFA_FFField public:
CXFA_FFCheckButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFCheckButton();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL LoadWidget();
virtual FX_BOOL LayoutWidget();
@@ -20,7 +20,7 @@ public: virtual void UpdateWidgetProperty();
virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
void SetFWLCheckState(XFA_CHECKSTATE eCheckState);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
@@ -28,7 +28,7 @@ protected: virtual FX_BOOL CommitData();
virtual FX_BOOL IsDataChanged();
void CapLeftRightPlacement(CXFA_Margin mgCap);
- void AddUIMargin(FX_INT32 iCapPlacement);
+ void AddUIMargin(int32_t iCapPlacement);
XFA_CHECKSTATE FWLState2XFAState();
IFWL_WidgetDelegate* m_pOldDelegate;
CFX_RectF m_rtCheckBox;
diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp index 81b7ccb76f..47685a28a7 100644 --- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp @@ -40,8 +40,8 @@ FX_BOOL CXFA_FFListBox::LoadWidget() m_pNormalWidget->LockUpdate();
CFX_WideStringArray wsLabelArray;
m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
- FX_INT32 iItems = wsLabelArray.GetSize();
- for (FX_INT32 i = 0; i < iItems; i++) {
+ int32_t iItems = wsLabelArray.GetSize();
+ for (int32_t i = 0; i < iItems; i++) {
pListBox->AddString(wsLabelArray[i]);
}
FX_DWORD dwExtendedStyle = FWL_STYLEEXT_LTB_ShowScrollBarFocus;
@@ -52,8 +52,8 @@ FX_BOOL CXFA_FFListBox::LoadWidget() m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
- FX_INT32 iSelCount = iSelArray.GetSize();
- for (FX_INT32 j = 0; j < iSelCount; j++) {
+ int32_t iSelCount = iSelArray.GetSize();
+ for (int32_t j = 0; j < iSelCount; j++) {
FWL_HLISTITEM item = pListBox->GetItem(iSelArray[j]);
pListBox->SetSelItem(item, TRUE);
}
@@ -73,9 +73,9 @@ FX_BOOL CXFA_FFListBox::CommitData() {
FXSYS_assert(m_pNormalWidget != NULL);
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
- FX_INT32 iSels = pListBox->CountSelItems();
+ int32_t iSels = pListBox->CountSelItems();
CFX_Int32Array iSelArray;
- for (FX_INT32 i = 0; i < iSels; i++) {
+ for (int32_t i = 0; i < iSels; i++) {
iSelArray.Add(pListBox->GetSelIndex(i));
}
m_pDataAcc->SetSelectdItems(iSelArray, TRUE);
@@ -85,11 +85,11 @@ FX_BOOL CXFA_FFListBox::IsDataChanged() {
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
- FX_INT32 iOldSels = iSelArray.GetSize();
+ int32_t iOldSels = iSelArray.GetSize();
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
- FX_INT32 iSels = pListBox->CountSelItems();
+ int32_t iSels = pListBox->CountSelItems();
if (iOldSels == iSels) {
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
for (; iIndex < iSels; iIndex++) {
FWL_HLISTITEM hlistItem = pListBox->GetItem(iSelArray[iIndex]);
if(!(pListBox->GetItemStates(hlistItem) && FWL_ITEMSTATE_LTB_Selected)) {
@@ -106,7 +106,7 @@ FX_DWORD CXFA_FFListBox::GetAlignment() {
FX_DWORD dwExtendedStyle = 0;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
- FX_INT32 iHorz = para.GetHorizontalAlign();
+ int32_t iHorz = para.GetHorizontalAlign();
switch(iHorz) {
case XFA_ATTRIBUTEENUM_Center:
dwExtendedStyle |= FWL_STYLEEXT_LTB_CenterAlign;
@@ -136,13 +136,13 @@ FX_BOOL CXFA_FFListBox::UpdateFWLData() CFX_ArrayTemplate<FWL_HLISTITEM> selItemArray;
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
- FX_INT32 iSelCount = iSelArray.GetSize();
- for (FX_INT32 j = 0; j < iSelCount; j++) {
+ int32_t iSelCount = iSelArray.GetSize();
+ for (int32_t j = 0; j < iSelCount; j++) {
FWL_HLISTITEM lpItemSel = pListBox->GetSelItem(iSelArray[j]);
selItemArray.Add(lpItemSel);
}
pListBox->SetSelItem(pListBox->GetSelItem(-1), FALSE);
- for(FX_INT32 i = 0; i < iSelCount; i++) {
+ for(int32_t i = 0; i < iSelCount; i++) {
((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], TRUE);
}
m_pNormalWidget->Update();
@@ -155,27 +155,27 @@ void CXFA_FFListBox::OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array eParam.m_pTarget = m_pDataAcc;
m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw);
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
- FX_INT32 iSels = pListBox->CountSelItems();
+ int32_t iSels = pListBox->CountSelItems();
if (iSels > 0) {
pListBox->GetItemText(pListBox->GetSelItem(0), eParam.m_wsNewText);
}
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
-void CXFA_FFListBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected)
+void CXFA_FFListBox::SetItemState(int32_t nIndex, FX_BOOL bSelected)
{
FWL_HLISTITEM item = ((CFWL_ListBox*)m_pNormalWidget)->GetSelItem(nIndex);
((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(item, bSelected);
m_pNormalWidget->Update();
AddInvalidateRect();
}
-void CXFA_FFListBox::InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex )
+void CXFA_FFListBox::InsertItem(FX_WSTR wsLabel, int32_t nIndex )
{
CFX_WideString wsTemp(wsLabel);
((CFWL_ListBox*)m_pNormalWidget)->AddString(wsTemp);
m_pNormalWidget->Update();
AddInvalidateRect();
}
-void CXFA_FFListBox::DeleteItem(FX_INT32 nIndex)
+void CXFA_FFListBox::DeleteItem(int32_t nIndex)
{
if (nIndex < 0) {
((CFWL_ListBox*)m_pNormalWidget)->DeleteAll();
@@ -185,7 +185,7 @@ void CXFA_FFListBox::DeleteItem(FX_INT32 nIndex) m_pNormalWidget->Update();
AddInvalidateRect();
}
-FX_INT32 CXFA_FFListBox::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFListBox::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
@@ -260,13 +260,13 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() m_pNormalWidget->LockUpdate();
CFX_WideStringArray wsLabelArray;
m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
- FX_INT32 iItems = wsLabelArray.GetSize();
- for (FX_INT32 i = 0; i < iItems; i++) {
+ int32_t iItems = wsLabelArray.GetSize();
+ for (int32_t i = 0; i < iItems; i++) {
pComboBox->AddString(wsLabelArray[i]);
}
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
- FX_INT32 iSelCount = iSelArray.GetSize();
+ int32_t iSelCount = iSelArray.GetSize();
if (iSelCount > 0) {
pComboBox->SetCurSel(iSelArray[0]);
} else {
@@ -334,7 +334,7 @@ FX_BOOL CXFA_FFComboBox::IsDataChanged() CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget);
CFX_WideString wsText;
pFWLcombobox->GetEditText(wsText);
- FX_INT32 iCursel = pFWLcombobox->GetCurSel();
+ int32_t iCursel = pFWLcombobox->GetCurSel();
if (iCursel >= 0) {
CFX_WideString wsSel;
pFWLcombobox->GetTextByIndex(iCursel, wsSel);
@@ -362,7 +362,7 @@ FX_DWORD CXFA_FFComboBox::GetAlignment() {
FX_DWORD dwExtendedStyle = 0;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
- FX_INT32 iHorz = para.GetHorizontalAlign();
+ int32_t iHorz = para.GetHorizontalAlign();
switch(iHorz) {
case XFA_ATTRIBUTEENUM_Center:
dwExtendedStyle |= FWL_STYLEEXT_CMB_EditHCenter | FWL_STYLEEXT_CMB_ListItemCenterAlign;
@@ -380,7 +380,7 @@ FX_DWORD CXFA_FFComboBox::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_CMB_EditHNear | FWL_STYLEEXT_CMB_ListItemLeftAlign;
break;
}
- FX_INT32 iVert = para.GetVerticalAlign();
+ int32_t iVert = para.GetVerticalAlign();
switch(iVert) {
case XFA_ATTRIBUTEENUM_Middle:
dwExtendedStyle |= FWL_STYLEEXT_CMB_EditVCenter;
@@ -402,7 +402,7 @@ FX_BOOL CXFA_FFComboBox::UpdateFWLData() }
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
- FX_INT32 iSelCount = iSelArray.GetSize();
+ int32_t iSelCount = iSelArray.GetSize();
if (iSelCount > 0) {
((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(iSelArray[0]);
} else {
@@ -473,7 +473,7 @@ FX_BOOL CXFA_FFComboBox::DeSelect() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditDeSelect();
}
-void CXFA_FFComboBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected)
+void CXFA_FFComboBox::SetItemState(int32_t nIndex, FX_BOOL bSelected)
{
if (bSelected) {
((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(nIndex);
@@ -483,13 +483,13 @@ void CXFA_FFComboBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected) m_pNormalWidget->Update();
AddInvalidateRect();
}
-void CXFA_FFComboBox::InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex )
+void CXFA_FFComboBox::InsertItem(FX_WSTR wsLabel, int32_t nIndex )
{
((CFWL_ComboBox*)m_pNormalWidget)->AddString(wsLabel);
m_pNormalWidget->Update();
AddInvalidateRect();
}
-void CXFA_FFComboBox::DeleteItem(FX_INT32 nIndex)
+void CXFA_FFComboBox::DeleteItem(int32_t nIndex)
{
if (nIndex < 0) {
((CFWL_ComboBox*)m_pNormalWidget)->RemoveAll();
@@ -533,7 +533,7 @@ void CXFA_FFComboBox::OnAddDoRecord(IFWL_Widget *pWidget) {
GetDoc()->GetDocProvider()->AddDoRecord(this);
}
-FX_INT32 CXFA_FFComboBox::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFComboBox::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.h b/xfa/src/fxfa/src/app/xfa_ffchoicelist.h index 72463ec513..c6ed12b668 100644 --- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.h +++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.h @@ -20,10 +20,10 @@ protected: FX_DWORD GetAlignment();
public:
void OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array &arrSels);
- void SetItemState(FX_INT32 nIndex, FX_BOOL bSelected);
- void InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1);
- void DeleteItem(FX_INT32 nIndex);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ void SetItemState(int32_t nIndex, FX_BOOL bSelected);
+ void InsertItem(FX_WSTR wsLabel, int32_t nIndex = -1);
+ void DeleteItem(int32_t nIndex);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
@@ -70,10 +70,10 @@ public: void OnPreOpen(IFWL_Widget *pWidget);
void OnPostOpen(IFWL_Widget *pWidget);
void OnAddDoRecord(IFWL_Widget *pWidget);
- void SetItemState(FX_INT32 nIndex, FX_BOOL bSelected);
- void InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1);
- void DeleteItem(FX_INT32 nIndex);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ void SetItemState(int32_t nIndex, FX_BOOL bSelected);
+ void InsertItem(FX_WSTR wsLabel, int32_t nIndex = -1);
+ void DeleteItem(int32_t nIndex);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp index 4ca1007dab..10ed9d85bc 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp @@ -31,15 +31,15 @@ FX_DWORD CXFA_FFDoc::GetDocType() {
return m_dwDocType;
}
-FX_INT32 CXFA_FFDoc::StartLoad()
+int32_t CXFA_FFDoc::StartLoad()
{
m_pNotify = FX_NEW CXFA_FFNotify(this);
IXFA_DocParser* pDocParser = IXFA_DocParser::Create(m_pNotify);
- FX_INT32 iStatus = pDocParser->StartParse(m_pStream);
+ int32_t iStatus = pDocParser->StartParse(m_pStream);
m_pDocument = pDocParser->GetDocument();
return iStatus;
}
-FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByteBuffer, FX_INT32& iBufferSize)
+FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByteBuffer, int32_t& iBufferSize)
{
IFDE_XMLElement* pDocumentElement = NULL;
for (IFDE_XMLNode *pXMLNode = pPDFElement->GetNodeItem(IFDE_XMLNode::FirstChild); pXMLNode; pXMLNode = pXMLNode->GetNodeItem(IFDE_XMLNode::NextSibling)) {
@@ -74,7 +74,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByte CFX_WideString wsPDFContent;
pChunkElement->GetTextData(wsPDFContent);
iBufferSize = FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), NULL);
- pByteBuffer = FX_Alloc(FX_BYTE, iBufferSize + 1);
+ pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1);
if (!pByteBuffer) {
return FALSE;
}
@@ -98,9 +98,9 @@ void XFA_XPDPacket_MergeRootNode(CXFA_Node *pOriginRoot, CXFA_Node* pNewRoot) }
}
}
-FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause )
+int32_t CXFA_FFDoc::DoLoad(IFX_Pause *pPause )
{
- FX_INT32 iStatus = m_pDocument->GetParser()->DoParse(pPause);
+ int32_t iStatus = m_pDocument->GetParser()->DoParse(pPause);
if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc) {
CXFA_Node* pPDFNode = (CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Pdf);
if (!pPDFNode) {
@@ -110,7 +110,7 @@ FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause ) if (pPDFXML->GetType() != FDE_XMLNODE_Element) {
return XFA_PARSESTATUS_SyntaxErr;
}
- FX_INT32 iBufferSize = 0;
+ int32_t iBufferSize = 0;
FX_LPBYTE pByteBuffer = NULL;
IFX_FileRead* pXFAReader = NULL;
if (XFA_GetPDFContentsFromPDFXML(pPDFXML, pByteBuffer, iBufferSize)) {
@@ -183,10 +183,10 @@ void CXFA_FFDoc::StopLoad() }
IXFA_DocView* CXFA_FFDoc::CreateDocView(FX_DWORD dwView )
{
- CXFA_FFDocView* pDocView = (CXFA_FFDocView*)m_mapTypeToDocView.GetValueAt((FX_LPVOID)(FX_UINTPTR)dwView);
+ CXFA_FFDocView* pDocView = (CXFA_FFDocView*)m_mapTypeToDocView.GetValueAt((FX_LPVOID)(uintptr_t)dwView);
if (!pDocView) {
pDocView = FX_NEW CXFA_FFDocView(this);
- m_mapTypeToDocView.SetAt((FX_LPVOID)(FX_UINTPTR)dwView, pDocView);
+ m_mapTypeToDocView.SetAt((FX_LPVOID)(uintptr_t)dwView, pDocView);
}
return pDocView;
}
@@ -237,7 +237,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) if (pElementXFA == NULL) {
return FALSE;
}
- FX_INT32 iObjType = pElementXFA->GetType();
+ int32_t iObjType = pElementXFA->GetType();
CFX_ArrayTemplate<CPDF_Stream*> xfaStreams;
if (iObjType == PDFOBJ_ARRAY) {
CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA;
@@ -327,14 +327,14 @@ CPDF_Document* CXFA_FFDoc::GetPDFDoc() return m_pPDFDoc;
}
#define _FXLIB_NEW_VERSION_
-CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi)
+CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, int32_t &iImageXDpi, int32_t &iImageYDpi)
{
if (!m_pPDFDoc) {
return NULL;
}
FX_DWORD dwHash = FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength(), FALSE);
FX_IMAGEDIB_AND_DPI *imageDIBDpi = NULL;
- if (m_mapNamedImages.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)imageDIBDpi)) {
+ if (m_mapNamedImages.Lookup((void*)(uintptr_t)dwHash, (void*&)imageDIBDpi)) {
iImageXDpi = imageDIBDpi->iImageXDpi;
iImageYDpi = imageDIBDpi->iImageYDpi;
return (CFX_DIBitmap*)imageDIBDpi->pDibSource;
@@ -356,8 +356,8 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, CFX_ByteString bsName = PDF_EncodeText(wsName.GetPtr(), wsName.GetLength());
CPDF_Object* pObject = nametree.LookupValue(bsName);
if (!pObject) {
- FX_INT32 iCount = nametree.GetCount();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = nametree.GetCount();
+ for (int32_t i = 0; i < iCount; i++) {
CFX_ByteString bsTemp;
CPDF_Object* pTempObject = nametree.LookupValue(i, bsTemp);
if (bsTemp == bsName) {
@@ -369,8 +369,8 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, #else
CPDF_Object* pObject = nametree.LookupValue(wsName);
if (!pObject) {
- FX_INT32 iCount = nametree.GetCount();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = nametree.GetCount();
+ for (int32_t i = 0; i < iCount; i++) {
CFX_WideString wsTemp;
CPDF_Object* pTempObject = nametree.LookupValue(i, wsTemp);
if (wsTemp == wsName) {
@@ -396,7 +396,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, imageDIBDpi->iImageYDpi = iImageYDpi;
pImageFileRead->Release();
}
- m_mapNamedImages.SetAt((void*)(FX_UINTPTR)dwHash, imageDIBDpi);
+ m_mapNamedImages.SetAt((void*)(uintptr_t)dwHash, imageDIBDpi);
return (CFX_DIBitmap*)imageDIBDpi->pDibSource;
}
IFDE_XMLElement* CXFA_FFDoc::GetPackageData(FX_WSTR wsPackage)
diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.h b/xfa/src/fxfa/src/app/xfa_ffdoc.h index 964573f201..a8c5b80370 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.h +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.h @@ -16,8 +16,8 @@ class IXFA_Locale; typedef struct _FX_IMAGEDIB_AND_DPI {
CFX_DIBSource* pDibSource;
- FX_INT32 iImageXDpi;
- FX_INT32 iImageYDpi;
+ int32_t iImageXDpi;
+ int32_t iImageYDpi;
} FX_IMAGEDIB_AND_DPI;
class CXFA_FFDoc : public IXFA_Doc
@@ -30,8 +30,8 @@ public: return m_pDocProvider;
}
FX_DWORD GetDocType();
- FX_INT32 StartLoad();
- FX_INT32 DoLoad(IFX_Pause *pPause = NULL);
+ int32_t StartLoad();
+ int32_t DoLoad(IFX_Pause *pPause = NULL);
void StopLoad();
IXFA_DocView* CreateDocView(FX_DWORD dwView = 0);
FX_BOOL OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile);
@@ -49,7 +49,7 @@ public: CXFA_FFDocView* GetDocView(IXFA_DocLayout* pLayout);
CXFA_FFDocView* GetDocView();
CPDF_Document* GetPDFDoc();
- CFX_DIBitmap* GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
+ CFX_DIBitmap* GetPDFNamedImage(FX_WSTR wsName, int32_t &iImageXDpi, int32_t &iImageYDpi);
IFDE_XMLElement* GetPackageData(FX_WSTR wsPackage);
FX_BOOL SavePackage(FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);
FX_BOOL ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE);
diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp index 9d76ca19e2..ccc734ecad 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp @@ -26,11 +26,11 @@ FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc) {
return static_cast<CXFA_FFDoc*>(hDoc)->GetDocType();
}
-FX_INT32 CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc)
+int32_t CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc)
{
return static_cast<CXFA_FFDoc*>(hDoc)->StartLoad();
}
-FX_INT32 CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause )
+int32_t CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause )
{
return static_cast<CXFA_FFDoc*>(hDoc)->DoLoad(pPause);
}
@@ -43,11 +43,11 @@ IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView ) {
return static_cast<CXFA_FFDoc*>(hDoc)->CreateDocView(dwView);
}
-FX_INT32 CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc)
+int32_t CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc)
{
return 0;
}
-void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage)
+void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, int32_t iPackage, CFX_WideStringC &wsPackage)
{
}
IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage)
diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.h b/xfa/src/fxfa/src/app/xfa_ffdochandler.h index 95abc6ad33..a421610d29 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdochandler.h +++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.h @@ -15,13 +15,13 @@ public: virtual void ReleaseDoc(IXFA_Doc* hDoc);
virtual IXFA_DocProvider* GetDocProvider(IXFA_Doc* hDoc);
virtual FX_DWORD GetDocType(IXFA_Doc* hDoc);
- virtual FX_INT32 StartLoad(IXFA_Doc* hDoc);
- virtual FX_INT32 DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL);
+ virtual int32_t StartLoad(IXFA_Doc* hDoc);
+ virtual int32_t DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL);
virtual void StopLoad(IXFA_Doc* hDoc);
virtual IXFA_DocView* CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView = 0);
- virtual FX_INT32 CountPackages(IXFA_Doc* hDoc);
- virtual void GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage);
+ virtual int32_t CountPackages(IXFA_Doc* hDoc);
+ virtual void GetPackageName(IXFA_Doc* hDoc, int32_t iPackage, CFX_WideStringC &wsPackage);
virtual IFDE_XMLElement* GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage);
virtual FX_BOOL SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);
virtual FX_BOOL CloseDoc(IXFA_Doc* hDoc);
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp index 7f80c416b2..dcf6c28816 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp @@ -86,13 +86,13 @@ void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize);
ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange);
}
-FX_INT32 CXFA_FFDocView::StartLayout(FX_INT32 iStartPage )
+int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage )
{
m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start;
m_pDoc->GetXFADoc()->DoProtoMerge();
m_pDoc->GetXFADoc()->DoDataMerge();
m_pXFADocLayout = GetXFALayout();
- FX_INT32 iStatus = m_pXFADocLayout->StartLayout();
+ int32_t iStatus = m_pXFADocLayout->StartLayout();
if (iStatus < 0) {
return iStatus;
}
@@ -107,9 +107,9 @@ FX_INT32 CXFA_FFDocView::StartLayout(FX_INT32 iStartPage ) m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start;
return iStatus;
}
-FX_INT32 CXFA_FFDocView::DoLayout(IFX_Pause *pPause )
+int32_t CXFA_FFDocView::DoLayout(IFX_Pause *pPause )
{
- FX_INT32 iStatus = 100;
+ int32_t iStatus = 100;
iStatus = m_pXFADocLayout->DoLayout(pPause);
if (iStatus != 100) {
return iStatus;
@@ -150,20 +150,20 @@ void CXFA_FFDocView::StopLayout() }
m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_End;
}
-FX_INT32 CXFA_FFDocView::GetLayoutStatus()
+int32_t CXFA_FFDocView::GetLayoutStatus()
{
return m_iStatus;
}
void CXFA_FFDocView::ShowNullTestMsg()
{
- FX_INT32 iCount = m_arrNullTestMsg.GetSize();
+ int32_t iCount = m_arrNullTestMsg.GetSize();
CXFA_FFApp* pApp = m_pDoc->GetApp();
IXFA_AppProvider* pAppProvider = pApp->GetAppProvider();
if (pAppProvider && iCount) {
- FX_INT32 iRemain = iCount > 7 ? iCount - 7 : 0;
+ int32_t iRemain = iCount > 7 ? iCount - 7 : 0;
iCount -= iRemain;
CFX_WideString wsMsg;
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
wsMsg += m_arrNullTestMsg[i] + FX_WSTRC(L"\n");
}
if (iRemain > 0) {
@@ -187,8 +187,8 @@ void CXFA_FFDocView::UpdateDocView() return;
}
LockUpdate();
- FX_INT32 iNewAdds = m_NewAddedNodes.GetSize();
- for (FX_INT32 i = 0; i < iNewAdds; i++) {
+ int32_t iNewAdds = m_NewAddedNodes.GetSize();
+ for (int32_t i = 0; i < iNewAdds; i++) {
CXFA_Node* pNode = (CXFA_Node*)m_NewAddedNodes[i];
InitCalculate(pNode);
InitValidate(pNode);
@@ -208,14 +208,14 @@ void CXFA_FFDocView::UpdateDocView() this->RunInvalidate();
UnlockUpdate();
}
-FX_INT32 CXFA_FFDocView::CountPageViews()
+int32_t CXFA_FFDocView::CountPageViews()
{
if (!m_pXFADocLayout) {
return 0;
}
return m_pXFADocLayout->CountPages();
}
-IXFA_PageView* CXFA_FFDocView::GetPageView(FX_INT32 nIndex)
+IXFA_PageView* CXFA_FFDocView::GetPageView(int32_t nIndex)
{
if (!m_pXFADocLayout) {
return NULL;
@@ -280,7 +280,7 @@ void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc ) m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
}
-FX_INT32 CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc )
+int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc )
{
if (pParam == NULL) {
return XFA_EVENTERROR_Error;
@@ -431,7 +431,7 @@ void CXFA_FFDocView::DeleteLayoutItem(CXFA_FFWidget* pWidget) m_pOldFocusWidget = NULL;
}
}
-static FX_INT32 XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam)
+static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam)
{
if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) {
return XFA_EVENTERROR_NotExist;
@@ -461,12 +461,12 @@ static FX_INT32 XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidg default:
break;
}
- FX_INT32 iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam);
+ int32_t iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam);
return iRet;
}
-FX_INT32 CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_Node* pExclude)
+int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_Node* pExclude)
{
- FX_INT32 iRet = XFA_EVENTERROR_NotExist;
+ int32_t iRet = XFA_EVENTERROR_NotExist;
if (pFormNode == pExclude) {
return iRet;
}
@@ -528,7 +528,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAc wsExpression = L"$form." + wsName;
}
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwStyle);
+ int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwStyle);
if (iRet < 1) {
return NULL;
}
@@ -540,7 +540,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAc }
return NULL;
}
-void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, FX_INT32 iPageIndex)
+void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, int32_t iPageIndex)
{
FX_BOOL bNofify = m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End;
if (eEvent == XFA_PAGEEVENT_PageRemoved) {
@@ -620,8 +620,8 @@ FX_BOOL CXFA_FFDocView::RunLayout() }
void CXFA_FFDocView::RunSubformIndexChange()
{
- FX_INT32 iSubforms = m_IndexChangedSubforms.GetSize();
- for (FX_INT32 i = 0; i < iSubforms; i++) {
+ int32_t iSubforms = m_IndexChangedSubforms.GetSize();
+ for (int32_t i = 0; i < iSubforms; i++) {
CXFA_Node* pSubformNode = (CXFA_Node*)m_IndexChangedSubforms[i];
CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pSubformNode->GetWidgetData();
if (!pWidgetAcc) {
@@ -667,7 +667,7 @@ FX_BOOL CXFA_FFDocView::IsStaticNotify() }
void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc)
{
- FX_INT32 iAccs = m_CalculateAccs.GetSize();
+ int32_t iAccs = m_CalculateAccs.GetSize();
CXFA_WidgetAcc* pCurrentAcc = (iAccs < 1) ? (CXFA_WidgetAcc*)NULL : (CXFA_WidgetAcc*)m_CalculateAccs[iAccs - 1];
if (pCurrentAcc != pWidgetAcc) {
m_CalculateAccs.Add(pWidgetAcc);
@@ -676,27 +676,27 @@ void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) void CXFA_FFDocView::AddCalculateNodeNotify(CXFA_Node* pNodeChange)
{
CXFA_CalcData* pGlobalData = (CXFA_CalcData*)pNodeChange->GetUserData(XFA_CalcData);
- FX_INT32 iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0;
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0;
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_WidgetAcc* pResultAcc = (CXFA_WidgetAcc*)pGlobalData->m_Globals[i];
if (pResultAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) {
continue;
}
- FX_INT32 iAccs = m_CalculateAccs.GetSize();
+ int32_t iAccs = m_CalculateAccs.GetSize();
CXFA_WidgetAcc* pCurrentAcc = (iAccs < 1) ? (CXFA_WidgetAcc*)NULL : (CXFA_WidgetAcc*)m_CalculateAccs[iAccs - 1];
if (pCurrentAcc != pResultAcc) {
m_CalculateAccs.Add(pResultAcc);
}
}
}
-void CXFA_FFDocView::RunCalculateRecursive(FX_INT32& iIndex)
+void CXFA_FFDocView::RunCalculateRecursive(int32_t& iIndex)
{
while (iIndex < m_CalculateAccs.GetSize()) {
CXFA_WidgetAcc* pCurAcc = (CXFA_WidgetAcc*)m_CalculateAccs[iIndex];
AddCalculateNodeNotify(pCurAcc->GetNode());
- FX_INT32 iRefCount = (FX_INT32)(FX_UINTPTR)pCurAcc->GetNode()->GetUserData(XFA_CalcRefCount);
+ int32_t iRefCount = (int32_t)(uintptr_t)pCurAcc->GetNode()->GetUserData(XFA_CalcRefCount);
iRefCount++;
- pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(FX_UINTPTR)iRefCount);
+ pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(uintptr_t)iRefCount);
if (iRefCount > 11) {
break;
}
@@ -707,19 +707,19 @@ void CXFA_FFDocView::RunCalculateRecursive(FX_INT32& iIndex) RunCalculateRecursive(iIndex);
}
}
-FX_INT32 CXFA_FFDocView::RunCalculateWidgets()
+int32_t CXFA_FFDocView::RunCalculateWidgets()
{
if (!m_pDoc->GetDocProvider()->IsCalculationsEnabled(m_pDoc)) {
return XFA_EVENTERROR_Disabled;
}
- FX_INT32 iCounts = m_CalculateAccs.GetSize();
- FX_INT32 iIndex = 0;
+ int32_t iCounts = m_CalculateAccs.GetSize();
+ int32_t iIndex = 0;
if (iCounts > 0) {
RunCalculateRecursive(iIndex);
}
- for (FX_INT32 i = 0; i < m_CalculateAccs.GetSize(); i++) {
+ for (int32_t i = 0; i < m_CalculateAccs.GetSize(); i++) {
CXFA_WidgetAcc* pCurAcc = (CXFA_WidgetAcc*)m_CalculateAccs[i];
- pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(FX_UINTPTR)0);
+ pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(uintptr_t)0);
}
m_CalculateAccs.RemoveAll();
return XFA_EVENTERROR_Sucess;
@@ -749,8 +749,8 @@ FX_BOOL CXFA_FFDocView::RunValidate() if (!m_pDoc->GetDocProvider()->IsValidationsEnabled(m_pDoc)) {
return FALSE;
}
- FX_INT32 iCounts = m_ValidateAccs.GetSize();
- for (FX_INT32 i = 0; i < iCounts; i++) {
+ int32_t iCounts = m_ValidateAccs.GetSize();
+ for (int32_t i = 0; i < iCounts; i++) {
CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)m_ValidateAccs[i];
if (pAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) {
continue;
@@ -772,8 +772,8 @@ FX_BOOL CXFA_FFDocView::RunEventLayoutReady() }
void CXFA_FFDocView::RunBindItems()
{
- FX_INT32 iCount = m_bindItems.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_bindItems.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
if (((CXFA_Node*)m_bindItems[i])->HasFlag(XFA_NODEFLAG_HasRemoved)) {
continue;
}
@@ -789,7 +789,7 @@ void CXFA_FFDocView::RunBindItems() FX_DWORD dwStyle = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_ALL;
XFA_RESOLVENODE_RS rs;
pScriptContext->ResolveObjects(pWidgetNode, wsRef, rs, dwStyle);
- FX_INT32 iCount = rs.nodes.GetSize();
+ int32_t iCount = rs.nodes.GetSize();
pAcc->DeleteItem(-1);
if (rs.dwFlags != XFA_RESOVENODE_RSTYPE_Nodes || iCount < 1) {
continue;
@@ -803,7 +803,7 @@ void CXFA_FFDocView::RunBindItems() CFX_WideString wsValue, wsLabel;
FX_DWORD uValueHash = FX_HashCode_String_GetW(CFX_WideString(wsValueRef), wsValueRef.GetLength());
FX_DWORD uLableHash = FX_HashCode_String_GetW(CFX_WideString(wsLabelRef), wsLabelRef.GetLength());
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_Object* refObj = rs.nodes[i];
if(!refObj->IsNode()) {
continue;
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.h b/xfa/src/fxfa/src/app/xfa_ffdocview.h index e3f2d643e2..e7493e653d 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.h +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.h @@ -38,17 +38,17 @@ public: ~CXFA_FFDocView();
virtual IXFA_Doc* GetDoc() { return m_pDoc; }
- virtual FX_INT32 StartLayout(FX_INT32 iStartPage = 0);
- virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL);
+ virtual int32_t StartLayout(int32_t iStartPage = 0);
+ virtual int32_t DoLayout(IFX_Pause *pPause = NULL);
virtual void StopLayout();
- virtual FX_INT32 GetLayoutStatus();
+ virtual int32_t GetLayoutStatus();
virtual void UpdateDocView();
- virtual FX_INT32 CountPageViews();
- virtual IXFA_PageView* GetPageView(FX_INT32 nIndex);
+ virtual int32_t CountPageViews();
+ virtual IXFA_PageView* GetPageView(int32_t nIndex);
virtual IXFA_Widget* GetWidgetByName(FX_WSTR wsName);
virtual CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName);
virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL);
- virtual FX_INT32 ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL);
+ virtual int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL);
virtual IXFA_WidgetHandler* GetWidgetHandler();
virtual IXFA_WidgetIterator* CreateWidgetIterator();
virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator(XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder);
@@ -58,7 +58,7 @@ public: CXFA_FFWidget* GetWidgetByName(FX_WSTR wsName, CXFA_FFWidget* pRefWidget = NULL);
CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAcc* pRefWidgetAcc = NULL);
IXFA_DocLayout* GetXFALayout() const;
- void OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, FX_INT32 iPageIndex);
+ void OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, int32_t iPageIndex);
void LockUpdate();
void UnlockUpdate();
FX_BOOL IsUpdateLocked();
@@ -77,7 +77,7 @@ public: void AddValidateWidget(CXFA_WidgetAcc* pWidget);
void AddCalculateNodeNotify(CXFA_Node* pNodeChange);
void AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc);
- FX_INT32 RunCalculateWidgets();
+ int32_t RunCalculateWidgets();
FX_BOOL IsStaticNotify();
FX_BOOL RunLayout();
void RunSubformIndexChange();
@@ -86,7 +86,7 @@ public: CXFA_WidgetAcc* GetFocusWidgetAcc();
void SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc);
void DeleteLayoutItem(CXFA_FFWidget* pWidget);
- FX_INT32 ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_Node* pExclude = NULL);
+ int32_t ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_Node* pExclude = NULL);
FX_BOOL m_bLayoutEvent;
CFX_WideStringArray m_arrNullTestMsg;
CXFA_FFWidget* m_pListFocusWidget;
@@ -96,7 +96,7 @@ protected: void RunBindItems();
FX_BOOL InitCalculate(CXFA_Node* pNode);
void InitLayout(CXFA_Node* pNode);
- void RunCalculateRecursive(FX_INT32& iIndex);
+ void RunCalculateRecursive(int32_t& iIndex);
void ShowNullTestMsg();
FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc);
CXFA_Node* GetRootSubform();
@@ -114,7 +114,7 @@ protected: CFX_PtrArray m_NewAddedNodes;
CFX_PtrArray m_IndexChangedSubforms;
XFA_DOCVIEW_LAYOUTSTATUS m_iStatus;
- FX_INT32 m_iLock;
+ int32_t m_iLock;
friend class CXFA_FFNotify;
};
class CXFA_FFDocWidgetIterator : public IXFA_WidgetIterator
diff --git a/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp b/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp index 75d5f7e5c4..6256724a29 100644 --- a/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp @@ -18,7 +18,7 @@ CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* p CXFA_FFExclGroup::~CXFA_FFExclGroup()
{
}
-void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
diff --git a/xfa/src/fxfa/src/app/xfa_ffexclgroup.h b/xfa/src/fxfa/src/app/xfa_ffexclgroup.h index bc8acd6789..c8d8ef51cc 100644 --- a/xfa/src/fxfa/src/app/xfa_ffexclgroup.h +++ b/xfa/src/fxfa/src/app/xfa_ffexclgroup.h @@ -12,7 +12,7 @@ public: CXFA_FFExclGroup(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFExclGroup();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
protected:
};
#endif
diff --git a/xfa/src/fxfa/src/app/xfa_fffield.cpp b/xfa/src/fxfa/src/app/xfa_fffield.cpp index 34b73b55b0..87d3adad80 100644 --- a/xfa/src/fxfa/src/app/xfa_fffield.cpp +++ b/xfa/src/fxfa/src/app/xfa_fffield.cpp @@ -53,7 +53,7 @@ FX_BOOL CXFA_FFField::GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDraw mt.TransformRect(rtBox);
return TRUE;
}
-void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -276,7 +276,7 @@ void CXFA_FFField::CapPlacement() }
m_rtUI.Normalize();
}
-void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement)
+void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement)
{
CFX_RectF rtUIMargin;
m_pDataAcc->GetUIMargin(rtUIMargin);
@@ -302,7 +302,7 @@ void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF & }
}
}
-void CXFA_FFField::CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement)
+void CXFA_FFField::CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement)
{
CFX_RectF rtUIMargin;
m_pDataAcc->GetUIMargin(rtUIMargin);
@@ -466,7 +466,7 @@ FX_BOOL CXFA_FFField::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) TranslateFWLMessage(&ms);
return TRUE;
}
-FX_BOOL CXFA_FFField::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFField::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy)
{
return FALSE;
if (!m_pNormalWidget) {
@@ -714,13 +714,13 @@ FX_BOOL CXFA_FFField::ProcessCommittedData() m_pDocView->AddValidateWidget(m_pDataAcc);
return TRUE;
}
-FX_INT32 CXFA_FFField::CalculateOverride()
+int32_t CXFA_FFField::CalculateOverride()
{
CXFA_WidgetAcc* pAcc = m_pDataAcc->GetExclGroup();
if (!pAcc) {
return CalculateWidgetAcc(m_pDataAcc);
}
- FX_INT32 iOverride = 0;
+ int32_t iOverride = 0;
if (CalculateWidgetAcc(pAcc) == 0) {
return 0;
}
@@ -741,7 +741,7 @@ FX_INT32 CXFA_FFField::CalculateOverride() }
return 1;
}
-FX_INT32 CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc)
+int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc)
{
CXFA_Calculate calc = pAcc->GetCalculate();
if (!calc) {
@@ -749,7 +749,7 @@ FX_INT32 CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) }
XFA_VERSION version = pAcc->GetDoc()->GetXFADoc()->GetCurVersionMode();
if (calc) {
- FX_INT32 iOverride = calc.GetOverride();
+ int32_t iOverride = calc.GetOverride();
switch (iOverride) {
case XFA_ATTRIBUTEENUM_Error: {
if (version <= XFA_VERSION_204) {
@@ -823,7 +823,7 @@ void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) {
GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage);
}
-FX_INT32 CXFA_FFField::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFField::OnProcessMessage(CFWL_Message *pMessage)
{
return FWL_ERR_Succeeded;
}
diff --git a/xfa/src/fxfa/src/app/xfa_fffield.h b/xfa/src/fxfa/src/app/xfa_fffield.h index c2f7e680e2..16dd3d65a7 100644 --- a/xfa/src/fxfa/src/app/xfa_fffield.h +++ b/xfa/src/fxfa/src/app/xfa_fffield.h @@ -16,7 +16,7 @@ public: virtual ~CXFA_FFField();
virtual FX_BOOL GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL IsLoaded();
virtual FX_BOOL LoadWidget();
virtual void UnloadWidget();
@@ -29,7 +29,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -53,8 +53,8 @@ protected: void LayoutCaption();
void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL);
- FX_INT32 CalculateOverride();
- FX_INT32 CalculateWidgetAcc(CXFA_WidgetAcc* pAcc);
+ int32_t CalculateOverride();
+ int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc);
FX_BOOL ProcessCommittedData();
virtual FX_BOOL CommitData();
virtual FX_BOOL IsDataChanged();
@@ -62,11 +62,11 @@ protected: void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix);
void TranslateFWLMessage(CFWL_Message* pMessage);
void CapPlacement();
- void CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement);
- void CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement);
+ void CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement);
+ void CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement);
void SetEditScrollOffset();
public:
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fxfa/src/app/xfa_ffimage.cpp b/xfa/src/fxfa/src/app/xfa_ffimage.cpp index a12b1ff9dc..78eef33978 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimage.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffimage.cpp @@ -36,7 +36,7 @@ void CXFA_FFImage::UnloadWidget() {
GetDataAcc()->SetImageImage(NULL);
}
-void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -53,17 +53,17 @@ void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWOR if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
XFA_RectWidthoutMargin(rtImage, mgWidget);
}
- FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left;
- FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top;
+ int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left;
+ int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
iHorzAlign = para.GetHorizontalAlign();
iVertAlign = para.GetVerticalAlign();
}
CXFA_Value value = m_pDataAcc->GetFormValue();
CXFA_Image imageObj = value.GetImage();
- FX_INT32 iAspect = imageObj.GetAspect();
- FX_INT32 iImageXDpi = 0;
- FX_INT32 iImageYDpi = 0;
+ int32_t iAspect = imageObj.GetAspect();
+ int32_t iImageXDpi = 0;
+ int32_t iImageYDpi = 0;
m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi);
XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffimage.h b/xfa/src/fxfa/src/app/xfa_ffimage.h index f6b985c304..dd785725ad 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimage.h +++ b/xfa/src/fxfa/src/app/xfa_ffimage.h @@ -11,7 +11,7 @@ class CXFA_FFImage : public CXFA_FFDraw public:
CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFImage();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL IsLoaded();
virtual FX_BOOL LoadWidget();
virtual void UnloadWidget();
diff --git a/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp b/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp index 2075d90d21..0174ee71c5 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp @@ -45,7 +45,7 @@ void CXFA_FFImageEdit::UnloadWidget() m_pDataAcc->SetImageEditImage(NULL);
CXFA_FFField::UnloadWidget();
}
-void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -62,20 +62,20 @@ void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_ if (CFX_DIBitmap* pDIBitmap = m_pDataAcc->GetImageEditImage()) {
CFX_RectF rtImage;
m_pNormalWidget->GetWidgetRect(rtImage);
- FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left;
- FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top;
+ int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left;
+ int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
iHorzAlign = para.GetHorizontalAlign();
iVertAlign = para.GetVerticalAlign();
}
- FX_INT32 iAspect = XFA_ATTRIBUTEENUM_Fit;
+ int32_t iAspect = XFA_ATTRIBUTEENUM_Fit;
if (CXFA_Value value = m_pDataAcc->GetFormValue()) {
if (CXFA_Image imageObj = value.GetImage()) {
iAspect = imageObj.GetAspect();
}
}
- FX_INT32 iImageXDpi = 0;
- FX_INT32 iImageYDpi = 0;
+ int32_t iImageXDpi = 0;
+ int32_t iImageYDpi = 0;
m_pDataAcc->GetImageEditDpi(iImageXDpi, iImageYDpi);
XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign);
}
@@ -106,7 +106,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT pAppProvider->LoadString(XFA_IDS_ImageFilter, wsFilter);
CFX_WideStringArray wsPathArray;
pAppProvider->ShowFileDialog(wsTitle, wsFilter, wsPathArray);
- FX_INT32 iSize = wsPathArray.GetSize();
+ int32_t iSize = wsPathArray.GetSize();
if (iSize < 1) {
return TRUE;
}
@@ -129,7 +129,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT CFX_WideString wsImage;
IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath);
if (pFileRead != NULL) {
- FX_INT32 nDataSize = pFileRead->GetSize();
+ int32_t nDataSize = pFileRead->GetSize();
if (nDataSize > 0) {
CFX_ByteString bsBuf;
FX_LPSTR pImageBuffer = bsBuf.GetBuffer(nDataSize);
@@ -173,7 +173,7 @@ FX_BOOL CXFA_FFImageEdit::UpdateFWLData() m_pDataAcc->LoadImageEditImage();
return TRUE;
}
-FX_INT32 CXFA_FFImageEdit::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFImageEdit::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffimageedit.h b/xfa/src/fxfa/src/app/xfa_ffimageedit.h index 7ba8333103..9ca9928af8 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimageedit.h +++ b/xfa/src/fxfa/src/app/xfa_ffimageedit.h @@ -12,11 +12,11 @@ public: CXFA_FFImageEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFImageEdit();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL LoadWidget();
virtual void UnloadWidget();
virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp index 81119e6e47..d42e7e611c 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp @@ -50,7 +50,7 @@ void CXFA_FFNotify::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, if (!pDocView) {
return;
}
- pDocView->OnPageEvent(pSender, eEvent, (FX_INT32)(FX_UINTPTR)pParam);
+ pDocView->OnPageEvent(pSender, eEvent, (int32_t)(uintptr_t)pParam);
}
void CXFA_FFNotify::OnNodeEvent(CXFA_Node *pSender, XFA_NODEEVENT eEvent, FX_LPVOID pParam , FX_LPVOID pParam2 , FX_LPVOID pParam3, FX_LPVOID pParam4)
{
@@ -91,9 +91,9 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent while (pWidget) {
if (pWidget->IsLoaded()) {
if (pWidgetAcc->IsListBox()) {
- ((CXFA_FFListBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (FX_INT32)(FX_UINTPTR)pAdditional2);
+ ((CXFA_FFListBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (int32_t)(uintptr_t)pAdditional2);
} else {
- ((CXFA_FFComboBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (FX_INT32)(FX_UINTPTR)pAdditional2);
+ ((CXFA_FFComboBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (int32_t)(uintptr_t)pAdditional2);
}
}
if (bStaticNotify) {
@@ -118,9 +118,9 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent while (pWidget) {
if (pWidget->IsLoaded()) {
if (pWidgetAcc->IsListBox()) {
- ((CXFA_FFListBox*)pWidget)->DeleteItem((FX_INT32)(FX_UINTPTR)pParam);
+ ((CXFA_FFListBox*)pWidget)->DeleteItem((int32_t)(uintptr_t)pParam);
} else {
- ((CXFA_FFComboBox*)pWidget)->DeleteItem((FX_INT32)(FX_UINTPTR)pParam);
+ ((CXFA_FFComboBox*)pWidget)->DeleteItem((int32_t)(uintptr_t)pParam);
}
}
if (bStaticNotify) {
@@ -248,7 +248,7 @@ void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, }
pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight);
}
-FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos)
+FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos)
{
CXFA_WidgetAcc *pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData();
if (!pAcc) {
@@ -270,14 +270,14 @@ FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) CXFA_EventParam EventParam;
EventParam.m_eType = XFA_EVENT_Unknown;
FXJSE_HVALUE pRetValue = NULL;
- FX_INT32 iRet = pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue);
+ int32_t iRet = pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue);
if (iRet == XFA_EVENTERROR_Sucess && pRetValue) {
bRet = FXJSE_Value_ToBoolean(pRetValue);
FXJSE_Value_Release(pRetValue);
}
return bRet;
}
-FX_INT32 CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_WidgetAcc* pExclude)
+int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_WidgetAcc* pExclude)
{
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView) {
@@ -347,7 +347,7 @@ void CXFA_FFNotify::ResetData(CXFA_WidgetData* pWidgetData) }
pDocView->ResetWidgetData((CXFA_WidgetAcc*)pWidgetData);
}
-FX_INT32 CXFA_FFNotify::GetLayoutStatus()
+int32_t CXFA_FFNotify::GetLayoutStatus()
{
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
return pDocView ? pDocView->GetLayoutStatus() : 0;
@@ -422,7 +422,7 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPV FX_DWORD dwPacket = pSender->GetPacketID();
if (dwPacket & XFA_XDPPACKET_Datasets) {
} else if (pSender->IsFormContainer()) {
- XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(FX_UINTPTR)pParam;
+ XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam;
if (eAttr == XFA_ATTRIBUTE_Presence) {
CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pSender->GetWidgetData();
if (!pWidgetAcc) {
@@ -444,7 +444,7 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVO return;
}
FX_DWORD dwPacket = pSender->GetPacketID();
- XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(FX_UINTPTR)pParam;
+ XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam;
if (dwPacket & XFA_XDPPACKET_Form) {
CXFA_Node* pParentNode = (CXFA_Node*)pParam3;
CXFA_Node* pWidgetNode = (CXFA_Node*)pParam4;
@@ -544,9 +544,9 @@ void CXFA_FFNotify::OnChildRemoved(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVO void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, FX_LPVOID pParam, FX_LPVOID pParam2)
{
CXFA_FFWidget* pWidget = (CXFA_FFWidget*)(CXFA_ContentLayoutItemImpl*)pSender;
- FX_INT32 iPageIdx = (FX_INT32)(FX_UINTPTR)pParam;
+ int32_t iPageIdx = (int32_t)(uintptr_t)pParam;
IXFA_PageView* pNewPageView = pDocView->GetPageView(iPageIdx);
- FX_DWORD dwStatus = (FX_DWORD)(FX_UINTPTR)pParam2;
+ FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam2;
FX_DWORD dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | XFA_WIDGETSTATUS_Printable;
pWidget->ModifyStatus(dwStatus, dwFilter);
if (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End) {
@@ -592,7 +592,7 @@ void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, IXFA_Do if (!pWidget) {
return;
}
- FX_DWORD dwStatus = (FX_DWORD)(FX_UINTPTR)pParam;
+ FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam;
if (dwStatus == 0) {
CXFA_LayoutItem* pPreItem = pSender->GetPrev();
if (pPreItem) {
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.h b/xfa/src/fxfa/src/app/xfa_ffnotify.h index 383b0770cb..d289a1074a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.h +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.h @@ -20,9 +20,9 @@ public: virtual void OnLayoutEvent(IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, XFA_LAYOUTEVENT eEvent, FX_LPVOID pParam = NULL, FX_LPVOID pParam2 = NULL);
virtual void StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, FX_FLOAT &fCalcHeight);
- virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos);
+ virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos);
virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem);
- virtual FX_INT32 ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc * pExclude = NULL);
+ virtual int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc * pExclude = NULL);
virtual void AddCalcValidate(CXFA_Node* pNode);
virtual IXFA_Doc* GetHDOC();
virtual IXFA_DocProvider* GetDocProvider();
@@ -32,7 +32,7 @@ public: virtual void OpenDropDownList(IXFA_Widget* hWidget);
virtual CFX_WideString GetCurrentDateTime();
virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL);
- virtual FX_INT32 GetLayoutStatus();
+ virtual int32_t GetLayoutStatus();
virtual void RunNodeInitialize(CXFA_Node* pNode);
virtual void RunSubformIndexChange(CXFA_Node* pSubformNode);
virtual CXFA_Node* GetFocusWidgetNode();
diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp index ef340859ea..11384b141e 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp @@ -30,7 +30,7 @@ IXFA_DocView* CXFA_FFPageView::GetDocView() {
return m_pDocView;
}
-FX_INT32 CXFA_FFPageView::GetPageViewIndex()
+int32_t CXFA_FFPageView::GetPageViewIndex()
{
return GetLayoutPage()->GetPageIndex();
}
@@ -40,7 +40,7 @@ void CXFA_FFPageView::GetPageViewRect(CFX_RectF &rtPage) GetLayoutPage()->GetPageSize(sz);
rtPage.Set(0, 0, sz);
}
-void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate)
+void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, int32_t iRotate)
{
CFX_SizeF sz;
GetLayoutPage()->GetPageSize(sz);
@@ -48,7 +48,7 @@ void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, F fdePage.Set(0, 0, sz.x, sz.y);
FDE_GetPageMatrix(mt, fdePage, rtDisp, iRotate, 0);
}
-FX_INT32 CXFA_FFPageView::LoadPageView(IFX_Pause *pPause )
+int32_t CXFA_FFPageView::LoadPageView(IFX_Pause *pPause )
{
if (m_bLoaded) {
return 100;
@@ -77,7 +77,7 @@ IXFA_Widget* CXFA_FFPageView::GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) continue;
}
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
- FX_INT32 type = pAcc->GetClassID();
+ int32_t type = pAcc->GetClassID();
if (type != XFA_ELEMENT_Field && type != XFA_ELEMENT_Draw) {
continue;
}
@@ -216,7 +216,7 @@ void CXFA_FFTabOrderPageWidgetIterator::Reset() IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst()
{
if (m_TabOrderWidgetArray.GetSize() > 0) {
- for (FX_INT32 i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) {
+ for (int32_t i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -228,7 +228,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast()
{
if (m_TabOrderWidgetArray.GetSize() > 0) {
- for (FX_INT32 i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) {
+ for (int32_t i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -239,7 +239,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() }
IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext()
{
- for (FX_INT32 i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) {
+ for (int32_t i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -250,7 +250,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() }
IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious()
{
- for (FX_INT32 i = m_iCurWidget - 1; i >= 0; i--) {
+ for (int32_t i = m_iCurWidget - 1; i >= 0; i--) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -268,7 +268,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget() }
FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(IXFA_Widget* hWidget)
{
- FX_INT32 iWidgetIndex = m_TabOrderWidgetArray.Find(static_cast<CXFA_FFWidget*>(hWidget));
+ int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(static_cast<CXFA_FFWidget*>(hWidget));
if (iWidgetIndex >= 0) {
m_iCurWidget = iWidgetIndex;
return TRUE;
@@ -299,7 +299,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() m_TabOrderWidgetArray.RemoveAll();
CXFA_WidgetArray SpaceOrderWidgetArray;
CreateSpaceOrderWidgetArray(SpaceOrderWidgetArray);
- FX_INT32 nWidgetCount = SpaceOrderWidgetArray.GetSize();
+ int32_t nWidgetCount = SpaceOrderWidgetArray.GetSize();
if (nWidgetCount < 1) {
return;
}
@@ -309,7 +309,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() m_TabOrderWidgetArray.Add(hWidget);
CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc();
if (pWidgetAcc->GetUIType() == XFA_ELEMENT_ExclGroup) {
- FX_INT32 iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1;
+ int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1;
while (TRUE) {
CXFA_FFWidget* pRadio = SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount];
if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) {
@@ -326,11 +326,11 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() continue;
}
}
- FX_INT32 iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget);
+ int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget);
hWidget = SpaceOrderWidgetArray[(iWidgetIndex + 1) % nWidgetCount];
}
}
-static FX_INT32 XFA_TabOrderWidgetComparator(const void* phWidget1, const void* phWidget2)
+static int32_t XFA_TabOrderWidgetComparator(const void* phWidget1, const void* phWidget2)
{
CXFA_FFWidget* pWidget1 = (*(CXFA_TabParam**)phWidget1)->m_pWidget;
CXFA_FFWidget* pWidget2 = (*(CXFA_TabParam**)phWidget2)->m_pWidget;
@@ -381,11 +381,11 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(CXFA_LayoutItemIterator* pSearchItem = sIterator->MoveToNext();
}
}
- FX_INT32 iChildren = tabParams.GetSize();
+ int32_t iChildren = tabParams.GetSize();
if (iChildren > 1) {
FXSYS_qsort(tabParams.GetData(), iChildren, sizeof(FX_LPVOID), XFA_TabOrderWidgetComparator);
}
- for (FX_INT32 iStart = 0; iStart < iChildren; iStart++) {
+ for (int32_t iStart = 0; iStart < iChildren; iStart++) {
CXFA_TabParam* pParam = (CXFA_TabParam*)tabParams[iStart];
pContainer->m_Children.Add(pParam->m_pWidget);
if (pParam->m_Children.GetSize() > 0) {
diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.h b/xfa/src/fxfa/src/app/xfa_ffpageview.h index dd0a481ffb..b80248bf0a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.h +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.h @@ -14,10 +14,10 @@ public: CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea);
~CXFA_FFPageView();
virtual IXFA_DocView* GetDocView();
- virtual FX_INT32 GetPageViewIndex();
+ virtual int32_t GetPageViewIndex();
virtual void GetPageViewRect(CFX_RectF &rtPage);
- virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate);
- virtual FX_INT32 LoadPageView(IFX_Pause *pPause = NULL);
+ virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, int32_t iRotate);
+ virtual int32_t LoadPageView(IFX_Pause *pPause = NULL);
virtual void UnloadPageView();
FX_BOOL IsPageViewLoaded();
@@ -87,7 +87,7 @@ protected: CXFA_WidgetArray m_TabOrderWidgetArray;
CXFA_FFPageView* m_pPageView;
FX_DWORD m_dwFilter;
- FX_INT32 m_iCurWidget;
+ int32_t m_iCurWidget;
FX_BOOL m_bIgnorerelevant;
CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget);
CXFA_FFWidget* FindWidgetByName(FX_WSTR wsWidgetName, CXFA_FFWidget* pRefWidget);
diff --git a/xfa/src/fxfa/src/app/xfa_ffpath.cpp b/xfa/src/fxfa/src/app/xfa_ffpath.cpp index 2f8b71a50a..1cf993b737 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpath.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpath.cpp @@ -19,7 +19,7 @@ CXFA_FFLine::CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFLine::~CXFA_FFLine()
{
}
-void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLineWidth)
+void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, int32_t iHand, FX_FLOAT fLineWidth)
{
FX_FLOAT fHalfWidth = fLineWidth / 2.0f;
if (rect.height < 1.0f) {
@@ -50,7 +50,7 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLin }
}
}
-void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -61,10 +61,10 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD }
CXFA_Line lineObj = value.GetLine();
FX_ARGB lineColor = 0xFF000000;
- FX_INT32 iStrokeType = 0;
+ int32_t iStrokeType = 0;
FX_FLOAT fLineWidth = 1.0f;
FX_BOOL bSlope = lineObj.GetSlop();
- FX_INT32 iCap = 0;
+ int32_t iCap = 0;
CXFA_Edge edge = lineObj.GetEdge();
if (edge.IsExistInXML()) {
if (edge.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {
@@ -109,7 +109,7 @@ CXFA_FFArc::CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFArc::~CXFA_FFArc()
{
}
-void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -138,7 +138,7 @@ CXFA_FFRectangle::CXFA_FFRectangle(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* p CXFA_FFRectangle::~CXFA_FFRectangle()
{
}
-void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
diff --git a/xfa/src/fxfa/src/app/xfa_ffpath.h b/xfa/src/fxfa/src/app/xfa_ffpath.h index 08828f3b84..aed4a67a0b 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpath.h +++ b/xfa/src/fxfa/src/app/xfa_ffpath.h @@ -11,22 +11,22 @@ class CXFA_FFLine : public CXFA_FFDraw public:
CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFLine();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
private:
- void GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLineWidth);
+ void GetRectFromHand(CFX_RectF &rect, int32_t iHand, FX_FLOAT fLineWidth);
};
class CXFA_FFArc : public CXFA_FFDraw
{
public:
CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFArc();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
};
class CXFA_FFRectangle : public CXFA_FFDraw
{
public:
CXFA_FFRectangle(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFRectangle();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
};
#endif
diff --git a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp index 125cb4f5b7..4ea2ac48ec 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp @@ -26,7 +26,7 @@ CXFA_FFPushButton::~CXFA_FFPushButton() {
CXFA_FFPushButton::UnloadWidget();
}
-void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -208,7 +208,7 @@ void CXFA_FFPushButton::RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pM }
}
}
-FX_INT32 CXFA_FFPushButton::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFPushButton::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffpushbutton.h b/xfa/src/fxfa/src/app/xfa_ffpushbutton.h index 07503292f5..e82b8904b8 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpushbutton.h +++ b/xfa/src/fxfa/src/app/xfa_ffpushbutton.h @@ -15,12 +15,12 @@ class CXFA_FFPushButton : public CXFA_FFField public:
CXFA_FFPushButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFPushButton();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL LoadWidget();
virtual void UnloadWidget();
virtual FX_BOOL LayoutWidget();
virtual void UpdateWidgetProperty();
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
protected:
diff --git a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp index a7f48c7033..ed4beca66e 100644 --- a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp @@ -22,7 +22,7 @@ FX_BOOL CXFA_FFSignature::LoadWidget() {
return CXFA_FFField::LoadWidget();
}
-void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -66,7 +66,7 @@ FX_BOOL CXFA_FFSignature::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy {
return FALSE;
}
-FX_BOOL CXFA_FFSignature::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFSignature::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy)
{
return FALSE;
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffsignature.h b/xfa/src/fxfa/src/app/xfa_ffsignature.h index f7848d8b32..f82856b607 100644 --- a/xfa/src/fxfa/src/app/xfa_ffsignature.h +++ b/xfa/src/fxfa/src/app/xfa_ffsignature.h @@ -12,7 +12,7 @@ public: CXFA_FFSignature(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
virtual ~CXFA_FFSignature();
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL LoadWidget();
virtual FX_BOOL OnMouseEnter();
virtual FX_BOOL OnMouseExit();
@@ -20,7 +20,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
diff --git a/xfa/src/fxfa/src/app/xfa_fftext.cpp b/xfa/src/fxfa/src/app/xfa_fftext.cpp index 1d121a330a..2d153c2968 100644 --- a/xfa/src/fxfa/src/app/xfa_fftext.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftext.cpp @@ -20,7 +20,7 @@ CXFA_FFText::CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFText::~CXFA_FFText()
{
}
-void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -166,11 +166,11 @@ FX_LPCWSTR CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) FX_FLOAT x(fx), y(fy);
FWLToClient(x, y);
const CXFA_PieceLineArray* pPieceLines = pTextLayout->GetPieceLines();
- FX_INT32 iCount = pPieceLines->GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = pPieceLines->GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_PieceLine *pPieceLine = pPieceLines->GetAt(i);
- FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize();
- for (FX_INT32 j = 0; j < iPieces; j++) {
+ int32_t iPieces = pPieceLine->m_textPieces.GetSize();
+ for (int32_t j = 0; j < iPieces; j++) {
XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j);
if (pPiece->pLinkData && pPiece->rtPiece.Contains(x, y)) {
return pPiece->pLinkData->GetLinkURL();
diff --git a/xfa/src/fxfa/src/app/xfa_fftext.h b/xfa/src/fxfa/src/app/xfa_fftext.h index d686a97f4c..0210b55610 100644 --- a/xfa/src/fxfa/src/app/xfa_fftext.h +++ b/xfa/src/fxfa/src/app/xfa_fftext.h @@ -16,7 +16,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_DWORD OnHitTest(FX_FLOAT fx, FX_FLOAT fy);
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL IsLoaded();
virtual FX_BOOL LayoutWidget();
private:
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp index 5d50c52e84..afdfd1fee8 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp @@ -69,11 +69,11 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine;
}
XFA_ELEMENT eType = XFA_ELEMENT_UNKNOWN;
- FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(eType);
+ int32_t iMaxChars = m_pDataAcc->GetMaxChars(eType);
if (eType == XFA_ELEMENT_ExData) {
iMaxChars = 0;
}
- FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();
+ int32_t iNumCells = m_pDataAcc->GetNumberOfCells();
if (iNumCells == 0) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
pWidget->SetLimit(iMaxChars > 0 ? iMaxChars : 1);
@@ -208,7 +208,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment() {
FX_DWORD dwExtendedStyle = 0;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
- FX_INT32 iHorz = para.GetHorizontalAlign();
+ int32_t iHorz = para.GetHorizontalAlign();
switch(iHorz) {
case XFA_ATTRIBUTEENUM_Center:
dwExtendedStyle |= FWL_STYLEEXT_EDT_HCenter;
@@ -227,7 +227,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_EDT_HNear;
break;
}
- FX_INT32 iVert = para.GetVerticalAlign();
+ int32_t iVert = para.GetVerticalAlign();
switch(iVert) {
case XFA_ATTRIBUTEENUM_Middle:
dwExtendedStyle |= FWL_STYLEEXT_EDT_VCenter;
@@ -254,7 +254,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() FX_BOOL bUpdate = FALSE;
if (m_pDataAcc->GetUIType() == XFA_ELEMENT_TextEdit && m_pDataAcc->GetNumberOfCells() < 0) {
XFA_ELEMENT elementType = XFA_ELEMENT_UNKNOWN;
- FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(elementType);
+ int32_t iMaxChars = m_pDataAcc->GetMaxChars(elementType);
if (elementType == XFA_ELEMENT_ExData) {
iMaxChars = eType == XFA_VALUEPICTURE_Edit ? iMaxChars : 0;
}
@@ -294,7 +294,7 @@ FX_BOOL CXFA_FFTextEdit::Redo() }
FX_BOOL CXFA_FFTextEdit::CanCopy()
{
- FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
+ int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
return nCount > 0;
}
FX_BOOL CXFA_FFTextEdit::CanCut()
@@ -302,7 +302,7 @@ FX_BOOL CXFA_FFTextEdit::CanCut() if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {
return FALSE;
}
- FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
+ int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
return nCount > 0;
}
FX_BOOL CXFA_FFTextEdit::CanPaste()
@@ -327,7 +327,7 @@ FX_BOOL CXFA_FFTextEdit::Paste(const CFX_WideString &wsPaste) }
FX_BOOL CXFA_FFTextEdit::SelectAll()
{
- FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength();
+ int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength();
return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount);
}
FX_BOOL CXFA_FFTextEdit::Delete()
@@ -366,13 +366,13 @@ void CXFA_FFTextEdit::OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString & if (m_pDataAcc->GetUIType() == XFA_ELEMENT_DateTimeEdit) {
CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit;
pDateTime->GetEditText(eParam.m_wsNewText);
- FX_INT32 iSels = pDateTime->CountSelRanges();
+ int32_t iSels = pDateTime->CountSelRanges();
if (iSels ) {
eParam.m_iSelEnd = pDateTime->GetSelRange(0, eParam.m_iSelStart);
}
} else {
pEdit->GetText(eParam.m_wsNewText);
- FX_INT32 iSels = pEdit->CountSelRanges();
+ int32_t iSels = pEdit->CountSelRanges();
if (iSels ) {
eParam.m_iSelEnd = pEdit->GetSelRange(0, eParam.m_iSelStart);
}
@@ -404,7 +404,7 @@ FX_BOOL CXFA_FFTextEdit::GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSu }
return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);
}
-FX_INT32 CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage)
+int32_t CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage)
{
return m_pOldDelegate->OnProcessMessage(pMessage);
}
@@ -485,7 +485,7 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty() if (m_pDataAcc->GetHorizontalScrollPolicy() != XFA_ATTRIBUTEENUM_Off) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll;
}
- FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();
+ int32_t iNumCells = m_pDataAcc->GetNumberOfCells();
if (iNumCells > 0) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
pWidget->SetLimit(iNumCells);
@@ -515,9 +515,9 @@ FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget *pWidget, CFX_WideString &wsT if (!wsPattern.IsEmpty()) {
return TRUE;
}
- FX_INT32 iLeads = 0;
+ int32_t iLeads = 0;
m_pDataAcc->GetLeadDigits(iLeads);
- FX_INT32 iFracs = 0;
+ int32_t iFracs = 0;
m_pDataAcc->GetFracDigits(iFracs);
CFX_WideString wsFormat;
CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc);
@@ -661,7 +661,7 @@ void CXFA_FFDateTimeEdit::UpdateWidgetProperty() dwExtendedStyle |= GetAlignment();
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
FX_DWORD dwEditStyles = FWL_STYLEEXT_EDT_LastLineHeight;
- FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();
+ int32_t iNumCells = m_pDataAcc->GetNumberOfCells();
if (iNumCells > 0) {
dwEditStyles |= FWL_STYLEEXT_EDT_CombText;
pWidget->SetEditLimit(iNumCells);
@@ -678,7 +678,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment() {
FX_DWORD dwExtendedStyle = 0;
if (CXFA_Para para = m_pDataAcc->GetPara()) {
- FX_INT32 iHorz = para.GetHorizontalAlign();
+ int32_t iHorz = para.GetHorizontalAlign();
switch(iHorz) {
case XFA_ATTRIBUTEENUM_Center:
dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHCenter;
@@ -697,7 +697,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHNear;
break;
}
- FX_INT32 iVert = para.GetVerticalAlign();
+ int32_t iVert = para.GetVerticalAlign();
switch(iVert) {
case XFA_ATTRIBUTEENUM_Middle:
dwExtendedStyle |= FWL_STYLEEXT_DTP_EditVCenter;
@@ -816,7 +816,7 @@ FX_BOOL CXFA_FFDateTimeEdit::DeSelect() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect();
}
-void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)
+void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay)
{
CFX_WideString wsPicture;
m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit);
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.h b/xfa/src/fxfa/src/app/xfa_fftextedit.h index ecfe3bda83..ece1a4b9e3 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.h +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.h @@ -47,7 +47,7 @@ public: void OnAddDoRecord(IFWL_Widget *pWidget);
FX_BOOL CheckWord(FX_BSTR sWord);
FX_BOOL GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSuggest);
- virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
+ virtual int32_t OnProcessMessage(CFWL_Message *pMessage);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
};
@@ -111,7 +111,7 @@ protected: virtual FX_BOOL UpdateFWLData();
virtual FX_BOOL IsDataChanged();
public:
- void OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay);
+ void OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay);
virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
};
#endif
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp index 0967da1284..f747bdd2f9 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp @@ -102,7 +102,7 @@ FX_BOOL CXFA_FFWidget::GetToolTip(CFX_WideString &wsToolTip) }
return GetCaptionText(wsToolTip);
}
-void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )
+void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )
{
if (!IsMatchVisibleStatus(dwStatus)) {
return;
@@ -206,7 +206,7 @@ FX_BOOL CXFA_FFWidget::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
return FALSE;
}
-FX_BOOL CXFA_FFWidget::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidget::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy)
{
return FALSE;
}
@@ -279,7 +279,7 @@ void CXFA_FFWidget::Rotate2Normal(FX_FLOAT &fx, FX_FLOAT &fy) mtReverse.SetReverse(mt);
mtReverse.TransformPoint(fx, fy);
}
-static void XFA_GetMatrix(CFX_Matrix &m, FX_INT32 iRotate, FX_INT32 at, const CFX_RectF& rt)
+static void XFA_GetMatrix(CFX_Matrix &m, int32_t iRotate, int32_t at, const CFX_RectF& rt)
{
if (!iRotate) {
return;
@@ -329,7 +329,7 @@ static void XFA_GetMatrix(CFX_Matrix &m, FX_INT32 iRotate, FX_INT32 at, const CF void CXFA_FFWidget::GetRotateMatrix(CFX_Matrix &mt)
{
mt.Set(1, 0, 0, 1, 0, 0);
- FX_INT32 iRotate = m_pDataAcc->GetRotate();
+ int32_t iRotate = m_pDataAcc->GetRotate();
if (!iRotate) {
return;
}
@@ -440,7 +440,7 @@ void CXFA_FFWidget::SetButtonDown(FX_BOOL bSet) {
bSet ? m_dwStatus |= XFA_WIDGETSTATUS_ButtonDown : m_dwStatus &= ~XFA_WIDGETSTATUS_ButtonDown;
}
-FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType, FX_INT32 iCapType)
+int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType)
{
switch(iStrokeType) {
case XFA_ATTRIBUTEENUM_DashDot: {
@@ -484,7 +484,7 @@ FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType pGraphics->SetLineDash(FX_DASHSTYLE_Solid);
return FX_DASHSTYLE_Solid;
}
-CFX_GraphStateData::LineCap XFA_LineCapToFXGE(FX_INT32 iLineCap)
+CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap)
{
switch(iLineCap) {
case XFA_ATTRIBUTEENUM_Round:
@@ -515,7 +515,7 @@ protected: FX_DWORD m_Flags;
CFX_ImageTransformer* m_pTransformer;
FX_LPVOID m_DeviceHandle;
- FX_INT32 m_BlendType;
+ int32_t m_BlendType;
FX_BOOL m_Result;
FX_BOOL m_bPrint;
FX_BOOL StartDIBSource();
@@ -686,7 +686,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, in } else {
FX_DWORD fill_argb = (mask_argb);
if (bitmap_alpha < 255) {
- ((FX_BYTE*)&fill_argb)[3] = ((FX_BYTE*)&fill_argb)[3] * bitmap_alpha / 255;
+ ((uint8_t*)&fill_argb)[3] = ((uint8_t*)&fill_argb)[3] * bitmap_alpha / 255;
}
if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) {
return;
@@ -752,7 +752,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, in return;
}
}
-void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, FX_INT32 iAspect, FX_INT32 iImageXDpi, FX_INT32 iImageYDpi, FX_INT32 iHorzAlign, FX_INT32 iVertAlign)
+void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, int32_t iHorzAlign, int32_t iVertAlign)
{
if (rtImage.IsEmpty()) {
return;
@@ -817,7 +817,7 @@ void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMat }
pRenderDevice->RestoreState();
}
-const static FX_BYTE g_inv_base64[128] = {
+const static uint8_t g_inv_base64[128] = {
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
@@ -835,10 +835,10 @@ const static FX_BYTE g_inv_base64[128] = { 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 255, 255, 255, 255, 255,
};
-static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, FX_INT32 iLen)
+static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, int32_t iLen)
{
FX_LPBYTE pCP;
- FX_INT32 i = 0, j = 0;
+ int32_t i = 0, j = 0;
if (iLen == 0) {
iLen = FXSYS_strlen((FX_CHAR*)pStr);
}
@@ -853,7 +853,7 @@ static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, FX_INT32 iLen) pCP[j] = '\0';
return pCP;
}
-static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer)
+static int32_t XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer)
{
if (pStr == NULL) {
return 0;
@@ -862,8 +862,8 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) if (pBuffer == NULL) {
return 0;
}
- FX_INT32 iLen = FXSYS_strlen((FX_CHAR*)pBuffer);
- FX_INT32 i = 0, j = 0;
+ int32_t iLen = FXSYS_strlen((FX_CHAR*)pBuffer);
+ int32_t i = 0, j = 0;
FX_DWORD dwLimb = 0;
for (; i + 3 < iLen; i += 4) {
if (pBuffer[i] == '=' || pBuffer[i + 1] == '='
@@ -874,14 +874,14 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) if (pBuffer[i + 2] == '=') {
dwLimb = ((FX_DWORD)g_inv_base64[pBuffer[i]] << 6)
| ((FX_DWORD)g_inv_base64[pBuffer[i + 1]]);
- pOutBuffer[j] = (FX_BYTE)(dwLimb >> 4) & 0xFF;
+ pOutBuffer[j] = (uint8_t)(dwLimb >> 4) & 0xFF;
j++;
} else {
dwLimb = ((FX_DWORD)g_inv_base64[pBuffer[i]] << 12) |
((FX_DWORD)g_inv_base64[pBuffer[i + 1]] << 6) |
((FX_DWORD)g_inv_base64[pBuffer[i + 2]]);
- pOutBuffer[j] = (FX_BYTE)(dwLimb >> 10) & 0xFF;
- pOutBuffer[j + 1] = (FX_BYTE)(dwLimb >> 2) & 0xFF;
+ pOutBuffer[j] = (uint8_t)(dwLimb >> 10) & 0xFF;
+ pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 2) & 0xFF;
j += 2;
}
} else {
@@ -889,9 +889,9 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) ((FX_DWORD)g_inv_base64[pBuffer[i + 1]] << 12) |
((FX_DWORD)g_inv_base64[pBuffer[i + 2]] << 6) |
((FX_DWORD)g_inv_base64[pBuffer[i + 3]]);
- pOutBuffer[j] = (FX_BYTE)(dwLimb >> 16) & 0xff;
- pOutBuffer[j + 1] = (FX_BYTE)(dwLimb >> 8) & 0xff;
- pOutBuffer[j + 2] = (FX_BYTE)(dwLimb) & 0xff;
+ pOutBuffer[j] = (uint8_t)(dwLimb >> 16) & 0xff;
+ pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 8) & 0xff;
+ pOutBuffer[j + 2] = (uint8_t)(dwLimb) & 0xff;
j += 3;
}
}
@@ -899,7 +899,7 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) return j;
}
static FX_CHAR g_base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, FX_INT32 buf_len)
+FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, int32_t buf_len)
{
FX_LPSTR out = NULL;
int i, j;
@@ -959,7 +959,7 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(FX_WSTR wsType) }
return FXCODEC_IMAGE_UNKNOWN;
}
-CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi)
+CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, int32_t &iImageXDpi, int32_t &iImageYDpi)
{
CFX_WideString wsHref;
pImage->GetHref(wsHref);
@@ -978,9 +978,9 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &b XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding();
if (iEncoding == XFA_ATTRIBUTEENUM_Base64) {
CFX_ByteString bsData = wsImage.UTF8Encode();
- FX_INT32 iLength = bsData.GetLength();
+ int32_t iLength = bsData.GetLength();
pImageBuffer = FDE_Alloc(iLength);
- FX_INT32 iRead = XFA_Base64Decode((FX_LPCSTR)bsData, pImageBuffer);
+ int32_t iRead = XFA_Base64Decode((FX_LPCSTR)bsData, pImageBuffer);
if (iRead > 0) {
pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead);
}
@@ -1013,7 +1013,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &b pImageFileRead->Release();
return pBitmap;
}
-static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponents, FX_INT32 iBitsPerComponent)
+static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, int32_t iComponents, int32_t iBitsPerComponent)
{
FXDIB_Format dibFormat = FXDIB_Argb;
switch (type) {
@@ -1021,7 +1021,7 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponen case FXCODEC_IMAGE_JPG:
case FXCODEC_IMAGE_TIF: {
dibFormat = FXDIB_Rgb32;
- FX_INT32 bpp = iComponents * iBitsPerComponent;
+ int32_t bpp = iComponents * iBitsPerComponent;
if (bpp <= 24) {
dibFormat = FXDIB_Rgb;
}
@@ -1033,7 +1033,7 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponen }
return dibFormat;
}
-CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi)
+CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t &iImageXDpi, int32_t &iImageYDpi)
{
CFX_GEModule* pGeModule = CFX_GEModule::Get();
if (!pGeModule) {
@@ -1049,12 +1049,12 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAG FXCODEC_STATUS status = pProgressiveDecoder->LoadImageInfo(pImageFileRead, type, &dibAttr);
switch (dibAttr.m_wDPIUnit) {
case FXCODEC_RESUNIT_CENTIMETER:
- dibAttr.m_nXDPI = (FX_INT32)(dibAttr.m_nXDPI * 2.54f);
- dibAttr.m_nYDPI = (FX_INT32)(dibAttr.m_nYDPI * 2.54f);
+ dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI * 2.54f);
+ dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI * 2.54f);
break;
case FXCODEC_RESUNIT_METER:
- dibAttr.m_nXDPI = (FX_INT32)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f);
- dibAttr.m_nYDPI = (FX_INT32)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f);
+ dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f);
+ dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f);
break;;
default:
break;
@@ -1063,13 +1063,13 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAG iImageYDpi = dibAttr.m_nYDPI > 1 ? dibAttr.m_nYDPI : (96);
if (pProgressiveDecoder->GetWidth() > 0 && pProgressiveDecoder->GetHeight() > 0) {
type = pProgressiveDecoder->GetType();
- FX_INT32 iComponents = pProgressiveDecoder->GetNumComponents();
- FX_INT32 iBpc = pProgressiveDecoder->GetBPC();
+ int32_t iComponents = pProgressiveDecoder->GetNumComponents();
+ int32_t iBpc = pProgressiveDecoder->GetBPC();
FXDIB_Format dibFormat = XFA_GetDIBFormat(type, iComponents, iBpc);
pBitmap = FX_NEW CFX_DIBitmap();
pBitmap->Create(pProgressiveDecoder->GetWidth(), pProgressiveDecoder->GetHeight(), dibFormat);
pBitmap->Clear(0xffffffff);
- FX_INT32 nFrames;
+ int32_t nFrames;
if ((pProgressiveDecoder->GetFrames(nFrames) == FXCODEC_STATUS_DECODE_READY) && (nFrames > 0)) {
pProgressiveDecoder->StartDecode(pBitmap, 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
pProgressiveDecoder->ContinueDecode();
@@ -1126,14 +1126,14 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box, CFX_RectF rtDraw, CFX_Path &fillPa sweepAngle = -sweepAngle * FX_PI / 180.0f;
fillPath.AddArc(rtDraw.left, rtDraw.top, rtDraw.width, rtDraw.height, startAngle, sweepAngle);
}
-static void XFA_BOX_GetPath(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_RectF rtWidget, CFX_Path &path, FX_INT32 nIndex, FX_BOOL bStart, FX_BOOL bCorner)
+static void XFA_BOX_GetPath(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_RectF rtWidget, CFX_Path &path, int32_t nIndex, FX_BOOL bStart, FX_BOOL bCorner)
{
FXSYS_assert(nIndex >= 0 && nIndex < 8);
FX_BOOL bInverted, bRound;
FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny, offsetY, offsetX, offsetEX, offsetEY;
CFX_PointF cpStart, cp, cp1, cp2;
CFX_RectF rtRadius;
- FX_INT32 n = (nIndex & 1) ? nIndex - 1 : nIndex;
+ int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex;
CXFA_Corner corner1 = (CXFA_Node*)strokes[n];
CXFA_Corner corner2 = (CXFA_Node*)strokes[(n + 2) % 8];
fRadius1 = bCorner ? corner1.GetRadius() : 0;
@@ -1283,7 +1283,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C fThickness = 0;
}
FX_FLOAT fHalf = fThickness / 2;
- FX_INT32 iHand = box.GetHand();
+ int32_t iHand = box.GetHand();
if (iHand == XFA_ATTRIBUTEENUM_Left) {
rtWidget.Inflate(fHalf, fHalf);
} else if (iHand == XFA_ATTRIBUTEENUM_Right) {
@@ -1293,7 +1293,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C return;
}
FX_BOOL bSameStyles = TRUE;
- FX_INT32 i;
+ int32_t i;
CXFA_Stroke stroke1 = strokes[0];
for (i = 1; i < 8; i ++) {
CXFA_Stroke stroke2 = strokes[i];
@@ -1331,7 +1331,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny;
CFX_PointF cp, cp1, cp2;
CFX_RectF rtRadius;
- for (FX_INT32 i = 0; i < 8; i += 2) {
+ for (int32_t i = 0; i < 8; i += 2) {
CXFA_Corner corner1 = (CXFA_Node*)strokes[i];
CXFA_Corner corner2 = (CXFA_Node*)strokes[(i + 2) % 8];
fRadius1 = corner1.GetRadius();
@@ -1420,7 +1420,7 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fillP CXFA_Fill fill = box.GetFill();
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
- FX_INT32 iType = fill.GetRadial(crEnd);
+ int32_t iType = fill.GetRadial(crEnd);
CFX_Shading shading;
if (iType != XFA_ATTRIBUTEENUM_ToEdge) {
FX_ARGB temp = crEnd;
@@ -1437,8 +1437,8 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fill CXFA_Fill fill = box.GetFill();
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
- FX_INT32 iType = fill.GetPattern(crEnd);
- FX_INT32 iHatch = FX_HATCHSTYLE_Cross;
+ int32_t iType = fill.GetPattern(crEnd);
+ int32_t iHatch = FX_HATCHSTYLE_Cross;
switch(iType) {
case XFA_ATTRIBUTEENUM_CrossDiagonal:
iHatch = FX_HATCHSTYLE_DiagonalCross;
@@ -1469,7 +1469,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fillP CXFA_Fill fill = box.GetFill();
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
- FX_INT32 iType = fill.GetLinear(crEnd);
+ int32_t iType = fill.GetLinear(crEnd);
CFX_PointF ptStart, ptEnd;
switch(iType) {
case XFA_ATTRIBUTEENUM_ToRight:
@@ -1508,7 +1508,7 @@ static void XFA_BOX_Fill(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Grap fillPath.Create();
XFA_BOX_GetFillPath(box, strokes, rtWidget, fillPath, (dwFlags & XFA_DRAWBOX_ForceRound) != 0);
fillPath.Close();
- FX_INT32 eType = fill.GetFillType();
+ int32_t eType = fill.GetFillType();
switch(eType) {
case XFA_ELEMENT_Radial:
XFA_BOX_Fill_Radial(box, pGS, fillPath, rtWidget, pMatrix);
@@ -1522,11 +1522,11 @@ static void XFA_BOX_Fill(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Grap default: {
FX_ARGB cr;
if (eType == XFA_ELEMENT_Stipple) {
- FX_INT32 iRate = fill.GetStipple(cr);
+ int32_t iRate = fill.GetStipple(cr);
if (iRate == 0) {
iRate = 100;
}
- FX_INT32 a = 0;
+ int32_t a = 0;
FX_COLORREF rgb;
ArgbDecode(cr, a, rgb);
cr = ArgbEncode(iRate * a / 100, rgb);
@@ -1570,7 +1570,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, CFX_Graphics* pGS, CFX_RectF rtWidge }
FX_BOOL bVisible = FALSE;
FX_FLOAT fThickness = 0;
- FX_INT32 i3DType = box.Get3DStyle(bVisible, fThickness);
+ int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
if (bVisible && fThickness >= 0.001f) {
dwFlags |= XFA_DRAWBOX_Lowered3D;
@@ -1580,7 +1580,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, CFX_Graphics* pGS, CFX_RectF rtWidge if (fHalf < 0) {
fHalf = 0;
}
- FX_INT32 iHand = box.GetHand();
+ int32_t iHand = box.GetHand();
if (iHand == XFA_ATTRIBUTEENUM_Left) {
rtWidget.Inflate(fHalf, fHalf);
} else if (iHand == XFA_ATTRIBUTEENUM_Right) {
@@ -1713,7 +1713,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, const CXFA_StrokeArray &strokes, C {
FX_BOOL bVisible = FALSE;
FX_FLOAT fThickness = 0;
- FX_INT32 i3DType = box.Get3DStyle(bVisible, fThickness);
+ int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
if (!bVisible || fThickness < 0.001f) {
return;
@@ -1736,7 +1736,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, const CXFA_StrokeArray &strokes, C }
FX_BOOL bClose = FALSE;
FX_BOOL bSameStyles = TRUE;
- FX_INT32 i;
+ int32_t i;
CXFA_Stroke stroke1 = strokes[0];
for (i = 1; i < 8; i ++) {
CXFA_Stroke stroke2 = strokes[i];
@@ -1804,7 +1804,7 @@ static void XFA_BOX_Stroke(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Gr return;
}
FX_BOOL bVisible = FALSE;
- for (FX_INT32 j = 0; j < 4; j ++) {
+ for (int32_t j = 0; j < 4; j ++) {
bVisible |= strokes[j * 2 + 1].IsVisible();
if (bVisible) {
break;
@@ -1813,14 +1813,14 @@ static void XFA_BOX_Stroke(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Gr if (!bVisible) {
return;
}
- for (FX_INT32 i = 1; i < 8; i += 2) {
+ for (int32_t i = 1; i < 8; i += 2) {
CXFA_Edge edge = (CXFA_Node*)strokes[i];
FX_FLOAT fThickness = edge.GetThickness();
if (fThickness < 0) {
fThickness = 0;
}
FX_FLOAT fHalf = fThickness / 2;
- FX_INT32 iHand = box.GetHand();
+ int32_t iHand = box.GetHand();
switch (i) {
case 1:
if (iHand == XFA_ATTRIBUTEENUM_Left) {
@@ -1863,7 +1863,7 @@ void XFA_DrawBox(CXFA_Box box, CFX_Graphics* pGS, const CFX_RectF &rtWidget, CFX if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {
return;
}
- FX_INT32 iType = box.GetClassID();
+ int32_t iType = box.GetClassID();
if (iType != XFA_ELEMENT_Arc && iType != XFA_ELEMENT_Border && iType != XFA_ELEMENT_Rectangle) {
return;
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.h b/xfa/src/fxfa/src/app/xfa_ffwidget.h index 8f19e71a0e..80f4be4d30 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidget.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidget.h @@ -36,7 +36,7 @@ public: m_Globals.RemoveAll();
}
CFX_PtrArray m_Globals;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
};
class CXFA_FFWidget : public IXFA_Widget, public CFX_PrivateData, public CXFA_ContentLayoutItemImpl
{
@@ -52,7 +52,7 @@ public: virtual FX_BOOL GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);
CXFA_WidgetAcc* GetDataAcc();
FX_BOOL GetToolTip(CFX_WideString &wsToolTip);
- virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0);
+ virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0);
virtual FX_BOOL IsLoaded();
virtual FX_BOOL LoadWidget();
@@ -66,7 +66,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -188,15 +188,15 @@ protected: CXFA_WidgetAcc* m_pDataAcc;
CFX_RectF m_rtWidget;
};
-FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType, FX_INT32 iCapType);
-CFX_GraphStateData::LineCap XFA_LineCapToFXGE(FX_INT32 iLineCap);
-void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, FX_INT32 iAspect, FX_INT32 iImageXDpi, FX_INT32 iImageYDpi, FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left, FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top);
-CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
-CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
+int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType);
+CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap);
+void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left, int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top);
+CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, int32_t &iImageXDpi, int32_t &iImageYDpi);
+CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t &iImageXDpi, int32_t &iImageYDpi);
FXCODEC_IMAGE_TYPE XFA_GetImageType(FX_WSTR wsType);
-FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, FX_INT32 buf_len);
+FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, int32_t buf_len);
void XFA_RectWidthoutMargin(CFX_RectF &rt, const CXFA_Margin &mg, FX_BOOL bUI = FALSE);
-FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, FX_INT32 nIndex);
+FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, int32_t nIndex);
CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem);
FX_BOOL XFA_IsCreateWidget(XFA_ELEMENT iType);
#define XFA_DRAWBOX_ForceRound 1
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp index a154d76392..3f105d98d6 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp @@ -109,8 +109,8 @@ public: CFX_DIBitmap* m_pDIBitmap;
FX_BOOL m_bNamedImage;
- FX_INT32 m_iImageXDpi;
- FX_INT32 m_iImageYDpi;
+ int32_t m_iImageXDpi;
+ int32_t m_iImageYDpi;
};
class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData
{
@@ -198,8 +198,8 @@ public: }
CFX_DIBitmap* m_pDIBitmap;
FX_BOOL m_bNamedImage;
- FX_INT32 m_iImageXDpi;
- FX_INT32 m_iImageYDpi;
+ int32_t m_iImageXDpi;
+ int32_t m_iImageYDpi;
};
CXFA_WidgetAcc::CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode)
: CXFA_WidgetData(pNode)
@@ -214,7 +214,7 @@ CXFA_WidgetAcc::~CXFA_WidgetAcc() m_pLayoutData = NULL;
}
}
-FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString &wsName, FX_INT32 iNameType )
+FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString &wsName, int32_t iNameType )
{
if (iNameType == 0) {
m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName);
@@ -346,17 +346,17 @@ IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() {
return GetApp()->GetAppProvider();
}
-FX_INT32 CXFA_WidgetAcc::ProcessEvent(FX_INT32 iActivity, CXFA_EventParam* pEventParam)
+int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam)
{
if (this->GetClassID() == XFA_ELEMENT_Draw) {
return XFA_EVENTERROR_NotExist;
}
- FX_INT32 iRet = XFA_EVENTERROR_NotExist;
+ int32_t iRet = XFA_EVENTERROR_NotExist;
CXFA_NodeArray eventArray;
- FX_INT32 iCounts = GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady);
- for (FX_INT32 i = 0; i < iCounts; i++) {
+ int32_t iCounts = GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady);
+ for (int32_t i = 0; i < iCounts; i++) {
CXFA_Event event(eventArray[i]);
- FX_INT32 result = ProcessEvent(event, pEventParam);
+ int32_t result = ProcessEvent(event, pEventParam);
if (i == 0) {
iRet = result;
} else if (result == XFA_EVENTERROR_Sucess) {
@@ -365,7 +365,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessEvent(FX_INT32 iActivity, CXFA_EventParam* pEven }
return iRet;
}
-FX_INT32 CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam)
+int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam)
{
if (!event) {
return XFA_EVENTERROR_NotExist;
@@ -389,7 +389,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEvent }
return XFA_EVENTERROR_NotExist;
}
-FX_INT32 CXFA_WidgetAcc::ProcessCalculate()
+int32_t CXFA_WidgetAcc::ProcessCalculate()
{
if (this->GetClassID() == XFA_ELEMENT_Draw) {
return XFA_EVENTERROR_NotExist;
@@ -404,7 +404,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessCalculate() CXFA_EventParam EventParam;
EventParam.m_eType = XFA_EVENT_Calculate;
CXFA_Script script = calc.GetScript();
- FX_INT32 iRet = ExecuteScript(script, &EventParam);
+ int32_t iRet = ExecuteScript(script, &EventParam);
if (iRet == XFA_EVENTERROR_Sucess) {
if (GetRawValue() != EventParam.m_wsResult) {
FX_BOOL bNotify = GetDoc()->GetDocType() == XFA_DOCTYPE_Static;
@@ -418,7 +418,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessCalculate() }
return iRet;
}
-void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag)
+void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, int32_t iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag)
{
if (iRet == XFA_EVENTERROR_Sucess && pRetValue) {
if (FXJSE_Value_IsBoolean(pRetValue) && !FXJSE_Value_ToBoolean(pRetValue)) {
@@ -430,7 +430,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
CFX_WideString wsScriptMsg;
validate.GetScriptMessageText(wsScriptMsg);
- FX_INT32 eScriptTest = validate.GetScriptTest();
+ int32_t eScriptTest = validate.GetScriptTest();
if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) {
if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) {
return;
@@ -454,7 +454,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 }
}
}
-FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag)
+int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag)
{
CFX_WideString wsRawValue = GetRawValue();
if (!wsRawValue.IsEmpty()) {
@@ -477,7 +477,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BO validate.GetFormatMessageText(wsFormatMsg);
CFX_WideString wsTitle;
pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
- FX_INT32 eFormatTest = validate.GetFormatTest();
+ int32_t eFormatTest = validate.GetFormatTest();
if (eFormatTest == XFA_ATTRIBUTEENUM_Error) {
if (wsFormatMsg.IsEmpty()) {
GetValidateMessage(pAppProvider, wsFormatMsg, TRUE, bVersionFlag);
@@ -503,7 +503,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BO }
return XFA_EVENTERROR_NotExist;
}
-FX_INT32 CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, FX_INT32 iFlags, FX_BOOL bVersionFlag)
+int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, FX_BOOL bVersionFlag)
{
CFX_WideString wsValue;
this->GetValue(wsValue, XFA_VALUEPICTURE_Raw);
@@ -513,11 +513,11 @@ FX_INT32 CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, FX_INT3 if (this->m_bIsNull && (this->m_bPreNull == this->m_bIsNull)) {
return XFA_EVENTERROR_Sucess;
}
- FX_INT32 eNullTest = validate.GetNullTest();
+ int32_t eNullTest = validate.GetNullTest();
CFX_WideString wsNullMsg;
validate.GetNullMessageText(wsNullMsg);
if (iFlags & 0x01) {
- FX_INT32 iRet = XFA_EVENTERROR_Sucess;
+ int32_t iRet = XFA_EVENTERROR_Sucess;
if (eNullTest != XFA_ATTRIBUTEENUM_Disabled) {
iRet = XFA_EVENTERROR_Error;
}
@@ -609,7 +609,7 @@ void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider, CFX_Wide pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning);
wsMessage.Format(wsWarning, (FX_LPCWSTR)wsCaptionName, (FX_LPCWSTR)wsCaptionName);
}
-FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags)
+int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags)
{
if (this->GetClassID() == XFA_ELEMENT_Draw) {
return XFA_EVENTERROR_NotExist;
@@ -620,9 +620,9 @@ FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags) }
FX_BOOL bInitDoc = ((CXFA_Node*)validate)->HasFlag(XFA_NODEFLAG_NeedsInitApp);
FX_BOOL bStatus = m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End;
- FX_INT32 iFormat = 0;
+ int32_t iFormat = 0;
FXJSE_HVALUE pRetValue = NULL;
- FX_INT32 iRet = XFA_EVENTERROR_NotExist;
+ int32_t iRet = XFA_EVENTERROR_NotExist;
CXFA_Script script = validate.GetScript();
if (script) {
CXFA_EventParam eParam;
@@ -652,7 +652,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags) }
return iRet | iFormat;
}
-FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue)
+int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue)
{
FXSYS_assert(pEventParam);
if (!script) {
@@ -681,7 +681,7 @@ FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEve FXJSE_HVALUE hRetValue = FXJSE_Value_Create(pContext->GetRuntime());
FX_BOOL bRet = FALSE;
bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, wsExpression, hRetValue, m_pNode);
- FX_INT32 iRet = XFA_EVENTERROR_Error;
+ int32_t iRet = XFA_EVENTERROR_Error;
if (bRet) {
iRet = XFA_EVENTERROR_Sucess;
if (pEventParam->m_eType == XFA_EVENT_Calculate || pEventParam->m_eType == XFA_EVENT_InitCalculate) {
@@ -701,8 +701,8 @@ FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEve m_pDocView->AddValidateWidget(this);
}
}
- FX_INT32 iRefs = refNodes.GetSize();
- for (FX_INT32 r = 0; r < iRefs; r++) {
+ int32_t iRefs = refNodes.GetSize();
+ for (int32_t r = 0; r < iRefs; r++) {
CXFA_WidgetAcc* pRefAcc = (CXFA_WidgetAcc*)refNodes[r]->GetWidgetData();
if (pRefAcc && pRefAcc == this) {
continue;
@@ -773,7 +773,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF &szCap) }
LoadCaption();
XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType();
- FX_INT32 iCapPlacement = caption.GetPlacementType();
+ int32_t iCapPlacement = caption.GetPlacementType();
FX_FLOAT fCapReserve = caption.GetReserve();
FX_BOOL bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top || iCapPlacement == XFA_ATTRIBUTEENUM_Bottom;
FX_BOOL bReserveExit = fCapReserve > 0.01;
@@ -826,7 +826,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF &size) size.x += rtUIMargin.left + rtUIMargin.width;
size.y += rtUIMargin.top + rtUIMargin.height;
if (szCap.x > 0 && szCap.y > 0) {
- FX_INT32 iCapPlacement = this->GetCaption().GetPlacementType();
+ int32_t iCapPlacement = this->GetCaption().GetPlacementType();
switch(iCapPlacement) {
case XFA_ATTRIBUTEENUM_Left:
case XFA_ATTRIBUTEENUM_Right:
@@ -924,7 +924,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF &size) szCap.Set(0, 0);
CalcCaptionSize(szCap);
FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01;
- FX_INT32 iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
+ int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
if (bCapExit) {
iCapPlacement = this->GetCaption().GetPlacementType();
switch(iCapPlacement) {
@@ -993,8 +993,8 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF &size) CFX_RectF rtImage, rtFit;
rtImage.Set(0, 0, 0, 0);
rtFit.Set(0, 0, 0, 0);
- FX_INT32 iImageXDpi = 0;
- FX_INT32 iImageYDpi = 0;
+ int32_t iImageXDpi = 0;
+ int32_t iImageYDpi = 0;
GetImageDpi(iImageXDpi, iImageYDpi);
rtImage.width = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi);
rtImage.height = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi);
@@ -1023,8 +1023,8 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF &size) CFX_RectF rtImage, rtFit;
rtImage.Set(0, 0, 0, 0);
rtFit.Set(0, 0, 0, 0);
- FX_INT32 iImageXDpi = 0;
- FX_INT32 iImageYDpi = 0;
+ int32_t iImageXDpi = 0;
+ int32_t iImageYDpi = 0;
GetImageEditDpi(iImageXDpi, iImageYDpi);
rtImage.width = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi);
rtImage.height = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi);
@@ -1053,12 +1053,12 @@ FX_BOOL CXFA_WidgetAcc::LoadImageEditImage() InitLayoutData();
return ((CXFA_ImageEditData*)m_pLayoutData)->LoadImageData(this);
}
-void CXFA_WidgetAcc::GetImageDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi)
+void CXFA_WidgetAcc::GetImageDpi(int32_t &iImageXDpi, int32_t &iImageYDpi)
{
iImageXDpi = ((CXFA_ImageLayoutData*)m_pLayoutData)->m_iImageXDpi;
iImageYDpi = ((CXFA_ImageLayoutData*)m_pLayoutData)->m_iImageYDpi;
}
-void CXFA_WidgetAcc::GetImageEditDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi)
+void CXFA_WidgetAcc::GetImageEditDpi(int32_t &iImageXDpi, int32_t &iImageYDpi)
{
iImageXDpi = ((CXFA_ImageEditData*)m_pLayoutData)->m_iImageXDpi;
iImageYDpi = ((CXFA_ImageEditData*)m_pLayoutData)->m_iImageYDpi;
@@ -1210,7 +1210,7 @@ void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, FX_FLOAT& f m_pLayoutData->m_fWidgetHeight = sz.y;
fCalcHeight = sz.y;
}
-FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight)
+FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT &fCalcHeight)
{
XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType();
if (eUIType == XFA_ELEMENT_Subform) {
@@ -1273,7 +1273,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight fCapReserve = 0;
}
}
- FX_INT32 iLinesCount = 0;
+ int32_t iLinesCount = 0;
FX_FLOAT fHeight = m_pLayoutData->m_fWidgetHeight;
CFX_WideString wsText;
this->GetValue(wsText, XFA_VALUEPICTURE_Display);
@@ -1291,9 +1291,9 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pFieldSplitArray = FX_NEW CFX_FloatArray;
}
CFX_FloatArray* pFieldArray = ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pFieldSplitArray;
- FX_INT32 iFieldSplitCount = pFieldArray->GetSize();
- for (FX_INT32 i = 0; i < iBlockIndex * 3; i += 3) {
- iLinesCount -= (FX_INT32)pFieldArray->GetAt(i + 1);
+ int32_t iFieldSplitCount = pFieldArray->GetSize();
+ for (int32_t i = 0; i < iBlockIndex * 3; i += 3) {
+ iLinesCount -= (int32_t)pFieldArray->GetAt(i + 1);
fHeight -= pFieldArray->GetAt(i + 2);
}
if (iLinesCount == 0) {
@@ -1327,7 +1327,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight fStartOffset = 0;
}
}
- for (FX_INT32 i = iBlockIndex - 1; iBlockIndex > 0 && i < iBlockIndex; i++) {
+ for (int32_t i = iBlockIndex - 1; iBlockIndex > 0 && i < iBlockIndex; i++) {
fStartOffset = pFieldArray->GetAt(i * 3) - pFieldArray->GetAt(i * 3 + 2);
if (fStartOffset < 0.1f) {
fStartOffset = 0;
@@ -1380,7 +1380,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight return TRUE;
}
FX_FLOAT fTextNum = fCalcHeight + XFA_FLOAT_PERCISION - fCapReserve - fStartOffset;
- FX_INT32 iLineNum = (FX_INT32)((fTextNum + (fLineHeight - fFontSize)) / fLineHeight);
+ int32_t iLineNum = (int32_t)((fTextNum + (fLineHeight - fFontSize)) / fLineHeight);
if (iLineNum >= iLinesCount) {
if (fCalcHeight - fStartOffset - fTextHeight >= fFontSize) {
if (iFieldSplitCount / 3 == (iBlockIndex + 1)) {
@@ -1399,7 +1399,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight return TRUE;
}
} else {
- iLineNum = (FX_INT32)(fTextNum / fLineHeight);
+ iLineNum = (int32_t)(fTextNum / fLineHeight);
}
}
if (iLineNum > 0) {
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp index 856c0792bb..d43c5a6312 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp @@ -40,7 +40,7 @@ CXFA_WidgetAcc* CXFA_FFWidgetHandler::GetDataAcc(IXFA_Widget* hWidget) {
return static_cast<CXFA_FFWidget*>(hWidget)->GetDataAcc();
}
-void CXFA_FFWidgetHandler::GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType )
+void CXFA_FFWidgetHandler::GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, int32_t iNameType )
{
static_cast<CXFA_FFWidget*>(hWidget)->GetDataAcc()->GetName(wsName, iNameType);
}
@@ -108,7 +108,7 @@ FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy)
{
static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnMouseWheel(dwFlags, zDelta, fx, fy);
@@ -210,7 +210,7 @@ FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE CXFA_NodeArray eventArray;
return pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType], eventArray);
}
-FX_INT32 CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam)
+int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam)
{
if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) {
return XFA_EVENTERROR_NotExist;
@@ -240,7 +240,7 @@ FX_INT32 CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_Eve default:
break;
}
- FX_INT32 iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam);
+ int32_t iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam);
return iRet;
}
IXFA_Widget* CXFA_FFWidgetHandler::CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore )
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h index 28c6c84651..7c47b8d1a1 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h @@ -18,7 +18,7 @@ public: virtual FX_DWORD GetStatus(IXFA_Widget* hWidget);
virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);
virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget);
- virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0);
+ virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, int32_t iNameType = 0);
virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip);
virtual void SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
virtual FX_LPVOID GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id);
@@ -28,7 +28,7 @@ public: virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -40,7 +40,7 @@ public: virtual FX_BOOL OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
virtual void RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE);
virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType);
- virtual FX_INT32 ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam);
+ virtual int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam);
protected:
CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, CXFA_Node* pParent, CXFA_Node* pBefore) const;
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp index 5cacacfff6..127278fb46 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp @@ -966,9 +966,9 @@ void XFA_LocalFontNameToEnglishName(FX_WSTR wsLocalName, CFX_WideString &wsEngli wsEnglishName = wsLocalName;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ || _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
FX_DWORD dwLocalNameHash = FX_HashCode_String_GetW(wsLocalName.GetPtr(), wsLocalName.GetLength(), TRUE);
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
- FX_INT32 iMid = 0;
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
+ int32_t iMid = 0;
do {
iMid = (iStart + iEnd) / 2;
FX_DWORD dwFontNameHash = g_XFAFontsMap[iMid].dwFontNameHash;
@@ -989,9 +989,9 @@ const XFA_FONTINFO* XFA_GetFontINFOByFontName(FX_WSTR wsFontName) CFX_WideString wsFontNameTemp = wsFontName;
wsFontNameTemp.Remove(L' ');
FX_DWORD dwCurFontNameHash = FX_HashCode_String_GetW(wsFontNameTemp, wsFontNameTemp.GetLength(), TRUE);
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
- FX_INT32 iMid = 0;
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
+ int32_t iMid = 0;
const XFA_FONTINFO *pFontInfo = NULL;
do {
iMid = (iStart + iEnd) / 2;
@@ -1021,8 +1021,8 @@ IXFA_FontMgr::~IXFA_FontMgr() }
CXFA_DefFontMgr::~CXFA_DefFontMgr()
{
- FX_INT32 iCounts = m_CacheFonts.GetSize();
- for (FX_INT32 i = 0; i < iCounts; i++) {
+ int32_t iCounts = m_CacheFonts.GetSize();
+ for (int32_t i = 0; i < iCounts; i++) {
((IFX_Font*)m_CacheFonts[i])->Release();
}
m_CacheFonts.RemoveAll();
@@ -1054,7 +1054,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWOR dwStyle |= FX_FONTSTYLE_Italic;
}
FX_LPCWSTR pReplace = pCurFont->pReplaceFont;
- FX_INT32 iLength = FXSYS_wcslen(pReplace);
+ int32_t iLength = FXSYS_wcslen(pReplace);
while (iLength > 0) {
FX_LPCWSTR pNameText = pReplace;
while (*pNameText != L',' && iLength > 0) {
@@ -1204,10 +1204,10 @@ IFX_Font* CXFA_PDFFontMgr::GetFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, CFX_ByteString CXFA_PDFFontMgr::PsNameToFontName(const CFX_ByteString& strPsName,
FX_BOOL bBold, FX_BOOL bItalic)
{
- FX_INT32 nCount = sizeof(g_XFAPDFFontName) / sizeof(XFA_PDFFONTNAME);
- for (FX_INT32 i = 0; i < nCount; i++) {
+ int32_t nCount = sizeof(g_XFAPDFFontName) / sizeof(XFA_PDFFONTNAME);
+ for (int32_t i = 0; i < nCount; i++) {
if (strPsName == g_XFAPDFFontName[i].lpPsName) {
- FX_INT32 index = 1 + ((bItalic << 1) | bBold);
+ int32_t index = 1 + ((bItalic << 1) | bBold);
return *(&g_XFAPDFFontName[i].lpPsName + index);
}
}
@@ -1217,17 +1217,17 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName(FX_BSTR bsPsName, FX_BOOL bBold, {
CFX_ByteString bsDRName = bsDRFontName;
bsDRName.Remove('-');
- FX_INT32 iPsLen = bsPsName.GetLength();
- FX_INT32 nIndex = bsDRName.Find(bsPsName);
+ int32_t iPsLen = bsPsName.GetLength();
+ int32_t nIndex = bsDRName.Find(bsPsName);
if (nIndex != -1 && !bStrictMatch) {
return TRUE;
}
if (nIndex != 0) {
return FALSE;
}
- FX_INT32 iDifferLength = bsDRName.GetLength() - iPsLen;
+ int32_t iDifferLength = bsDRName.GetLength() - iPsLen;
if (iDifferLength > 1 || (bBold || bItalic)) {
- FX_INT32 iBoldIndex = bsDRName.Find(FX_BSTRC("Bold"));
+ int32_t iBoldIndex = bsDRName.Find(FX_BSTRC("Bold"));
FX_BOOL bBoldFont = iBoldIndex > 0;
if (bBold ^ bBoldFont) {
return FALSE;
@@ -1284,7 +1284,7 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName(FX_BSTR bsPsName, FX_BOOL bBold, }
return TRUE;
}
-FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode)
+FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode)
{
if (wUnicode != 0x20 || bCharCode) {
return FALSE;
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.h b/xfa/src/fxfa/src/app/xfa_fontmgr.h index 9de1348293..f612664644 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.h +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.h @@ -29,7 +29,7 @@ public: CXFA_PDFFontMgr(CXFA_FFDoc* pDoc);
~CXFA_PDFFontMgr();
IFX_Font* GetFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, CPDF_Font** pPDFFont, FX_BOOL bStrictMatch = TRUE);
- FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode);
+ FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode);
CFX_MapPtrToPtr m_FDE2PDFFont;
protected:
IFX_Font* FindFont(CFX_ByteString strFamilyName, FX_BOOL bBold, FX_BOOL bItalic, CPDF_Font** pPDFFont, FX_BOOL bStrictMatch = TRUE);
diff --git a/xfa/src/fxfa/src/app/xfa_fwladapter.h b/xfa/src/fxfa/src/app/xfa_fwladapter.h index 8e830142c4..1ddfcf4113 100644 --- a/xfa/src/fxfa/src/app/xfa_fwladapter.h +++ b/xfa/src/fxfa/src/app/xfa_fwladapter.h @@ -22,7 +22,7 @@ public: }
virtual void OnPreOpen(IFWL_Widget *pWidget) {}
virtual void OnPostOpen(IFWL_Widget *pWidget) {}
- virtual void OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) {}
+ virtual void OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay) {}
virtual void OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString &wsChanged) {}
virtual void OnTextFull(IFWL_Widget *pWidget) {}
virtual FX_BOOL OnValidate(IFWL_Widget *pWidget, CFX_WideString &wsText)
diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp index 036d6f1157..ca9bf5e890 100644 --- a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp +++ b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp @@ -65,7 +65,7 @@ static FX_LPCWSTR g_FWLTheme_CalFonts[] = { FWL_ERR CXFA_FWLTheme::Initialize()
{
m_pTextOut = IFDE_TextOut::Create();
- for (FX_INT32 i = 0; NULL == m_pCalendarFont && i < sizeof(g_FWLTheme_CalFonts) / sizeof(FX_LPCWSTR); i++) {
+ for (int32_t i = 0; NULL == m_pCalendarFont && i < sizeof(g_FWLTheme_CalFonts) / sizeof(FX_LPCWSTR); i++) {
m_pCalendarFont = IFX_Font::LoadFont(g_FWLTheme_CalFonts[i], 0, 0, m_pApp->GetFDEFontMgr());
}
if (NULL == m_pCalendarFont)
@@ -349,7 +349,7 @@ FX_BOOL CXFA_FWLCheckBoxTP::DrawBackground(CFWL_ThemeBackground *pParams) }
return TRUE;
}
-void CXFA_FWLCheckBoxTP::DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, FX_INT32 iState, CFX_Matrix* pMatrix)
+void CXFA_FWLCheckBoxTP::DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, int32_t iState, CFX_Matrix* pMatrix)
{
CFX_RectF rtSign(*pRtBox);
FX_DWORD dwColor = 0xFF000000;
diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.h b/xfa/src/fxfa/src/app/xfa_fwltheme.h index 34003b4eb1..37b8d1336a 100644 --- a/xfa/src/fxfa/src/app/xfa_fwltheme.h +++ b/xfa/src/fxfa/src/app/xfa_fwltheme.h @@ -81,7 +81,7 @@ public: CXFA_FWLCheckBoxTP();
virtual FX_BOOL DrawBackground(CFWL_ThemeBackground *pParams);
protected:
- void DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, FX_INT32 iState, CFX_Matrix* pMatrix);
+ void DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, int32_t iState, CFX_Matrix* pMatrix);
};
class CXFA_FWLEditTP : public CFWL_EditTP
{
diff --git a/xfa/src/fxfa/src/app/xfa_rendercontext.cpp b/xfa/src/fxfa/src/app/xfa_rendercontext.cpp index 5447506b24..c89dc3e4a0 100644 --- a/xfa/src/fxfa/src/app/xfa_rendercontext.cpp +++ b/xfa/src/fxfa/src/app/xfa_rendercontext.cpp @@ -27,7 +27,7 @@ CXFA_RenderContext::~CXFA_RenderContext() {
StopRender();
}
-FX_INT32 CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options)
+int32_t CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options)
{
m_pPageView = pPageView;
m_pGS = pGS;
@@ -45,9 +45,9 @@ FX_INT32 CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* m_pWidget = m_pWidgetIterator->MoveToNext();
return XFA_RENDERSTATUS_Ready;
}
-FX_INT32 CXFA_RenderContext::DoRender(IFX_Pause* pPause)
+int32_t CXFA_RenderContext::DoRender(IFX_Pause* pPause)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while(m_pWidget) {
CXFA_FFWidget* pWidget = (CXFA_FFWidget*)m_pWidget;
CFX_RectF rtWidgetBox;
diff --git a/xfa/src/fxfa/src/app/xfa_rendercontext.h b/xfa/src/fxfa/src/app/xfa_rendercontext.h index cb514c5cdf..79931b2751 100644 --- a/xfa/src/fxfa/src/app/xfa_rendercontext.h +++ b/xfa/src/fxfa/src/app/xfa_rendercontext.h @@ -15,8 +15,8 @@ public: {
delete this;
}
- virtual FX_INT32 StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options);
- virtual FX_INT32 DoRender(IFX_Pause* pPause = NULL);
+ virtual int32_t StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options);
+ virtual int32_t DoRender(IFX_Pause* pPause = NULL);
virtual void StopRender();
protected:
IXFA_WidgetIterator* m_pWidgetIterator;
diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp index 510b627b21..3043b772b8 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp +++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp @@ -43,13 +43,13 @@ void CXFA_CSSTagProvider::SetAttribute(const CFX_WideString &wsAttr, const CFX_W *pValue = wsValue;
m_Attributes.SetAt(pName, pValue);
}
-void CXFA_TextParseContext::SetDecls(const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount)
+void CXFA_TextParseContext::SetDecls(const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount)
{
if (iDeclCount <= 0 || ppDeclArray == NULL) {
return;
}
m_dwMatchedDecls = iDeclCount;
- FX_INT32 iBytes = iDeclCount * sizeof(IFDE_CSSDeclaration*);
+ int32_t iBytes = iDeclCount * sizeof(IFDE_CSSDeclaration*);
m_ppMatchedDecls = (IFDE_CSSDeclaration**)FDE_Alloc(iBytes);
FX_memcpy(m_ppMatchedDecls, ppDeclArray, iBytes);
}
@@ -257,7 +257,7 @@ void CXFA_TextParser::ParseRichText(IFDE_XMLNode *pXMLNode, IFDE_CSSComputedStyl IFDE_CSSAccelerator *pCSSAccel = m_pSelector->InitAccelerator();
pCSSAccel->OnEnterTag(&tagProvider);
CFDE_CSSDeclarationArray DeclArray;
- FX_INT32 iMatchedDecls = m_pSelector->MatchDeclarations(&tagProvider, DeclArray);
+ int32_t iMatchedDecls = m_pSelector->MatchDeclarations(&tagProvider, DeclArray);
const IFDE_CSSDeclaration **ppMatchDecls = (const IFDE_CSSDeclaration **)DeclArray.GetData();
m_pSelector->ComputeStyle(&tagProvider, ppMatchDecls, iMatchedDecls, pNewStyle);
pCSSAccel->OnLeaveTag(&tagProvider);
@@ -299,7 +299,7 @@ void CXFA_TextParser::ParseTagInfo(IFDE_XMLNode *pXMLNode, CXFA_CSSTagProvider & pXMLElement->GetLocalTagName(wsName);
tagProvider.SetTagNameObj(wsName);
FX_DWORD dwHashCode = FX_HashCode_String_GetW(wsName, wsName.GetLength(), TRUE);
- static const FX_INT32 s_iCount = sizeof(s_XFATagName) / sizeof(FX_DWORD);
+ static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(FX_DWORD);
CFX_DSPATemplate<FX_DWORD> lookup;
tagProvider.m_bTagAviliable = lookup.Lookup(dwHashCode, s_XFATagName, s_iCount) > -1;
CFX_WideString wsValue;
@@ -312,9 +312,9 @@ void CXFA_TextParser::ParseTagInfo(IFDE_XMLNode *pXMLNode, CXFA_CSSTagProvider & tagProvider.m_bContent = TRUE;
}
}
-FX_INT32 CXFA_TextParser::GetVAlgin(IXFA_TextProvider *pTextProvider) const
+int32_t CXFA_TextParser::GetVAlgin(IXFA_TextProvider *pTextProvider) const
{
- FX_INT32 iAlign = XFA_ATTRIBUTEENUM_Top;
+ int32_t iAlign = XFA_ATTRIBUTEENUM_Top;
CXFA_Para para = pTextProvider->GetParaNode();
if (para.IsExistInXML()) {
iAlign = para.GetVerticalAlign();
@@ -330,7 +330,7 @@ FX_FLOAT CXFA_TextParser::GetTabInterval(IFDE_CSSComputedStyle *pStyle) const }
return 36;
}
-FX_INT32 CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle *pStyle) const
+int32_t CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle *pStyle) const
{
CFX_WideString wsValue;
if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-count"), wsValue)) {
@@ -363,7 +363,7 @@ IFX_Font* CXFA_TextParser::GetFont(IXFA_TextProvider *pTextProvider, IFDE_CSSCom }
if (pStyle) {
IFDE_CSSFontStyle *pFontStyle = pStyle->GetFontStyles();
- FX_INT32 iCount = pFontStyle->CountFontFamilies();
+ int32_t iCount = pFontStyle->CountFontFamilies();
if (iCount > 0) {
wsFamily = pFontStyle->GetFontFamily(iCount - 1);
}
@@ -391,7 +391,7 @@ FX_FLOAT CXFA_TextParser::GetFontSize(IXFA_TextProvider *pTextProvider, IFDE_CSS }
return 10;
}
-FX_INT32 CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const
+int32_t CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const
{
if (pStyle != NULL) {
CFX_WideString wsValue;
@@ -407,11 +407,11 @@ FX_INT32 CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSS }
}
if (CXFA_Font font = pTextProvider->GetFontNode()) {
- return (FX_INT32)font.GetHorizontalScale();
+ return (int32_t)font.GetHorizontalScale();
}
return 100;
}
-FX_INT32 CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const
+int32_t CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const
{
if (pStyle != NULL) {
CFX_WideString wsValue;
@@ -420,11 +420,11 @@ FX_INT32 CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSS }
}
if (CXFA_Font font = pTextProvider->GetFontNode()) {
- return (FX_INT32)font.GetVerticalScale();
+ return (int32_t)font.GetVerticalScale();
}
return 100;
}
-void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iUnderline, FX_INT32 &iPeriod) const
+void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iUnderline, int32_t &iPeriod) const
{
iUnderline = 0;
iPeriod = XFA_ATTRIBUTEENUM_All;
@@ -451,7 +451,7 @@ void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSCom }
}
}
-void CXFA_TextParser::GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iLinethrough) const
+void CXFA_TextParser::GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iLinethrough) const
{
if (pStyle) {
FX_DWORD dwDecoration = pStyle->GetParagraphStyles()->GetTextDecoration();
@@ -572,10 +572,10 @@ FX_BOOL CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_TextTab && !pStyle->GetCustomStyle(FX_WSTRC(L"tab-stops"), wsValue)) {
return FALSE;
}
- FX_INT32 iLength = wsValue.GetLength();
+ int32_t iLength = wsValue.GetLength();
FX_LPCWSTR pTabStops = wsValue;
- FX_INT32 iCur = 0;
- FX_INT32 iLast = 0;
+ int32_t iCur = 0;
+ int32_t iLast = 0;
CFX_WideString wsAlign;
XFA_TABSTOPSSTATUS eStatus = XFA_TABSTOPSSTATUS_None;
FX_WCHAR ch;
@@ -607,7 +607,7 @@ FX_BOOL CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_TextTab if (ch != 'l') {
eStatus = XFA_TABSTOPSSTATUS_Location;
} else {
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iCur < iLength) {
ch = pTabStops[iCur];
iCur++;
@@ -679,8 +679,8 @@ CXFA_TextLayout::~CXFA_TextLayout() }
void CXFA_TextLayout::Unload()
{
- FX_INT32 iCount = m_pieceLines.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_pieceLines.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_PieceLine *pLine = m_pieceLines.GetAt(i);
FDE_DeleteWith(CXFA_PieceLine, m_pAllocator, pLine);
}
@@ -752,7 +752,7 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) FX_FLOAT fStart = 0;
FX_FLOAT fStartPos = 0;
if (para.IsExistInXML()) {
- FX_INT32 iAlign = FX_RTFLINEALIGNMENT_Left;
+ int32_t iAlign = FX_RTFLINEALIGNMENT_Left;
switch (para.GetHorizontalAlign()) {
case XFA_ATTRIBUTEENUM_Center:
iAlign = FX_RTFLINEALIGNMENT_Center;
@@ -788,8 +788,8 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) m_pBreak->SetLineWidth(fStart, fLineWidth);
m_pBreak->SetLinePos(fStartPos);
if (font.IsExistInXML()) {
- m_pBreak->SetHorizontalScale((FX_INT32)font.GetHorizontalScale());
- m_pBreak->SetVerticalScale((FX_INT32)font.GetVerticalScale());
+ m_pBreak->SetHorizontalScale((int32_t)font.GetHorizontalScale());
+ m_pBreak->SetVerticalScale((int32_t)font.GetVerticalScale());
m_pBreak->SetCharSpace(font.GetLetterSpacing());
}
FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, NULL);
@@ -805,7 +805,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD }
IFDE_CSSParagraphStyle *pParaStyle = pStyle->GetParagraphStyles();
if (eDisplay == FDE_CSSDISPLAY_Block || eDisplay == FDE_CSSDISPLAY_ListItem) {
- FX_INT32 iAlign = FX_RTFLINEALIGNMENT_Left;
+ int32_t iAlign = FX_RTFLINEALIGNMENT_Left;
switch (pParaStyle->GetTextAlign()) {
case FDE_CSSTEXTALIGN_Right:
iAlign = FX_RTFLINEALIGNMENT_Right;
@@ -863,7 +863,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD m_pTabstopContext = FX_NEW CXFA_TextTabstopsContext;
}
m_textParser.GetTabstops(pStyle, m_pTabstopContext);
- for (FX_INT32 i = 0; i < m_pTabstopContext->m_iTabCount; i++) {
+ for (int32_t i = 0; i < m_pTabstopContext->m_iTabCount; i++) {
XFA_TABSTOPS *pTab = m_pTabstopContext->m_tabstops.GetDataPtr(i);
m_pBreak->AddPositionedTab(pTab->fTabstops);
}
@@ -876,7 +876,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD m_pBreak->SetVerticalScale(m_textParser.GetVerScale(m_pTextProvider, pStyle));
m_pBreak->SetCharSpace(pParaStyle->GetLetterSpacing().GetValue());
}
-FX_INT32 CXFA_TextLayout::GetText(CFX_WideString &wsText)
+int32_t CXFA_TextLayout::GetText(CFX_WideString &wsText)
{
GetTextDataNode();
wsText.Empty();
@@ -891,7 +891,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() if (m_pLoader == NULL) {
return 0;
}
- FX_INT32 iCount = m_pLoader->m_lineHeights.GetSize();
+ int32_t iCount = m_pLoader->m_lineHeights.GetSize();
if (iCount == 0 && m_pLoader->m_fWidth > 0) {
CFX_SizeF szMax, szDef;
szMax.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
@@ -905,7 +905,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() FX_FLOAT fHeight = m_pLoader->m_fHeight;
if (fHeight < 0.1f) {
fHeight = 0;
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
fHeight += m_pLoader->m_lineHeights.ElementAt(i);
}
}
@@ -935,12 +935,12 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth ) }
return fWidth;
}
-FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight , FX_FLOAT fTextHeight )
+FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight , FX_FLOAT fTextHeight )
{
if (m_pLoader == NULL) {
return FALSE;
}
- FX_INT32 iBlockCount = m_Blocks.GetSize();
+ int32_t iBlockCount = m_Blocks.GetSize();
FX_FLOAT fHeight = fTextHeight;
if (fHeight < 0) {
fHeight = GetLayoutHeight();
@@ -953,7 +953,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F if (iBlockCount == 0 && fHeight > 0) {
fHeight = fTextHeight - GetLayoutHeight();
if (fHeight > 0) {
- FX_INT32 iAlign = m_textParser.GetVAlgin(m_pTextProvider);
+ int32_t iAlign = m_textParser.GetVAlgin(m_pTextProvider);
if (iAlign == XFA_ATTRIBUTEENUM_Middle) {
fHeight /= 2.0f;
} else if (iAlign != XFA_ATTRIBUTEENUM_Bottom) {
@@ -963,7 +963,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F }
}
FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset;
- FX_INT32 iLineIndex = 0;
+ int32_t iLineIndex = 0;
if (iBlockCount > 1) {
if (iBlockCount >= (iBlockIndex + 1) * 2) {
iLineIndex = m_Blocks.ElementAt(iBlockIndex * 2);
@@ -971,13 +971,13 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F iLineIndex = m_Blocks.ElementAt(iBlockCount - 1) + m_Blocks.ElementAt(iBlockCount - 2);
}
if (m_pLoader->m_BlocksHeight.GetSize() > 0) {
- for (FX_INT32 i = 0; i < iBlockIndex; i++) {
+ for (int32_t i = 0; i < iBlockIndex; i++) {
fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1);
}
}
}
- FX_INT32 iCount = m_pLoader->m_lineHeights.GetSize();
- FX_INT32 i = 0;
+ int32_t iCount = m_pLoader->m_lineHeights.GetSize();
+ int32_t i = 0;
for (i = iLineIndex; i < iCount; i++) {
FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
if ((i == iLineIndex) && (fLineHeight - fContentAreaHeight > 0.001)) {
@@ -1010,9 +1010,9 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F }
return FALSE;
}
-FX_INT32 CXFA_TextLayout::CountBlocks() const
+int32_t CXFA_TextLayout::CountBlocks() const
{
- FX_INT32 iCount = m_Blocks.GetSize() / 2;
+ int32_t iCount = m_Blocks.GetSize() / 2;
return iCount > 0 ? iCount : 1;
}
FX_BOOL CXFA_TextLayout::CalcSize(const CFX_SizeF &minSize, const CFX_SizeF &maxSize, CFX_SizeF &defaultSize)
@@ -1063,7 +1063,7 @@ FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF &size, FX_FLOAT* fHeight) }
return TRUE;
}
-FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock)
+FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock)
{
if (m_pLoader == NULL || iBlock < 0 || iBlock >= CountBlocks()) {
return FALSE;
@@ -1077,8 +1077,8 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) CXFA_Node *pNode = NULL;
CFX_SizeF szText;
szText.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
- FX_INT32 iCount = m_Blocks.GetSize();
- FX_INT32 iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize();
+ int32_t iCount = m_Blocks.GetSize();
+ int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize();
iBlocksHeightCount /= 2;
if (iBlock < iBlocksHeightCount) {
return TRUE;
@@ -1087,7 +1087,7 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) Unload();
m_pBreak = CreateBreak(TRUE);
fLinePos = m_pLoader->m_fStartLineOffset;
- for (FX_INT32 i = 0; i < iBlocksHeightCount; i++) {
+ for (int32_t i = 0; i < iBlocksHeightCount; i++) {
fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1);
}
m_pLoader->m_iChar = 0;
@@ -1161,24 +1161,24 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) }
return TRUE;
}
-void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex)
+void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex)
{
if (!m_pLoader) {
return;
}
- FX_INT32 iCountHeight = m_pLoader->m_lineHeights.GetSize();
+ int32_t iCountHeight = m_pLoader->m_lineHeights.GetSize();
if (iCountHeight == 0) {
return;
}
FX_BOOL bEndItem = TRUE;
- FX_INT32 iBlockCount = m_Blocks.GetSize();
+ int32_t iBlockCount = m_Blocks.GetSize();
FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset;
- FX_INT32 iLineIndex = 0;
+ int32_t iLineIndex = 0;
if (iBlockIndex > 0) {
- FX_INT32 iBlockHeightCount = m_pLoader->m_BlocksHeight.GetSize();
+ int32_t iBlockHeightCount = m_pLoader->m_BlocksHeight.GetSize();
iBlockHeightCount /= 2;
if (iBlockHeightCount >= iBlockIndex) {
- for (FX_INT32 i = 0; i < iBlockIndex; i++) {
+ for (int32_t i = 0; i < iBlockIndex; i++) {
fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1);
}
} else {
@@ -1186,7 +1186,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex) }
iLineIndex = m_Blocks.ElementAt(iBlockCount - 1) + m_Blocks.ElementAt(iBlockCount - 2);
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = iLineIndex; i < iCountHeight; i++) {
FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
if (fLinePos + fLineHeight - rtText.height > 0.001) {
@@ -1202,7 +1202,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex) m_Blocks.Add(i - iLineIndex);
}
}
-FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, FX_INT32 iBlock )
+FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, int32_t iBlock )
{
IFDE_RenderDevice *pDevice = IFDE_RenderDevice::Create(pFxDevice);
if (pDevice == NULL) {
@@ -1214,16 +1214,16 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matri IFDE_Pen *pPen = IFDE_Pen::Create();
FXSYS_assert(pDevice != NULL && pSolidBrush != NULL && pPen != NULL);
if (m_pieceLines.GetSize() == 0) {
- FX_INT32 iBlockCount = CountBlocks();
- for (FX_INT32 i = 0; i < iBlockCount; i++) {
+ int32_t iBlockCount = CountBlocks();
+ for (int32_t i = 0; i < iBlockCount; i++) {
Layout(i);
}
}
FXTEXT_CHARPOS *pCharPos = NULL;
- FX_INT32 iCharCount = 0;
- FX_INT32 iLineStart = 0;
- FX_INT32 iPieceLines = m_pieceLines.GetSize();
- FX_INT32 iCount = m_Blocks.GetSize();
+ int32_t iCharCount = 0;
+ int32_t iLineStart = 0;
+ int32_t iPieceLines = m_pieceLines.GetSize();
+ int32_t iCount = m_Blocks.GetSize();
if (iCount > 0) {
iBlock *= 2;
if (iBlock < iCount) {
@@ -1233,16 +1233,16 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matri iPieceLines = 0;
}
}
- for (FX_INT32 i = 0; i < iPieceLines; i++) {
+ for (int32_t i = 0; i < iPieceLines; i++) {
if(i + iLineStart >= m_pieceLines.GetSize()) {
break;
}
CXFA_PieceLine *pPieceLine = m_pieceLines.GetAt(i + iLineStart);
- FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize();
- FX_INT32 j = 0;
+ int32_t iPieces = pPieceLine->m_textPieces.GetSize();
+ int32_t j = 0;
for (j = 0; j < iPieces; j++) {
XFA_LPCTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j);
- FX_INT32 iChars = pPiece->iChars;
+ int32_t iChars = pPiece->iChars;
if (iCharCount < iChars) {
if (pCharPos != NULL) {
FDE_Free(pCharPos);
@@ -1281,11 +1281,11 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) default:
return;
}
- FX_INT32 iCount = m_pieceLines.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_pieceLines.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_PieceLine *pPieceLine = m_pieceLines.GetAt(i);
- FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize();
- for (FX_INT32 j = 0; j < iPieces; j++) {
+ int32_t iPieces = pPieceLine->m_textPieces.GetSize();
+ for (int32_t j = 0; j < iPieces; j++) {
XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j);
CFX_RectF &rect = pPiece->rtPiece;
rect.top += fHeight;
@@ -1326,7 +1326,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLO if (fSpaceAbove < 0.1f) {
fSpaceAbove = 0;
}
- FX_INT32 verAlign = para.GetVerticalAlign();
+ int32_t verAlign = para.GetVerticalAlign();
switch (verAlign) {
case XFA_ATTRIBUTEENUM_Top:
case XFA_ATTRIBUTEENUM_Middle:
@@ -1345,7 +1345,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLO EndBreak(FX_RTFBREAK_ParagraphBreak, fLinePos, bSavePieces);
}
}
-FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData, FX_BOOL bEndBreak, FX_BOOL bIsOl, FX_INT32 iLiCount)
+FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData, FX_BOOL bEndBreak, FX_BOOL bIsOl, int32_t iLiCount)
{
if (pXMLNode == NULL) {
return FALSE;
@@ -1398,7 +1398,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & wsLinkContent.ReleaseBuffer(wsLinkContent.GetLength());
}
}
- FX_INT32 iTabCount = m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle);
+ int32_t iTabCount = m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle);
FX_BOOL bSpaceRun = m_textParser.IsSpaceRun(bContentNode ? pParentStyle : pStyle);
CFX_WideString wsText;
if (bContentNode && iTabCount == 0) {
@@ -1421,7 +1421,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & m_textParser.GetEmbbedObj(m_pTextProvider, pXMLNode, wsText);
}
}
- FX_INT32 iLength = wsText.GetLength();
+ int32_t iLength = wsText.GetLength();
if (iLength > 0 && bContentNode && !bSpaceRun) {
ProcessText(wsText);
}
@@ -1527,12 +1527,12 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString &wsText, FX_FLOAT &fLinePos, FX_FLOAT fSpaceAbove, FX_BOOL bSavePieces)
{
FX_DWORD dwStatus = 0;
- FX_INT32 iChar = 0;
+ int32_t iChar = 0;
if (m_pLoader) {
iChar = m_pLoader->m_iChar;
}
- FX_INT32 iLength = wsText.GetLength();
- for (FX_INT32 i = iChar; i < iLength; i++) {
+ int32_t iLength = wsText.GetLength();
+ for (int32_t i = iChar; i < iLength; i++) {
FX_WCHAR wch = wsText.GetAt(i);
if (wch == 0xA0) {
wch = 0x20;
@@ -1567,14 +1567,14 @@ FX_BOOL CXFA_TextLayout::IsEnd(FX_BOOL bSavePieces) }
void CXFA_TextLayout::ProcessText(CFX_WideString &wsText)
{
- FX_INT32 iLen = wsText.GetLength();
+ int32_t iLen = wsText.GetLength();
if (iLen == 0) {
return;
}
FX_LPWSTR psz = wsText.GetBuffer(iLen);
- FX_INT32 iTrimLeft = 0;
+ int32_t iTrimLeft = 0;
FX_WCHAR wch = 0, wPrev = 0;
- for (FX_INT32 i = 0; i < iLen; i++) {
+ for (int32_t i = 0; i < iLen; i++) {
wch = psz[i];
if (wch < 0x20) {
wch = 0x20;
@@ -1603,13 +1603,13 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * if (pStyle == NULL || pPieceLine == NULL) {
return;
}
- FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize();
+ int32_t iPieces = pPieceLine->m_textPieces.GetSize();
if (iPieces == 0) {
return;
}
XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(iPieces - 1);
- FX_INT32 &iTabstopsIndex = m_pTabstopContext->m_iTabIndex;
- FX_INT32 iCount = m_textParser.CountTabs(pStyle);
+ int32_t &iTabstopsIndex = m_pTabstopContext->m_iTabIndex;
+ int32_t iCount = m_textParser.CountTabs(pStyle);
if (iTabstopsIndex > m_pTabstopContext->m_iTabCount - 1) {
return;
}
@@ -1633,8 +1633,8 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * || dwAlgin == FX_HashCode_String_GetW(L"before", 6)) {
fLeft = pPiece->rtPiece.width;
} else if (dwAlgin == FX_HashCode_String_GetW(L"decimal", 7)) {
- FX_INT32 iChars = pPiece->iChars;
- for (FX_INT32 i = 0; i < iChars; i++) {
+ int32_t iChars = pPiece->iChars;
+ for (int32_t i = 0; i < iChars; i++) {
if (pPiece->pszText[i] == L'.') {
break;
}
@@ -1650,7 +1650,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * }
void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_BOOL bSavePieces, FX_BOOL bEndBreak)
{
- FX_INT32 iPieces = m_pBreak->CountBreakPieces();
+ int32_t iPieces = m_pBreak->CountBreakPieces();
if (iPieces < 1) {
return;
}
@@ -1662,7 +1662,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B m_pTabstopContext->Reset();
}
FX_FLOAT fLineStep = 0, fBaseLine = 0;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < iPieces; i++) {
const CFX_RTFPiece *pPiece = m_pBreak->GetBreakPiece(i);
CXFA_TextUserData *pUserData = (CXFA_TextUserData*)pPiece->m_pUserData;
@@ -1672,7 +1672,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f;
XFA_LPTEXTPIECE pTP = (XFA_LPTEXTPIECE)m_pAllocator->Alloc(sizeof(XFA_TEXTPIECE));
pTP->pszText = (FX_LPWSTR)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(FX_WCHAR));
- pTP->pWidths = (FX_INT32*)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(FX_INT32));
+ pTP->pWidths = (int32_t*)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(int32_t));
pTP->iChars = pPiece->m_iChars;
pPiece->GetString(pTP->pszText);
pPiece->GetWidths(pTP->pWidths);
@@ -1721,7 +1721,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B } else {
FX_FLOAT fLineStep = 0;
FX_FLOAT fLineWidth = 0;
- for (FX_INT32 i = 0; i < iPieces; i++) {
+ for (int32_t i = 0; i < iPieces; i++) {
const CFX_RTFPiece *pPiece = m_pBreak->GetBreakPiece(i);
CXFA_TextUserData *pUserData = (CXFA_TextUserData*)pPiece->m_pUserData;
if (pUserData != NULL) {
@@ -1781,17 +1781,17 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B }
m_iLines++;
}
-void CXFA_TextLayout::RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device)
+void CXFA_TextLayout::RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine, int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device)
{
XFA_LPCTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
- FX_INT32 iCount = GetDisplayPos(pPiece, pCharPos);
+ int32_t iCount = GetDisplayPos(pPiece, pCharPos);
if (iCount > 0) {
pBrush->SetColor(pPiece->dwColor);
pDevice->DrawString(pBrush, pPiece->pFont, pCharPos, iCount, pPiece->fFontSize, &tmDoc2Device);
}
pPieceLine->m_charCounts.Add(iCount);
}
-void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device)
+void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device)
{
XFA_TEXTPIECE *pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
FX_BOOL bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2;
@@ -1801,14 +1801,14 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF }
pPen->SetColor(pPiece->dwColor);
IFDE_Path *pPath = IFDE_Path::Create();
- FX_INT32 iChars = GetDisplayPos(pPiece, pCharPos);
+ int32_t iChars = GetDisplayPos(pPiece, pCharPos);
if (iChars > 0) {
CFX_PointF pt1, pt2;
FX_FLOAT fEndY = pCharPos[0].m_OriginY + 1.05f;
- FX_INT32 i = 0;
+ int32_t i = 0;
if (pPiece->iPeriod == XFA_ATTRIBUTEENUM_Word) {
- for (FX_INT32 i = 0; i < pPiece->iUnderline; i++) {
- for (FX_INT32 j = 0; j < iChars; j++) {
+ for (int32_t i = 0; i < pPiece->iUnderline; i++) {
+ for (int32_t j = 0; j < iChars; j++) {
pt1.x = pCharPos[j].m_OriginX;
pt2.x = pt1.x + pCharPos[j].m_FontCharWidth * pPiece->fFontSize / 1000.0f;
pt1.y = pt2.y = fEndY;
@@ -1819,7 +1819,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF } else {
pt1.x = pCharPos[0].m_OriginX;
pt2.x = pCharPos[iChars - 1].m_OriginX + pCharPos[iChars - 1].m_FontCharWidth * pPiece->fFontSize / 1000.0f;
- for (FX_INT32 i = 0; i < pPiece->iUnderline; i++) {
+ for (int32_t i = 0; i < pPiece->iUnderline; i++) {
pt1.y = pt2.y = fEndY;
pPath->AddLine(pt1, pt2);
fEndY += 2.0f;
@@ -1837,8 +1837,8 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF if (bNoLineThrough && (bNoUnderline || pPiece->iPeriod != XFA_ATTRIBUTEENUM_All)) {
goto XFA_RenderPathRet;
}
- FX_INT32 iCharsTmp = 0;
- FX_INT32 iPiecePrev = iPiece, iPieceNext = iPiece;
+ int32_t iCharsTmp = 0;
+ int32_t iPiecePrev = iPiece, iPieceNext = iPiece;
while (iPiecePrev > 0) {
iPiecePrev--;
iCharsTmp = pPieceLine->m_charCounts.GetAt(iPiecePrev);
@@ -1850,7 +1850,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF goto XFA_RenderPathRet;
}
iCharsTmp = 0;
- FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize();
+ int32_t iPieces = pPieceLine->m_textPieces.GetSize();
while (iPieceNext < iPieces - 1) {
iPieceNext++;
iCharsTmp = pPieceLine->m_charCounts.GetAt(iPieceNext);
@@ -1877,7 +1877,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF CFX_PointF pt1, pt2;
pt1.x = fOrgX, pt2.x = fEndX;
FX_FLOAT fEndY = pCharPos[0].m_OriginY + 1.05f;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < pPiece->iUnderline; i++) {
pt1.y = pt2.y = fEndY;
pPath->AddLine(pt1, pt2);
@@ -1894,7 +1894,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF XFA_RenderPathRet:
pPath->Release();
}
-FX_INT32 CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode )
+int32_t CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode )
{
if (pPiece == NULL) {
return 0;
@@ -1907,7 +1907,7 @@ FX_INT32 CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS }
FX_BOOL CXFA_TextLayout::ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ &tr)
{
- FX_INT32 iLength = pPiece->iChars;
+ int32_t iLength = pPiece->iChars;
if (iLength < 1) {
return FALSE;
}
diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.h b/xfa/src/fxfa/src/app/xfa_textlayout.h index a47189cb3f..96d94956d6 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.h +++ b/xfa/src/fxfa/src/app/xfa_textlayout.h @@ -64,7 +64,7 @@ public: {
return m_eDisplay;
}
- void SetDecls(const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount);
+ void SetDecls(const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount);
const IFDE_CSSDeclaration** GetDecls()
{
return (const IFDE_CSSDeclaration**)m_ppMatchedDecls;
@@ -93,17 +93,17 @@ public: return m_pAllocator != NULL;
}
- FX_INT32 GetVAlgin(IXFA_TextProvider *pTextProvider) const;
+ int32_t GetVAlgin(IXFA_TextProvider *pTextProvider) const;
FX_FLOAT GetTabInterval(IFDE_CSSComputedStyle *pStyle) const;
- FX_INT32 CountTabs(IFDE_CSSComputedStyle *pStyle) const;
+ int32_t CountTabs(IFDE_CSSComputedStyle *pStyle) const;
FX_BOOL IsSpaceRun(IFDE_CSSComputedStyle *pStyle) const;
FX_BOOL GetTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_TextTabstopsContext *pTabstopContext);
IFX_Font* GetFont(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
FX_FLOAT GetFontSize(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
- FX_INT32 GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const;
- FX_INT32 GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
- void GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iUnderline, FX_INT32 &iPeriod) const;
- void GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iLinethrough) const;
+ int32_t GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const;
+ int32_t GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
+ void GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iUnderline, int32_t &iPeriod) const;
+ void GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iLinethrough) const;
FX_ARGB GetColor(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
FX_FLOAT GetBaseline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const;
FX_FLOAT GetLineHeight(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_BOOL bFirst, FX_FLOAT fVerScale) const;
@@ -140,9 +140,9 @@ public: FX_FLOAT m_fHeight;
FX_FLOAT m_fLastPos;
FX_FLOAT m_fStartLineOffset;
- FX_INT32 m_iChar;
- FX_INT32 m_iLines;
- FX_INT32 m_iTotalLines;
+ int32_t m_iChar;
+ int32_t m_iLines;
+ int32_t m_iTotalLines;
IFDE_XMLNode *m_pXMLNode;
CXFA_Node *m_pNode;
IFDE_CSSComputedStyle *m_pParentStyle;
@@ -237,14 +237,14 @@ protected: };
typedef struct _XFA_TEXTPIECE : public CFX_Target {
FX_LPWSTR pszText;
- FX_INT32 iChars;
- FX_INT32 *pWidths;
- FX_INT32 iHorScale;
- FX_INT32 iVerScale;
- FX_INT32 iBidiLevel;
- FX_INT32 iUnderline;
- FX_INT32 iPeriod;
- FX_INT32 iLineThrough;
+ int32_t iChars;
+ int32_t *pWidths;
+ int32_t iHorScale;
+ int32_t iVerScale;
+ int32_t iBidiLevel;
+ int32_t iUnderline;
+ int32_t iPeriod;
+ int32_t iLineThrough;
IFX_Font *pFont;
FX_ARGB dwColor;
FX_FLOAT fFontSize;
@@ -284,7 +284,7 @@ public: CXFA_TextTabstopsContext() : m_iTabCount(0), m_iTabIndex(-1), m_bTabstops(FALSE), m_fTabWidth(0), m_fLeft(0) {}
void Append(FX_DWORD dwAlign, FX_FLOAT fTabstops)
{
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < m_iTabCount; i++) {
XFA_TABSTOPS *pTabstop = m_tabstops.GetDataPtr(i);
if (fTabstops < pTabstop->fTabstops) {
@@ -311,8 +311,8 @@ public: m_fLeft = 0;
}
CFX_ArrayTemplate<XFA_TABSTOPS> m_tabstops;
- FX_INT32 m_iTabCount;
- FX_INT32 m_iTabIndex;
+ int32_t m_iTabCount;
+ int32_t m_iTabIndex;
FX_BOOL m_bTabstops;
FX_FLOAT m_fTabWidth;
FX_FLOAT m_fLeft;
@@ -322,15 +322,15 @@ class CXFA_TextLayout public:
CXFA_TextLayout(IXFA_TextProvider *pTextProvider);
virtual ~CXFA_TextLayout();
- FX_INT32 GetText(CFX_WideString &wsText);
+ int32_t GetText(CFX_WideString &wsText);
FX_FLOAT GetLayoutHeight();
FX_FLOAT StartLayout(FX_FLOAT fWidth = -1);
- FX_BOOL DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight = -1, FX_FLOAT fTextHeight = -1);
+ FX_BOOL DoLayout(int32_t iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight = -1, FX_FLOAT fTextHeight = -1);
FX_BOOL CalcSize(const CFX_SizeF &minSize, const CFX_SizeF &maxSize, CFX_SizeF &defaultSize);
FX_BOOL Layout(const CFX_SizeF &size, FX_FLOAT* fHeight = NULL);
- void ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex);
- FX_BOOL DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, FX_INT32 iBlock = 0);
+ void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex);
+ FX_BOOL DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, int32_t iBlock = 0);
FX_BOOL IsLoaded() const
{
@@ -347,7 +347,7 @@ private: FX_BOOL Loader(const CFX_SizeF &szText, FX_FLOAT &fLinePos, FX_BOOL bSavePieces = TRUE);
void LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, FX_BOOL bSavePieces);
- FX_BOOL LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData = NULL, FX_BOOL bEndBreak = TRUE, FX_BOOL bIsOl = FALSE, FX_INT32 iLiCount = 0);
+ FX_BOOL LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData = NULL, FX_BOOL bEndBreak = TRUE, FX_BOOL bIsOl = FALSE, int32_t iLiCount = 0);
FX_BOOL AppendChar(const CFX_WideString &wsText, FX_FLOAT &fLinePos, FX_FLOAT fSpaceAbove, FX_BOOL bSavePieces);
@@ -359,16 +359,16 @@ private: void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom);
void RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine,
- FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device);
- void RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece,
+ int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device);
+ void RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, int32_t iPiece,
FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device);
- FX_INT32 GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE);
+ int32_t GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE);
FX_BOOL ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ &tr);
void DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine *pPieceLine);
- FX_BOOL Layout(FX_INT32 iBlock);
- FX_INT32 CountBlocks() const;
+ FX_BOOL Layout(int32_t iBlock);
+ int32_t CountBlocks() const;
IXFA_TextProvider *m_pTextProvider;
CXFA_Node *m_pTextDataNode;
FX_BOOL m_bRichText;
@@ -377,7 +377,7 @@ private: FX_DWORD m_dwTextData;
CXFA_LoaderContext *m_pLoader;
- FX_INT32 m_iLines;
+ int32_t m_iLines;
FX_FLOAT m_fMaxWidth;
CXFA_TextParser m_textParser;
diff --git a/xfa/src/fxfa/src/common/fxfa_localevalue.h b/xfa/src/fxfa/src/common/fxfa_localevalue.h index b6a3db5096..c9cec57336 100644 --- a/xfa/src/fxfa/src/common/fxfa_localevalue.h +++ b/xfa/src/fxfa/src/common/fxfa_localevalue.h @@ -37,8 +37,8 @@ public: FX_BOOL ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime& unDate);
FX_BOOL ValidateCanonicalTime(const CFX_WideString& wsTime);
FX_BOOL ValidateCanonicalDateTime(const CFX_WideString& wsDateTime);
- void GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nIntLen, FX_INT32 nDecLen, FX_BOOL bSign = TRUE);
- FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale = NULL, FX_INT32* pos = NULL);
+ void GetNumbericFormat(CFX_WideString &wsFormat, int32_t nIntLen, int32_t nDecLen, FX_BOOL bSign = TRUE);
+ FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale = NULL, int32_t* pos = NULL);
CFX_WideString GetValue() const;
FX_DWORD GetType() const;
diff --git a/xfa/src/fxfa/src/common/xfa_doclayout.h b/xfa/src/fxfa/src/common/xfa_doclayout.h index d5aaaa9cf8..d360faa62c 100644 --- a/xfa/src/fxfa/src/common/xfa_doclayout.h +++ b/xfa/src/fxfa/src/common/xfa_doclayout.h @@ -15,8 +15,8 @@ public: IXFA_LayoutPage* GetPage() const;
CXFA_Node* GetFormNode() const;
void GetRect(CFX_RectF &rtLayout, FX_BOOL bRelative = FALSE) const;
- FX_INT32 GetIndex() const;
- FX_INT32 GetCount() const;
+ int32_t GetIndex() const;
+ int32_t GetCount() const;
CXFA_LayoutItem* GetParent() const;
CXFA_LayoutItem* GetFirst() const;
CXFA_LayoutItem* GetPrev() const;
@@ -88,7 +88,7 @@ class IXFA_LayoutPage {
public:
IXFA_DocLayout* GetLayout() const;
- FX_INT32 GetPageIndex() const;
+ int32_t GetPageIndex() const;
void GetPageSize(CFX_SizeF &size);
CXFA_Node* GetMasterPage() const;
};
@@ -96,11 +96,11 @@ class IXFA_DocLayout {
public:
virtual CXFA_Document* GetDocument() const = 0;
- virtual FX_INT32 StartLayout(FX_BOOL bForceRestart = FALSE) = 0;
- virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE) = 0;
+ virtual int32_t DoLayout(IFX_Pause *pPause = NULL) = 0;
virtual FX_BOOL IncrementLayout() = 0;
- virtual FX_INT32 CountPages() const = 0;
- virtual IXFA_LayoutPage* GetPage(FX_INT32 index) const = 0;
+ virtual int32_t CountPages() const = 0;
+ virtual IXFA_LayoutPage* GetPage(int32_t index) const = 0;
virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node *pFormItem) = 0;
};
diff --git a/xfa/src/fxfa/src/common/xfa_document.h b/xfa/src/fxfa/src/common/xfa_document.h index e082321f22..1a45bd4126 100644 --- a/xfa/src/fxfa/src/common/xfa_document.h +++ b/xfa/src/fxfa/src/common/xfa_document.h @@ -72,9 +72,9 @@ public: virtual CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node *pNode) = 0;
virtual void OnLayoutEvent(IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, XFA_LAYOUTEVENT eEvent, FX_LPVOID pParam = NULL, FX_LPVOID pParam2 = NULL) = 0;
virtual void StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, FX_FLOAT &fCalcHeight) = 0;
- virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos) = 0;
+ virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos) = 0;
virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) = 0;
- virtual FX_INT32 ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc* pExclude = NULL) = 0;
+ virtual int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc* pExclude = NULL) = 0;
virtual void AddCalcValidate(CXFA_Node* pNode) = 0;
virtual IXFA_Doc* GetHDOC() = 0;
virtual IXFA_DocProvider* GetDocProvider() = 0;
@@ -84,7 +84,7 @@ public: virtual void OpenDropDownList(IXFA_Widget* hWidget) = 0;
virtual CFX_WideString GetCurrentDateTime() = 0;
virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL) = 0;
- virtual FX_INT32 GetLayoutStatus() = 0;
+ virtual int32_t GetLayoutStatus() = 0;
virtual void RunNodeInitialize(CXFA_Node* pNode) = 0;
virtual void RunSubformIndexChange(CXFA_Node* pSubformNode) = 0;
virtual CXFA_Node* GetFocusWidgetNode() = 0;
diff --git a/xfa/src/fxfa/src/common/xfa_fm2jsapi.h b/xfa/src/fxfa/src/common/xfa_fm2jsapi.h index cdb4fe94f6..10b96dd44e 100644 --- a/xfa/src/fxfa/src/common/xfa_fm2jsapi.h +++ b/xfa/src/fxfa/src/common/xfa_fm2jsapi.h @@ -14,7 +14,7 @@ extern "C" typedef struct XFA_HFM2JSCONTEXT_ {
FX_LPVOID* pData;
}* XFA_HFM2JSCONTEXT;
-FX_INT32 XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError);
+int32_t XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError);
XFA_HFM2JSCONTEXT XFA_FM2JS_ContextCreate();
void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext, FXJSE_HRUNTIME hScriptRuntime,
FXJSE_HCONTEXT hScriptContext,
diff --git a/xfa/src/fxfa/src/common/xfa_object.h b/xfa/src/fxfa/src/common/xfa_object.h index d2b0f1df96..7c4acd4105 100644 --- a/xfa/src/fxfa/src/common/xfa_object.h +++ b/xfa/src/fxfa/src/common/xfa_object.h @@ -80,9 +80,9 @@ public: }
XFA_ELEMENT GetClassID() const;
void GetClassName(CFX_WideStringC &wsName) const;
- FX_UINT32 GetClassHashCode() const;
+ uint32_t GetClassHashCode() const;
void Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
- void ThrowScriptErrorMessage(FX_INT32 iStringID, ...);
+ void ThrowScriptErrorMessage(int32_t iStringID, ...);
protected:
CXFA_Document *m_pDocument;
FX_DWORD m_uFlags;
@@ -115,15 +115,15 @@ typedef struct _XFA_MAPDATABLOCK { return (FX_LPBYTE)this + sizeof(_XFA_MAPDATABLOCK);
}
XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo;
- FX_INT32 iBytes;
+ int32_t iBytes;
} XFA_MAPDATABLOCK, * XFA_LPMAPDATABLOCK;
typedef struct _XFA_MAPMODULEDATA {
CFX_MapPtrToPtr m_ValueMap;
CFX_MapPtrTemplate<FX_LPVOID, XFA_LPMAPDATABLOCK> m_BufferMap;
} XFA_MAPMODULEDATA, * XFA_LPMAPMODULEDATA;
-#define XFA_CalcRefCount (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('X', 'F', 'A', 'R')
-#define XFA_CalcData (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('X', 'F', 'A', 'C')
-#define XFA_LAYOUTITEMKEY (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('L', 'Y', 'I', 'M')
+#define XFA_CalcRefCount (FX_LPVOID)(uintptr_t)FXBSTR_ID('X', 'F', 'A', 'R')
+#define XFA_CalcData (FX_LPVOID)(uintptr_t)FXBSTR_ID('X', 'F', 'A', 'C')
+#define XFA_LAYOUTITEMKEY (FX_LPVOID)(uintptr_t)FXBSTR_ID('L', 'Y', 'I', 'M')
class CXFA_Node : public CXFA_Object
{
public:
@@ -176,7 +176,7 @@ public: FX_BOOL SetBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL bValue, FX_BOOL bNotify = FALSE)
{
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (FX_LPVOID)(FX_UINTPTR)bValue, bNotify);
+ return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (FX_LPVOID)(uintptr_t)bValue, bNotify);
}
FX_BOOL TryBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL &bValue, FX_BOOL bUseDefault = TRUE);
FX_BOOL GetBoolean(XFA_ATTRIBUTE eAttr)
@@ -184,19 +184,19 @@ public: FX_BOOL bValue;
return TryBoolean(eAttr, bValue, TRUE) ? bValue : FALSE;
}
- FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr, FX_INT32 iValue, FX_BOOL bNotify = FALSE)
+ FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, FX_BOOL bNotify = FALSE)
{
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)(FX_UINTPTR)iValue, bNotify);
+ return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)(uintptr_t)iValue, bNotify);
}
- FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr, FX_INT32 &iValue, FX_BOOL bUseDefault = TRUE);
- FX_INT32 GetInteger(XFA_ATTRIBUTE eAttr)
+ FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr, int32_t &iValue, FX_BOOL bUseDefault = TRUE);
+ int32_t GetInteger(XFA_ATTRIBUTE eAttr)
{
- FX_INT32 iValue;
+ int32_t iValue;
return TryInteger(eAttr, iValue, TRUE) ? iValue : 0;
}
FX_BOOL SetEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM eValue, FX_BOOL bNotify = FALSE)
{
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)(FX_UINTPTR)eValue, bNotify);
+ return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)(uintptr_t)eValue, bNotify);
}
FX_BOOL TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BOOL bUseDefault = TRUE);
XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr)
@@ -234,16 +234,16 @@ public: FX_LPVOID pData;
return TryUserData(pKey, pData, bProtoAlso) ? pData : NULL;
}
- CXFA_Node* GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty = TRUE);
- FX_INT32 CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE);
- CXFA_Node* GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE);
- FX_INT32 InsertChild(FX_INT32 index, CXFA_Node *pNode);
+ CXFA_Node* GetProperty(int32_t index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty = TRUE);
+ int32_t CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE);
+ CXFA_Node* GetChild(int32_t index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE);
+ int32_t InsertChild(int32_t index, CXFA_Node *pNode);
FX_BOOL InsertChild(CXFA_Node *pNode, CXFA_Node* pBeforeNode = NULL);
FX_BOOL RemoveChild(CXFA_Node *pNode, FX_BOOL bNotify = TRUE);
CXFA_Node* Clone(FX_BOOL bRecursive);
CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const;
CXFA_Node* GetNodeItem(XFA_NODEITEM eItem, XFA_OBJECTTYPE eType) const;
- FX_INT32 GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter = XFA_NODEFILTER_Children | XFA_NODEFILTER_Properties, XFA_ELEMENT eElementFilter = XFA_ELEMENT_UNKNOWN, FX_INT32 iLevel = 1);
+ int32_t GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter = XFA_NODEFILTER_Children | XFA_NODEFILTER_Properties, XFA_ELEMENT eElementFilter = XFA_ELEMENT_UNKNOWN, int32_t iLevel = 1);
CXFA_Node* CreateSamePacketNode(XFA_ELEMENT eElement, FX_DWORD dwFlags = XFA_NODEFLAG_Initialized);
CXFA_Node* CloneTemplateToForm(FX_BOOL bRecursive);
CXFA_Node* GetTemplateNode();
@@ -251,9 +251,9 @@ public: CXFA_Node* GetDataDescriptionNode();
void SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode);
CXFA_Node* GetBindData();
- FX_INT32 GetBindItems(CXFA_NodeArray& formItems);
- FX_INT32 AddBindItem(CXFA_Node* pFormNode);
- FX_INT32 RemoveBindItem(CXFA_Node* pFormNode);
+ int32_t GetBindItems(CXFA_NodeArray& formItems);
+ int32_t AddBindItem(CXFA_Node* pFormNode);
+ int32_t RemoveBindItem(CXFA_Node* pFormNode);
FX_BOOL HasBindItem();
CXFA_WidgetData* GetWidgetData();
CXFA_WidgetData* GetContainerWidgetData();
@@ -265,8 +265,8 @@ public: CXFA_Node* GetNextSameNameSibling(FX_DWORD dwNodeNameHash) const;
CXFA_Node* GetNextSameNameSibling(FX_WSTR wsNodeName) const;
CXFA_Node* GetNextSameClassSibling(XFA_ELEMENT eNodeClass) const;
- FX_INT32 GetNodeSameNameIndex() const;
- FX_INT32 GetNodeSameClassIndex() const;
+ int32_t GetNodeSameNameIndex() const;
+ int32_t GetNodeSameClassIndex() const;
void GetSOMExpression(CFX_WideString& wsSOMExpression);
CXFA_Node* GetInstanceMgrOfSubform();
@@ -367,7 +367,7 @@ public: void Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_Subform_GetInvalidObjects(CFXJSE_Arguments* pArguments);
- FX_INT32 Subform_and_SubformSet_InstanceIndex();
+ int32_t Subform_and_SubformSet_InstanceIndex();
void Script_Template_FormNodes(CFXJSE_Arguments* pArguments);
void Script_Template_Remerge(CFXJSE_Arguments* pArguments);
void Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments);
@@ -384,8 +384,8 @@ public: void Script_InstanceManager_SetInstances(CFXJSE_Arguments* pArguments);
void Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments);
void Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArguments);
- FX_INT32 InstanceManager_SetInstances(FX_INT32 iCount);
- FX_INT32 InstanceManager_MoveInstance(FX_INT32 iTo, FX_INT32 iFrom);
+ int32_t InstanceManager_SetInstances(int32_t iCount);
+ int32_t InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom);
void Script_Occur_Max(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
void Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
void Script_Desc_Metadata(CFXJSE_Arguments* pArguments);
@@ -434,7 +434,7 @@ protected: void OnRemoved(CXFA_Node *pParent, CXFA_Node *pRemoved, FX_BOOL bNotify);
void OnChanging(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify);
void OnChanged(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify, FX_BOOL bScriptModify = FALSE);
- FX_INT32 execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType);
+ int32_t execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType);
FX_BOOL SetScriptContent(const CFX_WideString& wsContent, const CFX_WideString& wsXMLValue, FX_BOOL bNotify = TRUE, FX_BOOL bScriptModify = FALSE, FX_BOOL bSyncData = TRUE);
CFX_WideString GetScriptContent(FX_BOOL bScriptModify = FALSE);
XFA_LPMAPMODULEDATA GetMapModuleData(FX_BOOL bCreateNew);
@@ -442,8 +442,8 @@ protected: FX_BOOL GetMapModuleValue(FX_LPVOID pKey, FX_LPVOID &pValue);
void SetMapModuleString(FX_LPVOID pKey, FX_WSTR wsValue);
FX_BOOL GetMapModuleString(FX_LPVOID pKey, CFX_WideStringC &wsValue);
- void SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL);
- FX_BOOL GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, FX_INT32 &iBytes, FX_BOOL bProtoAlso = TRUE);
+ void SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL);
+ FX_BOOL GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, int32_t &iBytes, FX_BOOL bProtoAlso = TRUE);
FX_BOOL HasMapModuleKey(FX_LPVOID pKey, FX_BOOL bProtoAlso = FALSE);
void RemoveMapModuleKey(FX_LPVOID pKey = NULL);
void MergeAllData(FX_LPVOID pDstModule, FX_BOOL bUseSrcAttr = TRUE);
@@ -472,13 +472,13 @@ public: {
return (XFA_ELEMENT)m_eNodeClass;
}
- FX_UINT32 GetScriptObjHash()
+ uint32_t GetScriptObjHash()
{
return m_uScriptHash;
}
protected:
XFA_ELEMENT m_eNodeClass;
- FX_UINT32 m_uScriptHash;
+ uint32_t m_uScriptHash;
};
class CXFA_ThisProxy : public CXFA_Object
{
@@ -511,11 +511,11 @@ public: return XFA_ELEMENT_NodeList;
}
CXFA_Node* NamedItem(FX_WSTR wsName);
- virtual FX_INT32 GetLength() = 0;
+ virtual int32_t GetLength() = 0;
virtual FX_BOOL Append(CXFA_Node* pNode) = 0;
virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0;
virtual FX_BOOL Remove(CXFA_Node* pNode) = 0;
- virtual CXFA_Node* Item(FX_INT32 iIndex) = 0;
+ virtual CXFA_Node* Item(int32_t iIndex) = 0;
void Script_ListClass_Append(CFXJSE_Arguments* pArguments);
void Script_ListClass_Insert(CFXJSE_Arguments* pArguments);
@@ -530,11 +530,11 @@ class CXFA_ArrayNodeList : public CXFA_NodeList public:
CXFA_ArrayNodeList(CXFA_Document* pDocument);
void SetArrayNodeList(const CXFA_NodeArray &srcArray);
- virtual FX_INT32 GetLength();
+ virtual int32_t GetLength();
virtual FX_BOOL Append(CXFA_Node* pNode);
virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode);
virtual FX_BOOL Remove(CXFA_Node* pNode);
- virtual CXFA_Node* Item(FX_INT32 iIndex);
+ virtual CXFA_Node* Item(int32_t iIndex);
protected:
CXFA_NodeArray m_array;
};
@@ -543,11 +543,11 @@ class CXFA_AttachNodeList : public CXFA_NodeList public:
CXFA_AttachNodeList(CXFA_Document* pDocument, CXFA_Node* pAttachNode);
- virtual FX_INT32 GetLength();
+ virtual int32_t GetLength();
virtual FX_BOOL Append(CXFA_Node* pNode);
virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode);
virtual FX_BOOL Remove(CXFA_Node* pNode);
- virtual CXFA_Node* Item(FX_INT32 iIndex);
+ virtual CXFA_Node* Item(int32_t iIndex);
protected:
CXFA_Node* m_pAttachNode;
};
diff --git a/xfa/src/fxfa/src/common/xfa_parser.h b/xfa/src/fxfa/src/common/xfa_parser.h index 2b1f1e62a8..b534acd03c 100644 --- a/xfa/src/fxfa/src/common/xfa_parser.h +++ b/xfa/src/fxfa/src/common/xfa_parser.h @@ -12,9 +12,9 @@ class IXFA_Parser public:
static IXFA_Parser* Create(IXFA_ObjFactory *pFactory, FX_BOOL bDocumentParser = FALSE);
virtual void Release() = 0;
- virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0;
- virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL) = 0;
- virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0;
+ virtual int32_t DoParse(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL) = 0;
virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode) = 0;
virtual IXFA_ObjFactory* GetFactory() const = 0;
virtual CXFA_Node* GetRootNode() const = 0;
diff --git a/xfa/src/fxfa/src/common/xfa_script.h b/xfa/src/fxfa/src/common/xfa_script.h index a61dc959b3..5be9077083 100644 --- a/xfa/src/fxfa/src/common/xfa_script.h +++ b/xfa/src/fxfa/src/common/xfa_script.h @@ -35,13 +35,13 @@ public: CXFA_HVALUEArray(FXJSE_HRUNTIME hRunTime) : m_hRunTime(hRunTime) {};
~CXFA_HVALUEArray()
{
- for (FX_INT32 i = 0; i < GetSize(); i++) {
+ for (int32_t i = 0; i < GetSize(); i++) {
FXJSE_Value_Release(GetAt(i));
}
}
void GetAttributeObject(CXFA_ObjArray& objArray)
{
- for (FX_INT32 i = 0; i < GetSize(); i++) {
+ for (int32_t i = 0; i < GetSize(); i++) {
CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i), NULL);
objArray.Add(pObject);
}
@@ -54,11 +54,11 @@ typedef struct _XFA_RESOLVENODE_RS { {
nodes.RemoveAll();
}
- FX_INT32 GetAttributeResult(CXFA_HVALUEArray& hValueArray) const
+ int32_t GetAttributeResult(CXFA_HVALUEArray& hValueArray) const
{
if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) {
FXJSE_HRUNTIME hRunTime = hValueArray.m_hRunTime;
- for (FX_INT32 i = 0; i < nodes.GetSize(); i++) {
+ for (int32_t i = 0; i < nodes.GetSize(); i++) {
FXJSE_HVALUE hValue = FXJSE_Value_Create(hRunTime);
(nodes[i]->*(pScriptAttribute->lpfnCallback))(hValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
hValueArray.Add(hValue);
@@ -71,11 +71,11 @@ typedef struct _XFA_RESOLVENODE_RS { XFA_RESOVENODE_RSTYPE dwFlags;
} XFA_RESOLVENODE_RS, * XFA_LPRESOLVENODE_RS;
typedef struct _XFA_JSBUILTININFO {
- FX_UINT32 uUnicodeHash;
+ uint32_t uUnicodeHash;
FX_LPCSTR pName;
} XFA_JSBUILTININFO, * XFA_LPJSBUILTININFO;
typedef XFA_JSBUILTININFO const * XFA_LPCJSBUILTININFO;
-XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode);
+XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(uint32_t uHashCode);
class IXFA_ScriptContext
{
public:
@@ -85,13 +85,13 @@ public: virtual void SetEventParam(CXFA_EventParam* pEventParam) = 0;
virtual CXFA_EventParam* GetEventParam() = 0;
virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, CXFA_Object* pThisObject = NULL) = 0;
- virtual FX_INT32 ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL) = 0;
+ virtual int32_t ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL) = 0;
virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject) = 0;
virtual void CacheList(CXFA_NodeList* pList) = 0;
virtual CXFA_Object* GetThisObject() const = 0;
virtual FXJSE_HRUNTIME GetRuntime() const = 0;
- virtual FX_INT32 GetIndexByName(CXFA_Node* refNode) = 0;
- virtual FX_INT32 GetIndexByClassName(CXFA_Node* refNode) = 0;
+ virtual int32_t GetIndexByName(CXFA_Node* refNode) = 0;
+ virtual int32_t GetIndexByClassName(CXFA_Node* refNode) = 0;
virtual void GetSomExpression(CXFA_Node* refNode, CFX_WideString &wsExpression) = 0;
virtual void SetNodesOfRunScript(CXFA_NodeArray *pArray) = 0;
diff --git a/xfa/src/fxfa/src/common/xfa_utils.h b/xfa/src/fxfa/src/common/xfa_utils.h index b666397e83..abb9dd208a 100644 --- a/xfa/src/fxfa/src/common/xfa_utils.h +++ b/xfa/src/fxfa/src/common/xfa_utils.h @@ -70,7 +70,7 @@ public: NodeType* MoveToPrev()
{
NodeType *pCurrent = GetCurrent();
- FX_INT32 nStackLength = m_NodeStack.GetSize();
+ int32_t nStackLength = m_NodeStack.GetSize();
if(nStackLength == 1) {
return NULL;
} else if(nStackLength > 1) {
@@ -210,7 +210,7 @@ public: void* pKey = NULL;
void* pValue = NULL;
CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
- rKey = (KeyType)(FX_UINTPTR)pKey;
+ rKey = (KeyType)(uintptr_t)pKey;
}
};
class CXFA_Node;
@@ -218,10 +218,10 @@ class CXFA_WidgetData; #include "fxfa_localevalue.h"
CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_ELEMENT& eWidgetType);
CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData);
-CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, FX_INT32 iLead, FX_INT32 iTread);
+CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, int32_t iLead, int32_t iTread);
FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal);
FX_DOUBLE XFA_ByteStringToDouble(FX_BSTR szStringVal);
-FX_INT32 XFA_MapRotation(FX_INT32 nRotation);
+int32_t XFA_MapRotation(int32_t nRotation);
#ifndef XFA_PARSE_HAS_LINEIDENTIFIER
#define XFA_PARSE_HAS_LINEIDENTIFIER
#endif
diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp index 7b230de528..47e5cb440f 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp @@ -35,8 +35,8 @@ CXFA_FMFunctionDefinition::~CXFA_FMFunctionDefinition() m_pArguments = 0;
}
if (m_pExpressions) {
- FX_INT32 expc = m_pExpressions->GetSize();
- FX_INT32 index = 0;
+ int32_t expc = m_pExpressions->GetSize();
+ int32_t index = 0;
CXFA_FMExpression *e = 0;
while (index < expc) {
e = (CXFA_FMExpression *)m_pExpressions->GetAt(index);
@@ -66,8 +66,8 @@ void CXFA_FMFunctionDefinition::ToJavaScript(CFX_WideTextBuf& javascript) }
javascript << FX_WSTRC(L"(");
if (m_pArguments != 0) {
- FX_INT32 argc = m_pArguments->GetSize();
- FX_INT32 index = 0;
+ int32_t argc = m_pArguments->GetSize();
+ int32_t index = 0;
CFX_WideStringC identifier = 0;
while (index < argc) {
identifier = m_pArguments->GetAt(index);
@@ -88,8 +88,8 @@ void CXFA_FMFunctionDefinition::ToJavaScript(CFX_WideTextBuf& javascript) javascript << RUNTIMEFUNCTIONRETURNVALUE;
javascript << FX_WSTRC(L" = null;\n");
if (m_pExpressions) {
- FX_INT32 expc = m_pExpressions->GetSize();
- FX_INT32 index = 0;
+ int32_t expc = m_pExpressions->GetSize();
+ int32_t index = 0;
CXFA_FMExpression *e = 0;
while (index < expc) {
e = (CXFA_FMExpression *)m_pExpressions->GetAt(index);
@@ -229,8 +229,8 @@ CXFA_FMBlockExpression::CXFA_FMBlockExpression(FX_DWORD line, CFX_PtrArray *pExp CXFA_FMBlockExpression::~CXFA_FMBlockExpression()
{
if (m_pExpressionList) {
- FX_INT32 expc = m_pExpressionList->GetSize();
- FX_INT32 index = 0;
+ int32_t expc = m_pExpressionList->GetSize();
+ int32_t index = 0;
CXFA_FMExpression *e = 0;
while (index < expc) {
e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index);
@@ -246,8 +246,8 @@ void CXFA_FMBlockExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << FX_WSTRC(L"{\n");
if (m_pExpressionList) {
- FX_INT32 expc = m_pExpressionList->GetSize();
- FX_INT32 index = 0;
+ int32_t expc = m_pExpressionList->GetSize();
+ int32_t index = 0;
CXFA_FMExpression *e = 0;
while (index < expc) {
e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index);
@@ -261,8 +261,8 @@ void CXFA_FMBlockExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) {
javascript << FX_WSTRC(L"{\n");
if (m_pExpressionList) {
- FX_INT32 expc = m_pExpressionList->GetSize();
- FX_INT32 index = 0;
+ int32_t expc = m_pExpressionList->GetSize();
+ int32_t index = 0;
CXFA_FMExpression *e = 0;
while (index < expc) {
e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index);
@@ -451,7 +451,7 @@ void CXFA_FMContinueExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = 0;\n");
javascript << FX_WSTRC(L"continue;\n");
}
-CXFA_FMForExpression::CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment, CXFA_FMSimpleExpression *pAccessor, FX_INT32 iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList)
+CXFA_FMForExpression::CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment, CXFA_FMSimpleExpression *pAccessor, int32_t iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList)
: CXFA_FMLoopExpression(line),
m_wsVariant(wsVariant),
m_pAssignment(pAssignment),
@@ -594,8 +594,8 @@ CXFA_FMForeachExpression::~CXFA_FMForeachExpression() m_pList = 0;
}
if (m_pAccessors) {
- FX_INT32 size = m_pAccessors->GetSize();
- FX_INT32 index = 0;
+ int32_t size = m_pAccessors->GetSize();
+ int32_t index = 0;
CXFA_FMSimpleExpression *e = 0;
while (index < size) {
e = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index);
@@ -623,8 +623,8 @@ void CXFA_FMForeachExpression::ToJavaScript(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = ");
javascript << XFA_FM_EXPTypeToString(CONCATFMOBJECT);
javascript << FX_WSTRC(L"(");
- FX_INT32 iSize = m_pAccessors->GetSize();
- FX_INT32 index = 0;
+ int32_t iSize = m_pAccessors->GetSize();
+ int32_t index = 0;
CXFA_FMSimpleExpression *s = 0;
while(index < iSize) {
s = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index);
@@ -677,8 +677,8 @@ void CXFA_FMForeachExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = ");
javascript << XFA_FM_EXPTypeToString(CONCATFMOBJECT);
javascript << FX_WSTRC(L"(");
- FX_INT32 iSize = m_pAccessors->GetSize();
- FX_INT32 index = 0;
+ int32_t iSize = m_pAccessors->GetSize();
+ int32_t index = 0;
CXFA_FMSimpleExpression *s = 0;
while(index < iSize) {
s = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.h b/xfa/src/fxfa/src/fm2js/xfa_expression.h index 6a51925527..a3781fa26d 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.h +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.h @@ -145,7 +145,7 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression {
public:
CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment,
- CXFA_FMSimpleExpression *pAccessor, FX_INT32 iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList);
+ CXFA_FMSimpleExpression *pAccessor, int32_t iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList);
virtual ~CXFA_FMForExpression();
virtual void ToJavaScript(CFX_WideTextBuf& javascript);
virtual void ToImpliedReturnJS(CFX_WideTextBuf&);
@@ -153,7 +153,7 @@ private: CFX_WideStringC m_wsVariant;
CXFA_FMSimpleExpression * m_pAssignment;
CXFA_FMSimpleExpression *m_pAccessor;
- FX_INT32 m_iDirection;
+ int32_t m_iDirection;
CXFA_FMSimpleExpression *m_pStep;
CXFA_FMExpression *m_pList;
};
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp index 8a1b1226f4..0ffec233dd 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp @@ -9,14 +9,14 @@ extern "C"
{
#endif
-FX_INT32 XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError)
+int32_t XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError)
{
if (wsFormcalc.IsEmpty()) {
wsJavascript.Clear();
wsError.Empty();
return 0;
}
- FX_INT32 status = 0;
+ int32_t status = 0;
CXFA_FMProgram program;
status = program.Init(wsFormcalc);
if(status) {
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp index be74852098..84a7747e7a 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp @@ -8,13 +8,13 @@ #include <time.h>
#define FINANCIAL_PRECISION 0.00000001
struct XFA_FMHtmlReserveCode {
- FX_UINT32 m_uCode;
+ uint32_t m_uCode;
FX_LPCWSTR m_htmlReserve;
};
struct XFA_FMHtmlHashedReserveCode {
- FX_UINT32 m_uHash;
+ uint32_t m_uHash;
FX_LPCWSTR m_htmlReserve;
- FX_UINT32 m_uCode;
+ uint32_t m_uCode;
};
static XFA_FMHtmlHashedReserveCode reservesForDecode [] = {
{0x00018b62, L"Mu", 924},
@@ -547,12 +547,12 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT32 uCount = 0;
+ int32_t argc = args.GetLength();
+ uint32_t uCount = 0;
FX_DOUBLE dSum = 0.0;
if(argc >= 1) {
FXJSE_HVALUE argValue = 0;
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if(FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
@@ -560,14 +560,14 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime);
if(FXJSE_Value_IsNull(propertyValue)) {
- for(FX_INT32 j = 2; j < iLength; j++) {
+ for(int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
FXJSE_HVALUE defaultPropValue = FXJSE_Value_Create(hruntime);
GetObjectDefaultValue(jsObjectValue, defaultPropValue);
@@ -581,7 +581,7 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime);
- for(FX_INT32 j = 2; j < iLength; j++) {
+ for(int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -628,10 +628,10 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT32 uCount = 0;
+ int32_t argc = args.GetLength();
+ uint32_t uCount = 0;
FXJSE_HVALUE argValue = 0;
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if(FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
@@ -639,7 +639,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else if(FXJSE_Value_IsArray(argValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -648,7 +648,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if(FXJSE_Value_IsNull(propertyValue)) {
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -658,7 +658,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue);
uCount += (FXJSE_Value_IsNull(newPropertyValue) ? 0 : 1);
@@ -683,7 +683,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar FXJSE_Value_Release(argValue);
}
argValue = 0;
- FXJSE_Value_SetInteger(args.GetReturnValue(), (FX_INT32)uCount);
+ FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)uCount);
}
void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
@@ -705,11 +705,11 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT32 uCount = 0;
+ int32_t argc = args.GetLength();
+ uint32_t uCount = 0;
FX_DOUBLE dMaxValue = 0.0;
FXJSE_HVALUE argValue = 0;
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if(FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
@@ -717,7 +717,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -726,7 +726,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if(FXJSE_Value_IsNull(propertyValue)) {
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, newPropertyValue);
if(!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -744,7 +744,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue);
if(!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -805,11 +805,11 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT32 uCount = 0;
+ int32_t argc = args.GetLength();
+ uint32_t uCount = 0;
FX_DOUBLE dMinValue = 0.0;
FXJSE_HVALUE argValue = 0;
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if(FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
@@ -817,7 +817,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -826,7 +826,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if(FXJSE_Value_IsNull(propertyValue)) {
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, newPropertyValue);
if(!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -844,7 +844,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue);
if(!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -916,7 +916,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu if(FXJSE_Value_IsArray(argOne)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -944,7 +944,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu if(FXJSE_Value_IsArray(argTwo)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argTwo, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -970,7 +970,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu dDividor = HValueToDouble(hThis, argTwo);
}
if(dDividor) {
- FXJSE_Value_SetDouble(args.GetReturnValue(), dDividend - dDividor * (FX_INT32)(dDividend / dDividor));
+ FXJSE_Value_SetDouble(args.GetReturnValue(), dDividend - dDividor * (int32_t)(dDividend / dDividor));
} else {
pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO);
}
@@ -985,8 +985,8 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT8 uPrecision = 0;
+ int32_t argc = args.GetLength();
+ uint8_t uPrecision = 0;
if(argc == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
if(FXJSE_Value_IsNull(argOne)) {
@@ -1071,7 +1071,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else if(dPrecision > 12.0) {
uPrecision = 12;
} else {
- uPrecision = (FX_UINT8)dPrecision;
+ uPrecision = (uint8_t)dPrecision;
}
CFX_Decimal decimalValue((FX_FLOAT)dValue, uPrecision);
CFX_WideString wsValue = decimalValue;
@@ -1087,12 +1087,12 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
- FX_UINT32 uCount = 0;
+ int32_t argc = args.GetLength();
+ uint32_t uCount = 0;
FX_DOUBLE dSum = 0.0;
if(argc) {
FXJSE_HVALUE argValue = 0;
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if(FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
@@ -1100,7 +1100,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if(iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -1108,7 +1108,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime);
FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime);
if(FXJSE_Value_IsNull(propertyValue)) {
- for(FX_INT32 j = 2; j < iLength; j++) {
+ for(int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -1119,7 +1119,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- for(FX_INT32 j = 2; j < iLength; j++) {
+ for(int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
@@ -1170,7 +1170,7 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg bufferMon.Format("%02d", pTmStruct->tm_mon + 1);
bufferDay.Format("%02d", pTmStruct->tm_mday);
CFX_ByteString bufferCurrent = bufferYear + bufferMon + bufferDay;
- FX_INT32 dDays = DateString2Num(bufferCurrent);
+ int32_t dDays = DateString2Num(bufferCurrent);
FXJSE_Value_SetInteger(args.GetReturnValue(), dDays);
} else {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
@@ -1179,7 +1179,7 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg }
void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
CFX_ByteString dateString;
@@ -1234,10 +1234,10 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc < 3) {
FX_BOOL bFlags = FALSE;
- FX_INT32 iStyle = 0;
+ int32_t iStyle = 0;
CFX_ByteString szLocal;
FXJSE_HVALUE argStyle = 0;
FXJSE_HVALUE argLocal = 0;
@@ -1246,7 +1246,7 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (FX_INT32)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)HValueToFloat(hThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
@@ -1289,8 +1289,8 @@ void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX } else {
CFX_ByteString szArgString;
HValueToUTF8String(argOne, szArgString);
- FX_INT32 dDays = DateString2Num(szArgString);
- FXJSE_Value_SetInteger(args.GetReturnValue(), (FX_INT32)dDays);
+ int32_t dDays = DateString2Num(szArgString);
+ FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays);
}
FXJSE_Value_Release(argOne);
} else {
@@ -1320,15 +1320,15 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX CXFA_LocaleValue timeValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szArgString, szArgString.GetLength()), (CXFA_LocaleMgr*)pMgr);
if (timeValue.IsValid()) {
CFX_Unitime uniTime = timeValue.GetTime();
- FX_INT32 hour = uniTime.GetHour();
- FX_INT32 min = uniTime.GetMinute();
- FX_INT32 second = uniTime.GetSecond();
- FX_INT32 milSecond = uniTime.GetMillisecond();
+ int32_t hour = uniTime.GetHour();
+ int32_t min = uniTime.GetMinute();
+ int32_t second = uniTime.GetSecond();
+ int32_t milSecond = uniTime.GetMillisecond();
IFX_Locale* pDefLocale = pMgr->GetDefLocale();
FXSYS_assert(pDefLocale);
FX_TIMEZONE tzLocale;
pDefLocale->GetTimeZone(tzLocale);
- FX_INT32 mins = hour * 60 + min;
+ int32_t mins = hour * 60 + min;
mins -= (tzLocale.tzHour * 60);
while (mins > 1440) {
mins -= 1440;
@@ -1338,7 +1338,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX }
hour = mins / 60;
min = mins % 60;
- FX_INT32 iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1;
+ int32_t iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1;
FXJSE_Value_SetInteger(args.GetReturnValue(), iResult);
} else {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
@@ -1351,10 +1351,10 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX }
void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc < 3) {
FX_BOOL bFlags = FALSE;
- FX_INT32 iStyle = 0;
+ int32_t iStyle = 0;
CFX_ByteString szLocal;
FXJSE_HVALUE argStyle = 0;
FXJSE_HVALUE argLocal = 0;
@@ -1363,7 +1363,7 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (FX_INT32)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)HValueToFloat(hThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
@@ -1399,10 +1399,10 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF }
void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc < 3) {
FX_BOOL bFlags = FALSE;
- FX_INT32 iStyle = 0;
+ int32_t iStyle = 0;
CFX_ByteString szLocal;
FXJSE_HVALUE argStyle = 0;
FXJSE_HVALUE argLocal = 0;
@@ -1411,7 +1411,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (FX_INT32)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)HValueToFloat(hThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
@@ -1447,10 +1447,10 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF }
void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
- FX_INT32 dDate;
+ int32_t dDate;
CFX_ByteString formatString;
CFX_ByteString localString;
FXJSE_HVALUE dateValue = GetSimpleHValue(hThis, args, 0);
@@ -1459,7 +1459,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE if(HValueIsNull(hThis, dateValue)) {
bFlags = TRUE;
} else {
- dDate = (FX_INT32)HValueToFloat(hThis, dateValue);
+ dDate = (int32_t)HValueToFloat(hThis, dateValue);
bFlags = dDate < 1;
}
if(argc > 1) {
@@ -1479,10 +1479,10 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
}
if (!bFlags) {
- FX_INT32 iYear = 1900;
- FX_INT32 iMonth = 1;
- FX_INT32 iDay = 1;
- FX_INT32 i = 0;
+ int32_t iYear = 1900;
+ int32_t iMonth = 1;
+ int32_t iDay = 1;
+ int32_t i = 0;
while (dDate > 0) {
if (iMonth == 2) {
if ((!((iYear + i) % 4) && ((iYear + i) % 100)) || !((iYear + i) % 400)) {
@@ -1495,7 +1495,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 29;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
} else {
@@ -1508,7 +1508,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 28;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
}
@@ -1523,7 +1523,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 30;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
} else {
@@ -1536,7 +1536,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 31;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
}
@@ -1551,7 +1551,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 30;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
} else {
@@ -1564,7 +1564,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1;
dDate -= 31;
} else {
- iDay += static_cast<FX_INT32>(dDate) - 1;
+ iDay += static_cast<int32_t>(dDate) - 1;
dDate = 0;
}
}
@@ -1595,10 +1595,10 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
- FX_INT32 iTime;
+ int32_t iTime;
CFX_ByteString formatString;
CFX_ByteString localString;
FXJSE_HVALUE timeValue = GetSimpleHValue(hThis, args, 0);
@@ -1607,7 +1607,7 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJ if(FXJSE_Value_IsNull(timeValue)) {
bFlags = TRUE;
} else {
- iTime = (FX_INT32)HValueToFloat(hThis, timeValue);
+ iTime = (int32_t)HValueToFloat(hThis, timeValue);
if (FXSYS_abs(iTime) < 1.0) {
bFlags = TRUE;
}
@@ -1652,7 +1652,7 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJ }
void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
FX_FLOAT fTime;
@@ -1687,7 +1687,7 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
if (!bFlags) {
CFX_ByteString szLocalTimeString;
- Num2AllTime(hThis, (FX_INT32)fTime, formatString, localString, FALSE, szLocalTimeString);
+ Num2AllTime(hThis, (int32_t)fTime, formatString, localString, FALSE, szLocalTimeString);
if (szLocalTimeString.IsEmpty()) {
szLocalTimeString = FX_BSTRC("");
}
@@ -1713,9 +1713,9 @@ void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg time_t now;
time(&now);
struct tm *pGmt = gmtime(&now);
- FX_INT32 iGMHour = pGmt->tm_hour;
- FX_INT32 iGMMin = pGmt->tm_min;
- FX_INT32 iGMSec = pGmt->tm_sec;
+ int32_t iGMHour = pGmt->tm_hour;
+ int32_t iGMMin = pGmt->tm_min;
+ int32_t iGMSec = pGmt->tm_sec;
FXJSE_Value_SetInteger(args.GetReturnValue(), ((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000));
} else {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
@@ -1724,7 +1724,7 @@ void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg }
void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
CFX_ByteString timeString;
@@ -1779,11 +1779,11 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr);
if (timeValue.IsValid()) {
CFX_Unitime uniTime = timeValue.GetTime();
- FX_INT32 hour = uniTime.GetHour();
- FX_INT32 min = uniTime.GetMinute();
- FX_INT32 second = uniTime.GetSecond();
- FX_INT32 milSecond = uniTime.GetMillisecond();
- FX_INT32 mins = hour * 60 + min;
+ int32_t hour = uniTime.GetHour();
+ int32_t min = uniTime.GetMinute();
+ int32_t second = uniTime.GetSecond();
+ int32_t milSecond = uniTime.GetMillisecond();
+ int32_t mins = hour * 60 + min;
IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get();
if (pProvider != NULL) {
FX_TIMEZONE tz;
@@ -1798,7 +1798,7 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE hour = mins / 60;
min = mins % 60;
}
- FX_INT32 iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1;
+ int32_t iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1;
FXJSE_Value_SetInteger(args.GetReturnValue(), iResult);
} else {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
@@ -1820,10 +1820,10 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc < 3) {
FX_BOOL bFlags = FALSE;
- FX_INT32 iStyle = 0;
+ int32_t iStyle = 0;
CFX_ByteString szLocal;
FXJSE_HVALUE argStyle = 0;
FXJSE_HVALUE argLocal = 0;
@@ -1832,7 +1832,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (FX_INT32)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)HValueToFloat(hThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
@@ -1866,7 +1866,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"TimeFmt");
}
}
-FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iStyle, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay)
+FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, int32_t iLength, int32_t &iStyle, int32_t &iYear, int32_t &iMonth, int32_t &iDay)
{
iYear = 0;
iMonth = 1;
@@ -1877,7 +1877,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX }
FX_CHAR strYear[5];
strYear[4] = '\0';
- for (FX_INT32 i = 0; i < 4; ++i) {
+ for (int32_t i = 0; i < 4; ++i) {
if (*(pData + i) <= '9' && *(pData + i) >= '0') {
strYear[i] = *(pData + i);
} else {
@@ -1898,7 +1898,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX }
FX_CHAR strTemp[3];
strTemp[2] = '\0';
- FX_INT32 iPosOff = 0;
+ int32_t iPosOff = 0;
if (iStyle == 0) {
iPosOff = 4;
if (iLength == 4) {
@@ -1979,7 +1979,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX iRet = TRUE;
return iRet;
}
-FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMilliSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute)
+FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, int32_t iLength, int32_t &iHour, int32_t &iMinute, int32_t &iSecond, int32_t &iMilliSecond, int32_t &iZoneHour, int32_t &iZoneMinute)
{
iHour = 0;
iMinute = 0;
@@ -1990,12 +1990,12 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX if (!pData) {
return FALSE;
}
- FX_INT32 iRet = FALSE;
+ int32_t iRet = FALSE;
FX_CHAR strTemp[3];
strTemp[2] = '\0';
- FX_INT32 iIndex = 0;
- FX_INT32 iZone = 0;
- FX_INT32 i = iIndex;
+ int32_t iIndex = 0;
+ int32_t iZone = 0;
+ int32_t i = iIndex;
while (i < iLength) {
if ((*(pData + i) > '9' || *(pData + i) < '0') && *(pData + i) != ':' ) {
iZone = i;
@@ -2006,7 +2006,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX if (i == iLength) {
iZone = iLength;
}
- FX_INT32 iPos = 0;
+ int32_t iPos = 0;
while (iIndex < iZone) {
if (iIndex >= iZone) {
break;
@@ -2070,7 +2070,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX }
iIndex += 3;
}
- FX_INT32 iSign = 1;
+ int32_t iSign = 1;
if (*(pData + iIndex) == 'z' || *(pData + iIndex) == 'Z') {
iRet = 1;
return iRet;
@@ -2121,7 +2121,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX iRet = TRUE;
return iRet;
}
-FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMillionSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute)
+FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, int32_t iLength, int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t &iHour, int32_t &iMinute, int32_t &iSecond, int32_t &iMillionSecond, int32_t &iZoneHour, int32_t &iZoneMinute)
{
iYear = 0;
iMonth = 0;
@@ -2132,8 +2132,8 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength if (!pData) {
return FALSE;
}
- FX_INT32 iRet = FALSE;
- FX_INT32 iIndex = 0;
+ int32_t iRet = FALSE;
+ int32_t iIndex = 0;
while (*(pData + iIndex) != 'T' && *(pData + iIndex) != 't') {
if (iIndex >= iLength) {
return iRet;
@@ -2143,7 +2143,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength if (iIndex != 8 && iIndex != 10) {
return iRet;
}
- FX_INT32 iStyle = -1;
+ int32_t iStyle = -1;
iRet = IsIsoDateFormat(pData, iIndex , iStyle, iYear, iMonth, iDay);
if (!iRet) {
return iRet;
@@ -2328,21 +2328,21 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BS strGMTTime = FX_UTF8Encode(wsRet, wsRet.GetLength());
return TRUE;
}
-FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString)
+int32_t CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString)
{
FX_BOOL bFlags = FALSE;
- FX_INT32 iLength = szDateString.GetLength();
+ int32_t iLength = szDateString.GetLength();
FX_BOOL iRet = FALSE;
- FX_INT32 iStyle = -1;
- FX_INT32 iYear = 0;
- FX_INT32 iMonth = 0;
- FX_INT32 iDay = 0;
- FX_INT32 iHour = 0;
- FX_INT32 iMinute = 0;
- FX_INT32 iSecond = 0;
- FX_INT32 iMillionSecond = 0;
- FX_INT32 iZoneHour = 0;
- FX_INT32 iZoneMinute = 0;
+ int32_t iStyle = -1;
+ int32_t iYear = 0;
+ int32_t iMonth = 0;
+ int32_t iDay = 0;
+ int32_t iHour = 0;
+ int32_t iMinute = 0;
+ int32_t iSecond = 0;
+ int32_t iMillionSecond = 0;
+ int32_t iZoneHour = 0;
+ int32_t iZoneMinute = 0;
if (iLength <= 10) {
iRet = IsIsoDateFormat(szDateString.GetCStr(), iLength, iStyle, iYear, iMonth, iDay);
} else {
@@ -2352,7 +2352,7 @@ FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) bFlags = TRUE;
}
FX_FLOAT dDays = 0;
- FX_INT32 i = 1;
+ int32_t i = 1;
if (iYear < 1900) {
bFlags = TRUE;
}
@@ -2396,10 +2396,10 @@ FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) } else {
dDays = 0;
}
- return (FX_INT32)dDays;
+ return (int32_t)dDays;
}
#define XFA_N 19
-static FX_BYTE g_sAltTable_Date[] = {
+static uint8_t g_sAltTable_Date[] = {
XFA_N, XFA_N, XFA_N, 3, 9, XFA_N, XFA_N, XFA_N,
XFA_N, XFA_N, XFA_N, XFA_N, 2, XFA_N, XFA_N, XFA_N,
XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
@@ -2409,7 +2409,7 @@ static FX_BYTE g_sAltTable_Date[] = { XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
};
-static FX_BYTE g_sAltTable_Time[] = {
+static uint8_t g_sAltTable_Time[] = {
14, XFA_N, XFA_N, 3, 9, XFA_N, XFA_N, 15,
XFA_N, XFA_N, XFA_N, XFA_N, 6, XFA_N, XFA_N, XFA_N,
XFA_N, XFA_N, 7, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
@@ -2419,12 +2419,12 @@ static FX_BYTE g_sAltTable_Time[] = { XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N,
};
-static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX_WideString &wsAltSymbols, FX_BYTE *pAltTable)
+static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX_WideString &wsAltSymbols, uint8_t *pAltTable)
{
- FX_INT32 nLength = wsPattern.GetLength();
+ int32_t nLength = wsPattern.GetLength();
FX_BOOL bInConstRange = FALSE;
FX_BOOL bEscape = FALSE;
- FX_INT32 i = 0, n = 0;
+ int32_t i = 0, n = 0;
while (i < nLength) {
FX_WCHAR wc = wsPattern[i];
if (wc == L'\'') {
@@ -2439,7 +2439,7 @@ static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX continue;
}
if (!bInConstRange && (n = wc - L'A') >= 0 && n <= (L'a' - L'A')) {
- FX_INT32 nAlt = (FX_INT32)pAltTable[n];
+ int32_t nAlt = (int32_t)pAltTable[n];
if (nAlt != XFA_N) {
wsPattern.SetAt(i, wsAltSymbols[nAlt]);
}
@@ -2449,7 +2449,7 @@ static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX }
}
#undef XFA_N
-void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard)
+void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard)
{
FX_LOCALEDATETIMESUBCATEGORY strStyle;
switch (iStyle) {
@@ -2499,7 +2499,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, }
strFormat = FX_UTF8Encode(strRet, strRet.GetLength());
}
-void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard)
+void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard)
{
FX_LOCALEDATETIMESUBCATEGORY strStyle;
switch (iStyle) {
@@ -2550,22 +2550,22 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, }
strFormat = FX_UTF8Encode(strRet, strRet.GetLength());
}
-void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat)
+void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat)
{
GetLocalDateFormat(hThis, iStyle, szLocalStr, strFormat, TRUE);
}
-void CXFA_FM2JSContext::GetStandardTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat)
+void CXFA_FM2JSContext::GetStandardTimeFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat)
{
GetLocalTimeFormat(hThis, iStyle, szLocalStr, strFormat, TRUE);
}
-void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime)
+void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, int32_t iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime)
{
- FX_INT32 iHour = 0;
- FX_INT32 iMin = 0;
- FX_INT32 iSec = 0;
- FX_INT32 iZoneHour = 0;
- FX_INT32 iZoneMin = 0;
- FX_INT32 iZoneSec = 0;
+ int32_t iHour = 0;
+ int32_t iMin = 0;
+ int32_t iSec = 0;
+ int32_t iZoneHour = 0;
+ int32_t iZoneMin = 0;
+ int32_t iZoneSec = 0;
iHour = static_cast<int>(iTime) / 3600000;
iMin = (static_cast<int>(iTime) - iHour * 3600000) / 60000;
iSec = (static_cast<int>(iTime) - iHour * 3600000 - iMin * 60000) / 1000;
@@ -2575,7 +2575,7 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR iMin += iZoneMin;
iSec += iZoneSec;
}
- FX_INT32 iRet = 0;
+ int32_t iRet = 0;
CFX_ByteString strIsoTime;
strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec);
if (bGM) {
@@ -2588,18 +2588,18 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR }
return;
}
-void CXFA_FM2JSContext::GetLocalTimeZone(FX_INT32 &iHour, FX_INT32 &iMin, FX_INT32 &iSec)
+void CXFA_FM2JSContext::GetLocalTimeZone(int32_t &iHour, int32_t &iMin, int32_t &iSec)
{
time_t now;
time(&now);
struct tm *pGmt = gmtime(&now);
- FX_INT32 iGMHour = pGmt->tm_hour;
- FX_INT32 iGMMin = pGmt->tm_min;
- FX_INT32 iGMSec = pGmt->tm_sec;
+ int32_t iGMHour = pGmt->tm_hour;
+ int32_t iGMMin = pGmt->tm_min;
+ int32_t iGMSec = pGmt->tm_sec;
struct tm *pLocal = localtime(&now);
- FX_INT32 iLocalHour = pLocal->tm_hour;
- FX_INT32 iLocalMin = pLocal->tm_min;
- FX_INT32 iLocalSec = pLocal->tm_sec;
+ int32_t iLocalHour = pLocal->tm_hour;
+ int32_t iLocalMin = pLocal->tm_min;
+ int32_t iLocalSec = pLocal->tm_sec;
iHour = iLocalHour - iGMHour;
iMin = iLocalMin - iGMMin;
iSec = iLocalSec - iGMSec;
@@ -2628,7 +2628,7 @@ void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
FX_DOUBLE r = 2 * (nPeriods * nPayment - nPrincipal) / (nPeriods * nPrincipal);
FX_DOUBLE nTemp = 1;
- for (FX_INT32 i = 0; i < nPeriods; ++i) {
+ for (int32_t i = 0; i < nPeriods; ++i) {
nTemp *= (1 + r);
}
FX_DOUBLE nRet = r * nTemp / (nTemp - 1) - nPayment / nPrincipal;
@@ -2641,7 +2641,7 @@ void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu }
r = r - nRet / nDerivative;
nTemp = 1;
- for (FX_INT32 i = 0; i < nPeriods; ++i) {
+ for (int32_t i = 0; i < nPeriods; ++i) {
nTemp *= (1 + r);
}
nRet = r * nTemp / (nTemp - 1) - nPayment / nPrincipal;
@@ -2766,8 +2766,8 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } else {
FX_FLOAT fResult = 0;
FX_FLOAT nRateOfMonth = nRate / 12;
- FX_INT32 iNums = (FX_INT32)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth)));
- FX_INT32 iEnd = (FX_INT32)(nFirstMonth + nNumberOfMonths - 1);
+ int32_t iNums = (int32_t)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth)));
+ int32_t iEnd = (int32_t)(nFirstMonth + nNumberOfMonths - 1);
if (iEnd > iNums) {
iEnd = iNums;
}
@@ -2777,7 +2777,7 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg fResult = 0;
}
if(!bFlags) {
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nFirstMonth - 1; ++i) {
nPrincpalAmount -= nPayment - nPrincpalAmount * nRateOfMonth;
}
@@ -2802,11 +2802,11 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc > 2) {
FX_BOOL bFlags = FALSE;
FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argc);
- for (FX_INT32 i = 0; i < argc; i++) {
+ for (int32_t i = 0; i < argc; i++) {
argValues[i] = GetSimpleHValue(hThis, args, i);
if (HValueIsNull(hThis, argValues[i])) {
bFlags = TRUE;
@@ -2819,14 +2819,14 @@ void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
FX_DOUBLE *pData = FX_Alloc(FX_DOUBLE, argc - 1);
- for (FX_INT32 i = 1; i < argc; i++) {
+ for (int32_t i = 1; i < argc; i++) {
pData[i - 1] = HValueToDouble(hThis, argValues[i]);
}
FX_DOUBLE nSum = 0;
- FX_INT32 iIndex = 0;
- for (FX_INT32 i = 0; i < argc - 1; i++) {
+ int32_t iIndex = 0;
+ for (int32_t i = 0; i < argc - 1; i++) {
FX_DOUBLE nTemp = 1;
- for (FX_INT32 j = 0; j <= i; j++) {
+ for (int32_t j = 0; j <= i; j++) {
nTemp *= 1 + nRate;
}
FX_DOUBLE nNum = *(pData + iIndex++);
@@ -2839,7 +2839,7 @@ void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
- for (FX_INT32 i = 0; i < argc; i++) {
+ for (int32_t i = 0; i < argc; i++) {
FXJSE_Value_Release(argValues[i]);
}
FX_Free(argValues);
@@ -2872,7 +2872,7 @@ void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FX_FLOAT nSum = 0;
FX_FLOAT nTmp = 1 + nRate;
nSum = nTmp;
- for (FX_INT32 i = 0; i < nPeriods - 1; ++i) {
+ for (int32_t i = 0; i < nPeriods - 1; ++i) {
nSum *= nTmp;
}
FXJSE_Value_SetFloat(args.GetReturnValue(), (nPrincipal * nRate * nSum) / (nSum - 1));
@@ -2914,10 +2914,10 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg if(bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
- FX_INT32 iEnd = (FX_INT32)(nFirstMonth + nNumberOfMonths - 1);
+ int32_t iEnd = (int32_t)(nFirstMonth + nNumberOfMonths - 1);
FX_FLOAT nSum = 0;
FX_FLOAT nRateOfMonth = nRate / 12;
- FX_INT32 iNums = (FX_INT32)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth)));
+ int32_t iNums = (int32_t)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth)));
if (iEnd > iNums) {
iEnd = iNums;
}
@@ -2925,7 +2925,7 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg bFlags = TRUE;
}
if(!bFlags) {
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < nFirstMonth - 1; ++i) {
nPrincpalAmount -= nPayment - nPrincpalAmount * nRateOfMonth;
}
@@ -2973,7 +2973,7 @@ void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argum pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
FX_DOUBLE nTemp = 1;
- for (FX_INT32 i = 0; i < nPeriod; ++i) {
+ for (int32_t i = 0; i < nPeriod; ++i) {
nTemp *= 1 + nRate;
}
nTemp = 1 / nTemp;
@@ -3055,14 +3055,14 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc > 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
FX_BOOL argOneIsNull = FALSE;
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
argOneIsNull = HValueIsNull(hThis, argOne);
if (!argOneIsNull) {
- iIndex = (FX_INT32)HValueToFloat(hThis, argOne);
+ iIndex = (int32_t)HValueToFloat(hThis, argOne);
}
FXJSE_Value_Release(argOne);
if (argOneIsNull) {
@@ -3072,14 +3072,14 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A } else {
FX_BOOL bFound = FALSE;
FX_BOOL bStopCounterFlags = FALSE;
- FX_INT32 iArgIndex = 1;
- FX_INT32 iValueIndex = 0;
+ int32_t iArgIndex = 1;
+ int32_t iValueIndex = 0;
while(!bFound && !bStopCounterFlags && (iArgIndex < argc)) {
FXJSE_HVALUE argIndexValue = args.GetValue(iArgIndex);
if (FXJSE_Value_IsArray(argIndexValue)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argIndexValue, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 3) {
bStopCounterFlags = TRUE;
@@ -3160,14 +3160,14 @@ void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if(argc > 1) {
FX_BOOL bFlags = FALSE;
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE *parametersValue = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
unfoldArgs(hThis, args, parametersValue, iCount, 1);
- for(FX_INT32 i = 0; i < iCount; i++) {
+ for(int32_t i = 0; i < iCount; i++) {
if(simpleValueCompare(hThis, argOne, parametersValue[i])) {
bFlags = TRUE;
break;
@@ -3175,7 +3175,7 @@ void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
FXJSE_Value_SetInteger(args.GetReturnValue(), bFlags);
FXJSE_Value_Release(argOne);
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
FXJSE_Value_Release(parametersValue[i]);
}
FX_Free(parametersValue);
@@ -3187,7 +3187,7 @@ void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if(argc == 3) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if(FXJSE_Value_IsNull(argOne)) {
@@ -3220,7 +3220,7 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A }
void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (args.GetLength() == 3) {
FXJSE_HVALUE argCondition = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE argFirstValue = GetSimpleHValue(hThis, args, 1);
@@ -3271,20 +3271,20 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_HVALUE argOne = args.GetValue(0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_HVALUE rgValues[3];
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 4);
FXJSE_Value_SetNull(rgValues[1]);
FXJSE_Value_SetNull(rgValues[2]);
FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues);
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
FXJSE_Value_Release(rgValues[i]);
}
} else if (FXJSE_Value_IsArray(argOne)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
FXSYS_assert(iLength >= 3);
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -3295,14 +3295,14 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else if(FXJSE_Value_IsNull(propertyValue) && (!FXJSE_Value_IsNull(jsObjectValue))) {
FXJSE_HVALUE rgValues[3];
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 3);
FXJSE_Value_SetNull(rgValues[1]);
FXJSE_Value_Set(rgValues[2], jsObjectValue);
FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues);
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
FXJSE_Value_Release(rgValues[i]);
}
} else {
@@ -3312,14 +3312,14 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_Release(propertyValue);
} else if(FXJSE_Value_IsObject(argOne)) {
FXJSE_HVALUE rgValues[3];
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 3);
FXJSE_Value_SetNull(rgValues[1]);
FXJSE_Value_Set(rgValues[2], argOne);
FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues);
- for (FX_INT32 i = 0; i < 3; i++) {
+ for (int32_t i = 0; i < 3; i++) {
FXJSE_Value_Release(rgValues[i]);
}
} else if(FXJSE_Value_IsBoolean(argOne) || FXJSE_Value_IsUTF8String(argOne) || FXJSE_Value_IsNumber(argOne)) {
@@ -3360,8 +3360,8 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE unitspanString.MakeLower();
CFX_WideString wsTypeString = CFX_WideString::FromUTF8(unitspanString, unitspanString.GetLength());
FX_LPCWSTR pData = wsTypeString;
- FX_INT32 u = 0;
- FX_INT32 uLen = wsTypeString.GetLength();
+ int32_t u = 0;
+ int32_t uLen = wsTypeString.GetLength();
while (*(pData + u) == 0x20 || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) {
u++;
}
@@ -3435,7 +3435,7 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE }
void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc == 1) || (argc == 2)) {
FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE unitValue = 0;
@@ -3449,12 +3449,12 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS HValueToUTF8String(unitspanValue, unitspanString);
FX_LPCSTR pData = unitspanString;
if (pData) {
- FX_INT32 u = 0;
+ int32_t u = 0;
while (*(pData + u) == 0x20 || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) {
FX_CHAR ch = *(pData + u);
++u;
}
- FX_INT32 uStart = u;
+ int32_t uStart = u;
while (u < unitspanString.GetLength()) {
if ((*(pData + u) > '9' || *(pData + u) < '0') && *(pData + u) != '.' && *(pData + u) != '-') {
break;
@@ -3466,7 +3466,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) {
++u;
}
- FX_INT32 uLen = unitspanString.GetLength();
+ int32_t uLen = unitspanString.GetLength();
while (u < uLen) {
if (*(pData + u) == ' ') {
break;
@@ -3480,7 +3480,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS CFX_ByteString unitTempString;
HValueToUTF8String(unitValue, unitTempString);
FX_LPCSTR pData = unitTempString;
- FX_INT32 u = 0;
+ int32_t u = 0;
while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) {
++u;
}
@@ -3493,7 +3493,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) {
++u;
}
- FX_INT32 uLen = unitTempString.GetLength();
+ int32_t uLen = unitTempString.GetLength();
while (u < uLen) {
if (*(pData + u) == ' ') {
break;
@@ -3612,12 +3612,12 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc >= 1) {
CFX_ByteString resultString;
FX_BOOL bAllNull = TRUE;
FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argc);
- for (FX_INT32 i = 0; i < argc; i++) {
+ for (int32_t i = 0; i < argc; i++) {
argValues[i] = GetSimpleHValue(hThis, args, i);
if(!HValueIsNull(hThis, argValues[i])) {
CFX_ByteString valueStr;
@@ -3626,7 +3626,7 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A bAllNull = FALSE;
}
}
- for(FX_INT32 i = 0; i < argc; i++) {
+ for(int32_t i = 0; i < argc; i++) {
FXJSE_Value_Release(argValues[i]);
}
FX_Free(argValues);
@@ -3643,7 +3643,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if(argc == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if (HValueIsNull(hThis, argOne)) {
@@ -3686,8 +3686,8 @@ void CXFA_FM2JSContext::DecodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu {
CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString.GetCStr(), szURLString.GetLength());
FX_LPCWSTR pData = wsURLString;
- FX_INT32 iLen = wsURLString.GetLength();
- FX_INT32 i = 0;
+ int32_t iLen = wsURLString.GetLength();
+ int32_t i = 0;
FX_WCHAR ch = 0;
FX_WCHAR chTemp = 0;
CFX_WideTextBuf wsResultBuf;
@@ -3695,7 +3695,7 @@ void CXFA_FM2JSContext::DecodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu ch = *(pData + i);
if ('%' == ch) {
chTemp = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iCount < 2) {
++i;
ch = *(pData + i);
@@ -3738,10 +3738,10 @@ void CXFA_FM2JSContext::DecodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu {
CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(szHTMLString.GetCStr(), szHTMLString.GetLength());
FX_WCHAR strString[9];
- FX_INT32 iStrIndex = 0;
- FX_INT32 iLen = wsHTMLString.GetLength();
- FX_INT32 i = 0;
- FX_INT32 iCode = 0;
+ int32_t iStrIndex = 0;
+ int32_t iLen = wsHTMLString.GetLength();
+ int32_t i = 0;
+ int32_t iCode = 0;
FX_WCHAR ch = 0;
FX_LPCWSTR pData = wsHTMLString;
CFX_WideTextBuf wsResultBuf;
@@ -3791,7 +3791,7 @@ void CXFA_FM2JSContext::DecodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu ++i;
continue;
}
- FX_UINT32 iData = 0;
+ uint32_t iData = 0;
if (HTMLSTR2Code(strString, iData)) {
wsResultBuf.AppendChar((FX_WCHAR)iData);
} else {
@@ -3808,10 +3808,10 @@ void CXFA_FM2JSContext::DecodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu {
CFX_WideString wsXMLString = CFX_WideString::FromUTF8(szXMLString.GetCStr(), szXMLString.GetLength());
FX_WCHAR strString[9];
- FX_INT32 iStrIndex = 0;
- FX_INT32 iLen = wsXMLString.GetLength();
- FX_INT32 i = 0;
- FX_INT32 iCode = 0;
+ int32_t iStrIndex = 0;
+ int32_t iLen = wsXMLString.GetLength();
+ int32_t i = 0;
+ int32_t iCode = 0;
FX_WCHAR ch = 0;
FX_LPCWSTR pData = wsXMLString;
CFX_WideTextBuf wsXMLBuf;
@@ -3868,7 +3868,7 @@ void CXFA_FM2JSContext::DecodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu L"lt",
L"gt"
};
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
while (iIndex < 5) {
if (FXSYS_memcmp(strString, strName[iIndex], FXSYS_wcslen(strName[iIndex])) == 0) {
break;
@@ -3907,7 +3907,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if(argc == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if (HValueIsNull(hThis, argOne)) {
@@ -3951,7 +3951,7 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString.GetCStr(), szURLString.GetLength());
CFX_WideTextBuf wsResultBuf;
FX_WCHAR ch = 0;
- FX_INT32 iLength = wsURLString.GetLength();
+ int32_t iLength = wsURLString.GetLength();
FX_WCHAR strEncode[4];
strEncode[0] = '%';
strEncode[3] = 0;
@@ -3959,13 +3959,13 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu FX_WCHAR strReserved[] = {';', '/', '?', ':', '@', '=', '&'};
FX_WCHAR strSpecial[] = {'$', '-', '+', '!', '*', '\'', '(', ')', ','};
const FX_LPCWSTR strCode = L"0123456789abcdef";
- for (FX_INT32 u = 0; u < iLength; ++u) {
+ for (int32_t u = 0; u < iLength; ++u) {
ch = wsURLString.GetAt(u);
- FX_INT32 i = 0;
- FX_INT32 iCount = sizeof(strUnsafe) / sizeof(strUnsafe[0]);
+ int32_t i = 0;
+ int32_t iCount = sizeof(strUnsafe) / sizeof(strUnsafe[0]);
while (i < iCount) {
if (ch == strUnsafe[i]) {
- FX_INT32 iIndex = ch / 16;
+ int32_t iIndex = ch / 16;
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
wsResultBuf << FX_WSTRC(strEncode);
@@ -3980,7 +3980,7 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu iCount = sizeof(strReserved) / sizeof(strReserved[0]);
while (i < iCount) {
if (ch == strReserved[i]) {
- FX_INT32 iIndex = ch / 16;
+ int32_t iIndex = ch / 16;
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
wsResultBuf << FX_WSTRC(strEncode);
@@ -4004,19 +4004,19 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu continue;
}
if (ch >= 0x80 && ch <= 0xff) {
- FX_INT32 iIndex = ch / 16;
+ int32_t iIndex = ch / 16;
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
wsResultBuf << FX_WSTRC(strEncode);
} else if ((ch >= 0x0 && ch <= 0x1f) || ch == 0x7f) {
- FX_INT32 iIndex = ch / 16;
+ int32_t iIndex = ch / 16;
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
wsResultBuf << FX_WSTRC(strEncode);
} else if (ch >= 0x20 && ch <= 0x7e) {
wsResultBuf.AppendChar(ch);
} else {
- FX_INT32 iRadix = 16;
+ int32_t iRadix = 16;
CFX_WideString strTmp;
while (ch >= iRadix) {
FX_WCHAR tmp = strCode[ch % iRadix];
@@ -4024,11 +4024,11 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu strTmp += tmp;
}
strTmp += strCode[ch];
- FX_INT32 iLen = strTmp.GetLength();
+ int32_t iLen = strTmp.GetLength();
if (iLen < 2) {
break;
}
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
if (iLen % 2 != 0) {
strEncode[1] = '0';
strEncode[2] = strTmp.GetAt(iLen - 1);
@@ -4064,11 +4064,11 @@ void CXFA_FM2JSContext::EncodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu strEncode[7] = ';';
strEncode[8] = 0;
CFX_WideTextBuf wsResultBuf;
- FX_UINT32 ch = 0;
- FX_INT32 iLen = wsHTMLString.GetLength();
- FX_INT32 i = 0;
+ uint32_t ch = 0;
+ int32_t iLen = wsHTMLString.GetLength();
+ int32_t i = 0;
FX_LPCWSTR pData = wsHTMLString;
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
CFX_WideString htmlReserve;
while (i < iLen) {
ch = *(pData + i);
@@ -4088,8 +4088,8 @@ void CXFA_FM2JSContext::EncodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu strEncode[6] = 0;
wsResultBuf << FX_WSTRC(strEncode);
} else {
- FX_INT32 iBigByte = ch / 256;
- FX_INT32 iLittleByte = ch % 256;
+ int32_t iBigByte = ch / 256;
+ int32_t iLittleByte = ch % 256;
strEncode[3] = strCode[iBigByte / 16];
strEncode[4] = strCode[iBigByte % 16];
strEncode[5] = strCode[iLittleByte / 16];
@@ -4130,9 +4130,9 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu };
const FX_LPCWSTR strCode = L"0123456789abcdef";
FX_WCHAR ch = 0;
- FX_INT32 iLength = wsXMLString.GetLength();
- FX_INT32 iIndex = 0;
- FX_INT32 u = 0;
+ int32_t iLength = wsXMLString.GetLength();
+ int32_t iIndex = 0;
+ int32_t u = 0;
FX_LPCWSTR pData = wsXMLString;
for (u = 0; u < iLength; ++u) {
ch = *(pData + u);
@@ -4173,8 +4173,8 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu strEncode[6] = 0;
wsResultBuf << FX_WSTRC(strEncode);
} else {
- FX_INT32 iBigByte = ch / 256;
- FX_INT32 iLittleByte = ch % 256;
+ int32_t iBigByte = ch / 256;
+ int32_t iLittleByte = ch % 256;
strEncode[3] = strCode[iBigByte / 16];
strEncode[4] = strCode[iBigByte % 16];
strEncode[5] = strCode[iLittleByte / 16];
@@ -4188,13 +4188,13 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu wsResultBuf.AppendChar(0);
szResultBuf = FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength());
}
-FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, FX_UINT32 &iCode)
+FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, uint32_t &iCode)
{
- FX_INT32 iLength = pData.GetLength();
- FX_UINT32 uHash = FX_HashCode_String_GetW(pData.GetPtr(), iLength);
+ int32_t iLength = pData.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(pData.GetPtr(), iLength);
XFA_FMHtmlHashedReserveCode htmlhashedreservecode;
- FX_INT32 iStart = 0, iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0, iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1;
+ int32_t iMid = (iStart + iEnd) / 2;
do {
iMid = (iStart + iEnd) / 2;
htmlhashedreservecode = reservesForDecode[iMid];
@@ -4209,11 +4209,11 @@ FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, FX_UINT32 &iCode) } while (iStart <= iEnd);
return FALSE;
}
-FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(FX_UINT32 iCode, CFX_WideString &wsHTMLReserve)
+FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode, CFX_WideString &wsHTMLReserve)
{
XFA_FMHtmlReserveCode htmlreservecode;
- FX_INT32 iStart = 0, iEnd = (sizeof(reservesForEncode) / sizeof(reservesForEncode[0])) - 1;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0, iEnd = (sizeof(reservesForEncode) / sizeof(reservesForEncode[0])) - 1;
+ int32_t iMid = (iStart + iEnd) / 2;
do {
iMid = (iStart + iEnd) / 2;
htmlreservecode = reservesForEncode[iMid];
@@ -4260,8 +4260,8 @@ static FX_BOOL XFA_PATTERN_STRING_Type(FX_BSTR szPattern, FX_DWORD& patternType) patternType = XFA_VT_NULL;
wsPattern.MakeLower();
FX_LPCWSTR pData = wsPattern;
- FX_INT32 iLength = wsPattern.GetLength();
- FX_INT32 iIndex = 0;
+ int32_t iLength = wsPattern.GetLength();
+ int32_t iIndex = 0;
FX_BOOL bSingleQuotation = FALSE;
FX_WCHAR patternChar;
while (iIndex < iLength) {
@@ -4308,7 +4308,7 @@ static FX_BOOL XFA_PATTERN_STRING_Type(FX_BSTR szPattern, FX_DWORD& patternType) void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc >= 2) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
@@ -4406,7 +4406,7 @@ void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } else {
CFX_ByteString sourceString;
HValueToUTF8String(argOne, sourceString);
- FX_INT32 count = HValueToInteger(hThis, argTwo);
+ int32_t count = HValueToInteger(hThis, argTwo);
if (count < 0) {
count = 0;
}
@@ -4438,7 +4438,7 @@ void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu }
void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 3)) {
CFX_ByteString argString;
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
@@ -4453,9 +4453,9 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar CFX_WideTextBuf lowStringBuf;
CFX_WideString wsArgString = CFX_WideString::FromUTF8(argString, argString.GetLength());
FX_LPCWSTR pData = wsArgString;
- FX_INT32 iLen = argString.GetLength();
- FX_INT32 i = 0;
- FX_INT32 ch = 0;
+ int32_t iLen = argString.GetLength();
+ int32_t i = 0;
+ int32_t ch = 0;
while (i < iLen) {
ch = *(pData + i);
if (ch >= 0x41 && ch <= 0x5A) {
@@ -4629,7 +4629,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc == 2) || (argc == 3)) {
FX_BOOL bFlags = FALSE;
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
@@ -4648,17 +4648,17 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ argThree = GetSimpleHValue(hThis, args, 2);
HValueToUTF8String(argThree, threeString);
}
- FX_INT32 iSrcLen = oneString.GetLength();
- FX_INT32 iFindLen = twoString.GetLength();
+ int32_t iSrcLen = oneString.GetLength();
+ int32_t iFindLen = twoString.GetLength();
CFX_ByteTextBuf resultString;
- FX_INT32 iFindIndex = 0;
- FX_BYTE ch = 0;
- for (FX_INT32 u = 0; u < iSrcLen; ++u) {
+ int32_t iFindIndex = 0;
+ uint8_t ch = 0;
+ for (int32_t u = 0; u < iSrcLen; ++u) {
ch = oneString.GetAt(u);
if (ch == twoString.GetAt(iFindIndex)) {
- FX_INT32 iTemp = u + 1;
+ int32_t iTemp = u + 1;
++iFindIndex;
- FX_BYTE chTemp = 0;
+ uint8_t chTemp = 0;
while (iFindIndex < iFindLen) {
chTemp = oneString.GetAt(iTemp);
if (chTemp == twoString.GetAt(iFindIndex)) {
@@ -4708,7 +4708,7 @@ void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else {
CFX_ByteString sourceString;
HValueToUTF8String(argOne, sourceString);
- FX_INT32 count = HValueToInteger(hThis, argTwo);
+ int32_t count = HValueToInteger(hThis, argTwo);
if (count < 0) {
count = 0;
}
@@ -4748,11 +4748,11 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_INT32 count = 0;
+ int32_t count = 0;
count = HValueToInteger(hThis, argOne);
count = (count < 0) ? 0 : count;
CFX_ByteTextBuf spaceString;
- FX_INT32 index = 0;
+ int32_t index = 0;
while (index < count) {
spaceString.AppendByte(' ');
index++;
@@ -4767,12 +4767,12 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
FX_FLOAT fNumber;
- FX_INT32 iWidth = 10;
- FX_INT32 iPrecision = 0;
+ int32_t iWidth = 10;
+ int32_t iPrecision = 0;
FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE widthValue = 0;
FXJSE_HVALUE precisionValue = 0;
@@ -4783,11 +4783,11 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu }
if(argc > 1) {
widthValue = GetSimpleHValue(hThis, args, 1);
- iWidth = (FX_INT32)HValueToFloat(hThis, widthValue);
+ iWidth = (int32_t)HValueToFloat(hThis, widthValue);
}
if (argc == 3) {
precisionValue = GetSimpleHValue(hThis, args, 2);
- iPrecision = (FX_INT32)HValueToFloat(hThis, precisionValue);
+ iPrecision = (int32_t)HValueToFloat(hThis, precisionValue);
if (iPrecision < 0) {
iPrecision = 0;
}
@@ -4802,8 +4802,8 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu formatStr += "f";
numberString.Format(formatStr, fNumber);
FX_LPCSTR pData = numberString;
- FX_INT32 iLength = numberString.GetLength();
- FX_INT32 u = 0;
+ int32_t iLength = numberString.GetLength();
+ int32_t u = 0;
while (u < iLength) {
if (*(pData + u) == '.') {
break;
@@ -4812,7 +4812,7 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu }
CFX_ByteTextBuf resultBuf;
if (u > iWidth || (iPrecision + u) >= iWidth) {
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iWidth) {
resultBuf.AppendChar('*');
++i;
@@ -4821,14 +4821,14 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else {
if (u == iLength) {
if (iLength > iWidth) {
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iWidth) {
resultBuf.AppendChar('*');
++i;
}
} else {
- FX_INT32 i = 0;
- FX_INT32 iSpace = iWidth - iLength;
+ int32_t i = 0;
+ int32_t iSpace = iWidth - iLength;
while (i < iSpace) {
resultBuf.AppendChar(' ');
++i;
@@ -4836,13 +4836,13 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu resultBuf << pData;
}
} else {
- FX_INT32 iLeavingSpace = 0;
+ int32_t iLeavingSpace = 0;
if (iPrecision == 0) {
iLeavingSpace = iWidth - (u + iPrecision);
} else {
iLeavingSpace = iWidth - (u + iPrecision + 1);
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iLeavingSpace) {
resultBuf.AppendChar(' ');
++i;
@@ -4890,14 +4890,14 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu }
void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc == 3) || (argc == 4)) {
FX_BOOL bFlags = FALSE;
CFX_ByteString sourceString;
CFX_ByteString insertString;
- FX_INT32 iLength = 0;
- FX_INT32 iStart = 0;
- FX_INT32 iDelete = 0;
+ int32_t iLength = 0;
+ int32_t iStart = 0;
+ int32_t iDelete = 0;
FXJSE_HVALUE sourceValue = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1);
FXJSE_HVALUE deleteValue = GetSimpleHValue(hThis, args, 2);
@@ -4907,14 +4907,14 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else {
HValueToUTF8String(sourceValue, sourceString);
iLength = sourceString.GetLength();
- iStart = (FX_INT32)HValueToFloat(hThis, startValue);
+ iStart = (int32_t)HValueToFloat(hThis, startValue);
if (iStart < 1) {
iStart = 1;
}
if (iStart > iLength) {
iStart = iLength;
}
- iDelete = (FX_INT32)HValueToFloat(hThis, deleteValue);
+ iDelete = (int32_t)HValueToFloat(hThis, deleteValue);
if (iDelete <= 0) {
iDelete = 0;
}
@@ -4925,7 +4925,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
iStart -= 1;
CFX_ByteTextBuf resultString;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iStart) {
resultString.AppendChar(sourceString.GetAt(i));
++i;
@@ -4951,7 +4951,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if(argc == 3) {
FXJSE_HVALUE stringValue = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1);
@@ -4960,15 +4960,15 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString szSourceStr;
- FX_INT32 iStart = 0;
- FX_INT32 iCount = 0;
+ int32_t iStart = 0;
+ int32_t iCount = 0;
HValueToUTF8String(stringValue, szSourceStr);
- FX_INT32 iLength = szSourceStr.GetLength();
+ int32_t iLength = szSourceStr.GetLength();
if (iLength == 0) {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC(""));
} else {
- iStart = (FX_INT32)HValueToFloat(hThis, startValue);
- iCount = (FX_INT32)HValueToFloat(hThis, endValue);
+ iStart = (int32_t)HValueToFloat(hThis, startValue);
+ iCount = (int32_t)HValueToFloat(hThis, endValue);
if (iStart < 1) {
iStart = 1;
}
@@ -4992,13 +4992,13 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A }
void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if((argc == 0) || (argc == 1)) {
- FX_INT32 iNum = 0;
+ int32_t iNum = 0;
FXJSE_HVALUE argOne = 0;
if(argc == 1) {
argOne = GetSimpleHValue(hThis, args, 0);
- iNum = (FX_INT32)HValueToFloat(hThis, argOne);
+ iNum = (int32_t)HValueToFloat(hThis, argOne);
}
FX_GUID guid;
FX_GUID_CreateV4(&guid);
@@ -5015,7 +5015,7 @@ void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg }
void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 3)) {
CFX_ByteString argString;
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
@@ -5030,9 +5030,9 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar CFX_WideTextBuf upperStringBuf;
CFX_WideString wsArgString = CFX_WideString::FromUTF8(argString, argString.GetLength());
FX_LPCWSTR pData = wsArgString;
- FX_INT32 iLen = wsArgString.GetLength();
- FX_INT32 i = 0;
- FX_INT32 ch = 0;
+ int32_t iLen = wsArgString.GetLength();
+ int32_t i = 0;
+ int32_t ch = 0;
while (i < iLen) {
ch = *(pData + i);
if (ch >= 0x61 && ch <= 0x7A) {
@@ -5059,11 +5059,11 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar }
void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 4)) {
FX_BOOL bFlags = FALSE;
FX_FLOAT fNumber;
- FX_INT32 iIdentifier = 0;
+ int32_t iIdentifier = 0;
CFX_ByteString localeString;
FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE identifierValue = 0;
@@ -5078,7 +5078,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(identifierValue)) {
bFlags = TRUE;
} else {
- iIdentifier = (FX_INT32)HValueToFloat(hThis, identifierValue);
+ iIdentifier = (int32_t)HValueToFloat(hThis, identifierValue);
}
}
if (argc == 3) {
@@ -5121,9 +5121,9 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) CFX_ByteStringC pTens[] = {"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
CFX_ByteStringC pLastTens[] = {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
CFX_ByteStringC pComm[] = {" Hundred ", " Thousand ", " Million ", " Billion ", "Trillion"};
- FX_INT32 iComm = 0;
+ int32_t iComm = 0;
FX_LPCSTR pData = szData.GetCStr();
- FX_INT32 iLength = szData.GetLength();
+ int32_t iLength = szData.GetLength();
if (iLength > 12) {
iComm = 4;
} else if (iLength > 9) {
@@ -5133,8 +5133,8 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) } else if (iLength > 3) {
iComm = 1;
}
- FX_INT32 iIndex = 0;
- FX_INT32 iFirstCount = iLength % 3;
+ int32_t iIndex = 0;
+ int32_t iFirstCount = iLength % 3;
if (iFirstCount == 0) {
iFirstCount = 3;
}
@@ -5205,13 +5205,13 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) iIndex += 3;
}
}
-void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf &strBuf)
+void CXFA_FM2JSContext::WordUS(FX_BSTR szData, int32_t iStyle, CFX_ByteTextBuf &strBuf)
{
FX_LPCSTR pData = szData.GetCStr();
- FX_INT32 iLength = szData.GetLength();
+ int32_t iLength = szData.GetLength();
switch (iStyle) {
case 0: {
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
while (iIndex < iLength) {
if (*(pData + iIndex) == '.') {
break;
@@ -5220,7 +5220,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf }
iLength = iIndex;
iIndex = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iIndex < iLength) {
iCount = (iLength - iIndex) % 12;
if (!iCount && iLength - iIndex > 0) {
@@ -5235,7 +5235,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf }
break;
case 1: {
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
while (iIndex < iLength) {
if (*(pData + iIndex) == '.') {
break;
@@ -5244,7 +5244,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf }
iLength = iIndex;
iIndex = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iIndex < iLength) {
iCount = (iLength - iIndex) % 12;
if (!iCount && iLength - iIndex > 0) {
@@ -5260,16 +5260,16 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf }
break;
case 2: {
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
while (iIndex < iLength) {
if (*(pData + iIndex) == '.') {
break;
}
++iIndex;
}
- FX_INT32 iInteger = iIndex;
+ int32_t iInteger = iIndex;
iIndex = 0;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iIndex < iInteger) {
iCount = (iInteger - iIndex) % 12;
if (!iCount && iLength - iIndex > 0) {
@@ -5285,7 +5285,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf if (iInteger < iLength) {
strBuf << FX_BSTRC(" And ");
iIndex = iInteger + 1;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (iIndex < iLength) {
iCount = (iLength - iIndex) % 12;
if (!iCount && iLength - iIndex > 0) {
@@ -5308,7 +5308,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc == 1) {
CXFA_Document *pDoc = pContext->GetDocument();
if(!pDoc) {
@@ -5323,8 +5323,8 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu HValueToUTF8String(argOne, urlString);
IFX_FileRead* pFile = pAppProvider->DownloadURL(CFX_WideString::FromUTF8(urlString, urlString.GetLength()));
if (pFile) {
- FX_INT32 size = pFile->GetSize();
- FX_LPBYTE pData = FX_Alloc(FX_BYTE, size);
+ int32_t size = pFile->GetSize();
+ FX_LPBYTE pData = FX_Alloc(uint8_t, size);
if(pData) {
pFile->ReadBlock(pData, size);
FXJSE_Value_SetUTF8String(args.GetReturnValue(), CFX_ByteStringC(pData, size));
@@ -5340,7 +5340,7 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if((argc >= 2) && (argc <= 5)) {
CXFA_Document *pDoc = pContext->GetDocument();
if(!pDoc) {
@@ -5403,7 +5403,7 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if((argc == 2) || (argc == 3)) {
CXFA_Document *pDoc = pContext->GetDocument();
if(!pDoc) {
@@ -5454,13 +5454,13 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FX_BSTR szFun if (FXJSE_Value_IsArray(lValue)) {
FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(lValue, FX_BSTRC("length"), leftLengthValue);
- FX_INT32 iLeftLength = FXJSE_Value_ToInteger(leftLengthValue);
+ int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue);
FXJSE_Value_Release(leftLengthValue);
FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime);
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectPropByIdx(lValue, 1, propertyValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- for (FX_INT32 i = 2; i < iLeftLength; i++) {
+ for (int32_t i = 2; i < iLeftLength; i++) {
FXJSE_Value_GetObjectPropByIdx(lValue, i, jsObjectValue);
bSetStatus = SetObjectDefaultValue(jsObjectValue, rValue);
if (!bSetStatus) {
@@ -5471,7 +5471,7 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FX_BSTR szFun } else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- for (FX_INT32 i = 2; i < iLeftLength; i++) {
+ for (int32_t i = 2; i < iLeftLength; i++) {
FXJSE_Value_GetObjectPropByIdx(lValue, i, jsObjectValue);
FXJSE_Value_SetObjectProp(jsObjectValue, propertyStr, rValue);
}
@@ -5799,7 +5799,7 @@ void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, }
void CXFA_FM2JSContext::positive_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
@@ -5815,7 +5815,7 @@ void CXFA_FM2JSContext::positive_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncNam }
void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
@@ -5831,7 +5831,7 @@ void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncNam }
void CXFA_FM2JSContext::logical_not_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
@@ -5850,14 +5850,14 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if((argc == 4) || (argc == 5)) {
FX_BOOL bIsStar = TRUE;
FXJSE_HVALUE argAccessor = args.GetValue(0);
CFX_ByteString bsAccessorName = args.GetUTF8String(1);
CFX_ByteString szName = args.GetUTF8String(2);
- FX_INT32 iIndexFlags = args.GetInt32(3);
- FX_INT32 iIndexValue = 0;
+ int32_t iIndexFlags = args.GetInt32(3);
+ int32_t iIndexValue = 0;
FXJSE_HVALUE argIndex = NULL;
if(argc == 5) {
bIsStar = FALSE;
@@ -5869,20 +5869,20 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if(FXJSE_Value_IsArray(argAccessor)) {
FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(hLengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(hLengthValue);
FXJSE_Value_Release(hLengthValue);
- FX_INT32 iCounter = 0;
+ int32_t iCounter = 0;
FXJSE_HVALUE **hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2);
- FX_INT32 *iSizes = FX_Alloc(FX_INT32, iLength - 2);
- for (FX_INT32 i = 0; i < (iLength - 2); i++) {
+ int32_t *iSizes = FX_Alloc(int32_t, iLength - 2);
+ for (int32_t i = 0; i < (iLength - 2); i++) {
iSizes[i] = 0;
}
FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(hruntime);
FX_BOOL bAttribute = FALSE;
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue);
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty());
+ int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty());
if(iRet > 0) {
ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
@@ -5891,7 +5891,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF FXJSE_Value_Release(hJSObjValue);
if (iCounter > 0) {
FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2);
- for(FX_INT32 i = 0; i < (iCounter + 2); i++) {
+ for(int32_t i = 0; i < (iCounter + 2); i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 1);
@@ -5900,15 +5900,15 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } else {
FXJSE_Value_SetNull(rgValues[1]);
}
- FX_INT32 iIndex = 2;
- for(FX_INT32 i = 0; i < iLength - 2; i++) {
- for(FX_INT32 j = 0; j < iSizes[i]; j++) {
+ int32_t iIndex = 2;
+ for(int32_t i = 0; i < iLength - 2; i++) {
+ for(int32_t j = 0; j < iSizes[i]; j++) {
FXJSE_Value_Set(rgValues[iIndex], hResolveValues[i][j]);
iIndex++;
}
}
FXJSE_Value_SetArray(args.GetReturnValue(), (iCounter + 2), rgValues);
- for(FX_INT32 i = 0; i < (iCounter + 2); i++) {
+ for(int32_t i = 0; i < (iCounter + 2); i++) {
FXJSE_Value_Release(rgValues[i]);
}
FX_Free(rgValues);
@@ -5917,8 +5917,8 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (FX_LPCWSTR)wsPropertyName, (FX_LPCWSTR)wsSomExpression);
}
- for(FX_INT32 i = 0; i < iLength - 2; i++) {
- for(FX_INT32 j = 0; j < iSizes[i]; j++) {
+ for(int32_t i = 0; i < iLength - 2; i++) {
+ for(int32_t j = 0; j < iSizes[i]; j++) {
FXJSE_Value_Release(hResolveValues[i][j]);
}
if (iSizes[i] > 0) {
@@ -5929,7 +5929,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF FX_Free(iSizes);
} else {
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = 0;
+ int32_t iRet = 0;
if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) {
iRet = ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty());
} else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) {
@@ -5940,11 +5940,11 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF }
if(iRet > 0) {
FXJSE_HVALUE *hResolveValues;
- FX_INT32 iSize = 0;
+ int32_t iSize = 0;
FX_BOOL bAttribute = FALSE;
ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues, iSize, bAttribute);
FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2);
- for(FX_INT32 i = 0; i < (iSize + 2); i++) {
+ for(int32_t i = 0; i < (iSize + 2); i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 1);
@@ -5953,15 +5953,15 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } else {
FXJSE_Value_SetNull(rgValues[1]);
}
- for(FX_INT32 i = 0; i < iSize; i++) {
+ for(int32_t i = 0; i < iSize; i++) {
FXJSE_Value_Set(rgValues[i + 2], hResolveValues[i]);
}
FXJSE_Value_SetArray(args.GetReturnValue(), (iSize + 2), rgValues);
- for(FX_INT32 i = 0; i < (iSize + 2); i++) {
+ for(int32_t i = 0; i < (iSize + 2); i++) {
FXJSE_Value_Release(rgValues[i]);
}
FX_Free(rgValues);
- for(FX_INT32 i = 0; i < iSize; i++) {
+ for(int32_t i = 0; i < iSize; i++) {
FXJSE_Value_Release(hResolveValues[i]);
}
FX_Free(hResolveValues);
@@ -5983,14 +5983,14 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if((argc == 4) || (argc == 5)) {
FX_BOOL bIsStar = TRUE;
FXJSE_HVALUE argAccessor = args.GetValue(0);
CFX_ByteString bsAccessorName = args.GetUTF8String(1);
CFX_ByteString szName = args.GetUTF8String(2);
- FX_INT32 iIndexFlags = args.GetInt32(3);
- FX_INT32 iIndexValue = 0;
+ int32_t iIndexFlags = args.GetInt32(3);
+ int32_t iIndexValue = 0;
FXJSE_HVALUE argIndex = NULL;
if(argc == 5) {
bIsStar = FALSE;
@@ -6002,16 +6002,16 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, if(FXJSE_Value_IsArray(argAccessor)) {
FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(hLengthValue);
- FX_INT32 iCounter = 0;
+ int32_t iLength = FXJSE_Value_ToInteger(hLengthValue);
+ int32_t iCounter = 0;
FXJSE_HVALUE **hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2);
- FX_INT32 *iSizes = FX_Alloc(FX_INT32, iLength - 2);
+ int32_t *iSizes = FX_Alloc(int32_t, iLength - 2);
FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(hruntime);
FX_BOOL bAttribute = FALSE;
- for(FX_INT32 i = 2; i < iLength; i++) {
+ for(int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue);
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, FALSE);
+ int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, FALSE);
if(iRet > 0) {
ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
@@ -6020,7 +6020,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, FXJSE_Value_Release(hJSObjValue);
if (iCounter > 0) {
FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2);
- for(FX_INT32 i = 0; i < (iCounter + 2); i++) {
+ for(int32_t i = 0; i < (iCounter + 2); i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 1);
@@ -6029,15 +6029,15 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } else {
FXJSE_Value_SetNull(rgValues[1]);
}
- FX_INT32 iIndex = 2;
- for(FX_INT32 i = 0; i < iLength - 2; i++) {
- for(FX_INT32 j = 0; j < iSizes[i]; j++) {
+ int32_t iIndex = 2;
+ for(int32_t i = 0; i < iLength - 2; i++) {
+ for(int32_t j = 0; j < iSizes[i]; j++) {
FXJSE_Value_Set(rgValues[iIndex], hResolveValues[i][j]);
iIndex++;
}
}
FXJSE_Value_SetArray(args.GetReturnValue(), (iCounter + 2), rgValues);
- for(FX_INT32 i = 0; i < (iCounter + 2); i++) {
+ for(int32_t i = 0; i < (iCounter + 2); i++) {
FXJSE_Value_Release(rgValues[i]);
}
FX_Free(rgValues);
@@ -6046,8 +6046,8 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength());
pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (FX_LPCWSTR)wsPropertyName, (FX_LPCWSTR)wsSomExpression);
}
- for(FX_INT32 i = 0; i < iLength - 2; i++) {
- for(FX_INT32 j = 0; j < iSizes[i]; j++) {
+ for(int32_t i = 0; i < iLength - 2; i++) {
+ for(int32_t j = 0; j < iSizes[i]; j++) {
FXJSE_Value_Release(hResolveValues[i][j]);
}
FX_Free(hResolveValues[i]);
@@ -6057,7 +6057,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, FXJSE_Value_Release(hLengthValue);
} else {
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = 0;
+ int32_t iRet = 0;
if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) {
iRet = ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS, FALSE);
} else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) {
@@ -6068,11 +6068,11 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, }
if(iRet > 0) {
FXJSE_HVALUE *hResolveValues;
- FX_INT32 iSize = 0;
+ int32_t iSize = 0;
FX_BOOL bAttribute = FALSE;
ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues, iSize, bAttribute);
FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2);
- for(FX_INT32 i = 0; i < (iSize + 2); i++) {
+ for(int32_t i = 0; i < (iSize + 2); i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 1);
@@ -6081,15 +6081,15 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } else {
FXJSE_Value_SetNull(rgValues[1]);
}
- for(FX_INT32 i = 0; i < iSize; i++) {
+ for(int32_t i = 0; i < iSize; i++) {
FXJSE_Value_Set(rgValues[i + 2], hResolveValues[i]);
}
FXJSE_Value_SetArray(args.GetReturnValue(), (iSize + 2), rgValues);
- for(FX_INT32 i = 0; i < (iSize + 2); i++) {
+ for(int32_t i = 0; i < (iSize + 2); i++) {
FXJSE_Value_Release(rgValues[i]);
}
FX_Free(rgValues);
- for(FX_INT32 i = 0; i < iSize; i++) {
+ for(int32_t i = 0; i < iSize; i++) {
FXJSE_Value_Release(hResolveValues[i]);
}
FX_Free(hResolveValues);
@@ -6111,7 +6111,7 @@ void CXFA_FM2JSContext::eval_translation (FXJSE_HOBJECT hThis, FX_BSTR szFuncNam {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc == 1) {
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
CFX_ByteString argString;
@@ -6137,7 +6137,7 @@ void CXFA_FM2JSContext::eval_translation (FXJSE_HOBJECT hThis, FX_BSTR szFuncNam }
void CXFA_FM2JSContext::is_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
FXJSE_Value_SetBoolean(args.GetReturnValue(), FXJSE_Value_IsObject(argOne));
@@ -6148,7 +6148,7 @@ void CXFA_FM2JSContext::is_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF }
void CXFA_FM2JSContext::is_fm_array(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args)
{
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne);
@@ -6162,7 +6162,7 @@ void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 iLength = args.GetLength();
+ int32_t iLength = args.GetLength();
if (iLength == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
if(FXJSE_Value_IsArray(argOne)) {
@@ -6193,13 +6193,13 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
if(FXJSE_Value_IsArray(argOne)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXSYS_assert(iLength >= 3);
FXJSE_Value_Release(lengthValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue());
@@ -6215,29 +6215,29 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, C {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
if (argc == 1) {
FXJSE_HVALUE argOne = args.GetValue(0);
if(FXJSE_Value_IsArray(argOne)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXSYS_assert(iLength >= 3);
FXJSE_Value_Release(lengthValue);
FXJSE_HVALUE flagsValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectPropByIdx(argOne, 0, flagsValue);
- FX_INT32 iFlags = FXJSE_Value_ToInteger(flagsValue);
+ int32_t iFlags = FXJSE_Value_ToInteger(flagsValue);
FXJSE_Value_Release(flagsValue);
if(iFlags == 4) {
FXJSE_HVALUE rgValues[3];
- for(FX_INT32 i = 0; i < 3; i++) {
+ for(int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(hruntime);
}
FXJSE_Value_SetInteger(rgValues[0], 3);
FXJSE_Value_SetNull(rgValues[1]);
FXJSE_Value_SetNull(rgValues[2]);
FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues);
- for(FX_INT32 i = 0; i < 3; i++) {
+ for(int32_t i = 0; i < 3; i++) {
FXJSE_Value_Release(rgValues[i]);
}
} else if(iFlags == 3) {
@@ -6268,31 +6268,31 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName {
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_UINT32 iLength = 0;
- FX_INT32 argCount = args.GetLength();
+ uint32_t iLength = 0;
+ int32_t argCount = args.GetLength();
FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argCount);
- for(FX_INT32 i = 0; i < argCount; i++) {
+ for(int32_t i = 0; i < argCount; i++) {
argValues[i] = args.GetValue(i);
if(FXJSE_Value_IsArray(argValues[i])) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue);
- FX_INT32 length = FXJSE_Value_ToInteger(lengthValue);
+ int32_t length = FXJSE_Value_ToInteger(lengthValue);
iLength = iLength + ((length > 2) ? (length - 2) : 0);
FXJSE_Value_Release(lengthValue);
}
iLength += 1;
}
FXJSE_HVALUE *returnValues = FX_Alloc(FXJSE_HVALUE, iLength);
- for(FX_INT32 i = 0; i < (FX_INT32)iLength; i++) {
+ for(int32_t i = 0; i < (int32_t)iLength; i++) {
returnValues[i] = FXJSE_Value_Create(hruntime);
}
- FX_INT32 index = 0;
- for(FX_INT32 i = 0; i < argCount; i++) {
+ int32_t index = 0;
+ for(int32_t i = 0; i < argCount; i++) {
if(FXJSE_Value_IsArray(argValues[i])) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue);
- FX_INT32 length = FXJSE_Value_ToInteger(lengthValue);
- for(FX_INT32 j = 2; j < length; j++) {
+ int32_t length = FXJSE_Value_ToInteger(lengthValue);
+ for(int32_t j = 2; j < length; j++) {
FXJSE_Value_GetObjectPropByIdx(argValues[i], j, returnValues[index]);
index++;
}
@@ -6302,25 +6302,25 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName index++;
}
FXJSE_Value_SetArray(args.GetReturnValue(), iLength, returnValues);
- for(FX_INT32 i = 0; i < argCount; i++) {
+ for(int32_t i = 0; i < argCount; i++) {
FXJSE_Value_Release(argValues[i]);
}
FX_Free(argValues);
- for(FX_INT32 i = 0; i < (FX_INT32)iLength; i++) {
+ for(int32_t i = 0; i < (int32_t)iLength; i++) {
FXJSE_Value_Release(returnValues[i]);
}
FX_Free(returnValues);
}
-FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FX_UINT32 index)
+FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, uint32_t index)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FXSYS_assert(index < (FX_UINT32)args.GetLength());
+ FXSYS_assert(index < (uint32_t)args.GetLength());
FXJSE_HVALUE argIndex = args.GetValue(index);
if (FXJSE_Value_IsArray(argIndex)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argIndex, FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
FXJSE_HVALUE simpleValue = FXJSE_Value_Create(hruntime);
if (iLength > 2) {
@@ -6359,7 +6359,7 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) if (FXJSE_Value_IsNull(arg)) {
isNull = TRUE;
} else if (FXJSE_Value_IsArray(arg)) {
- FX_INT32 iLength = hvalue_get_array_length(hThis, arg);
+ int32_t iLength = hvalue_get_array_length(hThis, arg);
if (iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime);
@@ -6397,11 +6397,11 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) }
return isNull;
}
-FX_INT32 CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg)
+int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 iLength = 0;
+ int32_t iLength = 0;
if (FXJSE_Value_IsArray(arg)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(arg, FX_BSTRC("length"), lengthValue);
@@ -6429,19 +6429,19 @@ FX_BOOL CXFA_FM2JSContext::simpleValueCompare(FXJSE_HOBJECT hThis, FXJSE_HVALUE }
return bReturn;
}
-void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, FX_INT32 &iCount, FX_INT32 iStart)
+void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, int32_t &iCount, int32_t iStart)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
iCount = 0;
- FX_INT32 argc = args.GetLength();
+ int32_t argc = args.GetLength();
FXJSE_HVALUE *argsValue = FX_Alloc(FXJSE_HVALUE, argc);
- for (FX_INT32 i = iStart; i < argc; i++) {
+ for (int32_t i = iStart; i < argc; i++) {
argsValue[i] = args.GetValue(i);
if (FXJSE_Value_IsArray(argsValue[i])) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
iCount += ((iLength > 2) ? (iLength - 2) : 0);
} else {
@@ -6449,22 +6449,22 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, }
}
resultValues = FX_Alloc(FXJSE_HVALUE, iCount);
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
resultValues[i] = FXJSE_Value_Create(hruntime);
}
- FX_INT32 index = 0;
- for (FX_INT32 i = iStart; i < argc; i++) {
+ int32_t index = 0;
+ for (int32_t i = iStart; i < argc; i++) {
if (FXJSE_Value_IsArray(argsValue[i])) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue);
- FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectPropByIdx(argsValue[i], 1, propertyValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- for (FX_INT32 j = 2; j < iLength; j++) {
+ for (int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argsValue[i], j, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, resultValues[index]);
index++;
@@ -6472,7 +6472,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, } else {
CFX_ByteString propertyString;
FXJSE_Value_ToUTF8String(propertyValue, propertyString);
- for (FX_INT32 j = 2; j < iLength; j++) {
+ for (int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argsValue[i], j, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyString, resultValues[index]);
index++;
@@ -6489,7 +6489,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, index++;
}
}
- for (FX_INT32 i = iStart; i < argc; i++) {
+ for (int32_t i = iStart; i < argc; i++) {
FXJSE_Value_Release(argsValue[i]);
}
FX_Free(argsValue);
@@ -6513,7 +6513,7 @@ FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJS }
return bSuccess;
}
-void CXFA_FM2JSContext::GenerateSomExpression(FX_BSTR szName, FX_INT32 iIndexFlags, FX_INT32 iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp)
+void CXFA_FM2JSContext::GenerateSomExpression(FX_BSTR szName, int32_t iIndexFlags, int32_t iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp)
{
if(bIsStar) {
szSomExp = szName + FX_BSTRC("[*]");
@@ -6548,17 +6548,17 @@ FX_BOOL CXFA_FM2JSContext::GetObjectByName(FXJSE_HOBJECT hThis, FXJSE_HVALUE acc IXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext();
XFA_RESOLVENODE_RS resoveNodeRS;
FX_DWORD dwFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent;
- FX_INT32 iRet = pScriptContext->ResolveObjects(pScriptContext->GetThisObject(), CFX_WideString::FromUTF8(szAccessorName.GetCStr(), szAccessorName.GetLength()), resoveNodeRS, dwFlags);
+ int32_t iRet = pScriptContext->ResolveObjects(pScriptContext->GetThisObject(), CFX_WideString::FromUTF8(szAccessorName.GetCStr(), szAccessorName.GetLength()), resoveNodeRS, dwFlags);
if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap(resoveNodeRS.nodes.GetAt(0)));
bFlags = TRUE;
}
return bFlags;
}
-FX_INT32 CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRefValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor , FX_BOOL bHasNoResolveName )
+int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRefValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor , FX_BOOL bHasNoResolveName )
{
CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp.GetCStr(), bsSomExp.GetLength());
- FX_INT32 iRet = -1;
+ int32_t iRet = -1;
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
CXFA_Document *pDoc = pContext->GetDocument();
if(!pDoc) {
@@ -6598,7 +6598,7 @@ FX_INT32 CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRe iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression, resoveNodeRS, dFlags);
return iRet;
}
-void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS &resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, FX_INT32 &iSize, FX_BOOL &bAttribute)
+void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS &resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, int32_t &iSize, FX_BOOL &bAttribute)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hRuntime = pContext->GetScriptRuntime();
@@ -6608,13 +6608,13 @@ void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLV bAttribute = FALSE;
iSize = resoveNodeRS.nodes.GetSize();
resultValues = FX_Alloc(FXJSE_HVALUE, iSize);
- for (FX_INT32 i = 0; i < iSize; i++) {
+ for (int32_t i = 0; i < iSize; i++) {
resultValues[i] = FXJSE_Value_Create(hRuntime);
FXJSE_Value_Set(resultValues[i], pContext->GetDocument()->GetScriptContext()->GetJSValueFromMap(resoveNodeRS.nodes.GetAt(i)));
}
} else {
CXFA_HVALUEArray objectProperties(hRuntime);
- FX_INT32 iRet = resoveNodeRS.GetAttributeResult(objectProperties);
+ int32_t iRet = resoveNodeRS.GetAttributeResult(objectProperties);
bAttribute = (iRet == 0);
if (bAttribute) {
if (FXJSE_Value_IsObject(hParentValue)) {
@@ -6626,18 +6626,18 @@ void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLV } else {
iSize = iRet;
resultValues = FX_Alloc(FXJSE_HVALUE, iSize);
- for (FX_INT32 i = 0; i < iSize; i++) {
+ for (int32_t i = 0; i < iSize; i++) {
resultValues[i] = FXJSE_Value_Create(hRuntime);
FXJSE_Value_Set(resultValues[i], objectProperties[i]);
}
}
}
}
-FX_INT32 CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue)
+int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue)
{
CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
if(FXJSE_Value_IsArray(hValue)) {
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(hruntime);
@@ -7170,7 +7170,7 @@ void CXFA_FM2JSContext::Release() {
delete this;
}
-void CXFA_FM2JSContext::ThrowScriptErrorMessage(FX_INT32 iStringID, ...)
+void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...)
{
IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider();
FXSYS_assert(pAppProvider);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h index 466050d662..923401b901 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h @@ -33,22 +33,22 @@ public: static void Time2Num (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void TimeFmt (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
- static FX_BOOL IsIsoDateFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iStyle, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay);
- static FX_BOOL IsIsoTimeFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMilliSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute);
- static FX_BOOL IsIsoDateTimeFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMillionSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute);
+ static FX_BOOL IsIsoDateFormat (FX_LPCSTR pData, int32_t iLength, int32_t &iStyle, int32_t &iYear, int32_t &iMonth, int32_t &iDay);
+ static FX_BOOL IsIsoTimeFormat (FX_LPCSTR pData, int32_t iLength, int32_t &iHour, int32_t &iMinute, int32_t &iSecond, int32_t &iMilliSecond, int32_t &iZoneHour, int32_t &iZoneMinute);
+ static FX_BOOL IsIsoDateTimeFormat (FX_LPCSTR pData, int32_t iLength, int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t &iHour, int32_t &iMinute, int32_t &iSecond, int32_t &iMillionSecond, int32_t &iZoneHour, int32_t &iZoneMinute);
static FX_BOOL Local2IsoDate (FXJSE_HOBJECT hThis, FX_BSTR szDate, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strIsoDate);
static FX_BOOL Local2IsoTime (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strIsoTime);
static FX_BOOL IsoDate2Local (FXJSE_HOBJECT hThis, FX_BSTR szDate, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strLocalDate);
static FX_BOOL IsoTime2Local (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strLocalTime);
static FX_BOOL GetGMTTime (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strGMTTime);
- static FX_INT32 DateString2Num (FX_BSTR szDateString);
- static void GetLocalDateFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard);
- static void GetLocalTimeFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard);
- static void GetStandardDateFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat);
- static void GetStandardTimeFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat);
+ static int32_t DateString2Num (FX_BSTR szDateString);
+ static void GetLocalDateFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard);
+ static void GetLocalTimeFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard);
+ static void GetStandardDateFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat);
+ static void GetStandardTimeFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat);
- static void Num2AllTime (FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime);
- static void GetLocalTimeZone (FX_INT32 &iHour, FX_INT32 &iMin, FX_INT32 &iSec);
+ static void Num2AllTime (FXJSE_HOBJECT hThis, int32_t iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime);
+ static void GetLocalTimeZone (int32_t &iHour, int32_t &iMin, int32_t &iSec);
static void Apr (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void CTerm (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
@@ -81,8 +81,8 @@ public: static void EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResultBuf);
static void EncodeHTML (FX_BSTR szHTMLString, CFX_ByteTextBuf &szResultBuf);
static void EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResultBuf);
- static FX_BOOL HTMLSTR2Code (FX_WSTR pData, FX_UINT32 &iCode);
- static FX_BOOL HTMLCode2STR (FX_UINT32 iCode, CFX_WideString &wsHTMLReserve);
+ static FX_BOOL HTMLSTR2Code (FX_WSTR pData, uint32_t &iCode);
+ static FX_BOOL HTMLCode2STR (uint32_t iCode, CFX_WideString &wsHTMLReserve);
static void Format (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void Left (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void Len (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
@@ -100,7 +100,7 @@ public: static void Upper (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void WordNum (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void TrillionUS (FX_BSTR szData, CFX_ByteTextBuf &strBuf);
- static void WordUS (FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf &strBuf);
+ static void WordUS (FX_BSTR szData, int32_t iStyle, CFX_ByteTextBuf &strBuf);
static void Get (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void Post (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
@@ -132,19 +132,19 @@ public: static void fm_var_filter (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
static void concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
- static FX_INT32 hvalue_get_array_length (FXJSE_HOBJECT hThis, FXJSE_HVALUE arg);
+ static int32_t hvalue_get_array_length (FXJSE_HOBJECT hThis, FXJSE_HVALUE arg);
static FX_BOOL simpleValueCompare (FXJSE_HOBJECT hThis, FXJSE_HVALUE firstValue, FXJSE_HVALUE secondValue);
- static void unfoldArgs (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, FX_INT32 &iCount, FX_INT32 iStart = 0);
+ static void unfoldArgs (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, int32_t &iCount, int32_t iStart = 0);
static void GetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJSE_HVALUE hDefaultValue);
static FX_BOOL SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJSE_HVALUE hNewValue);
- static void GenerateSomExpression(FX_BSTR szName, FX_INT32 iIndexFlags, FX_INT32 iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp);
+ static void GenerateSomExpression(FX_BSTR szName, int32_t iIndexFlags, int32_t iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp);
static FX_BOOL GetObjectByName(FXJSE_HOBJECT hThis, FXJSE_HVALUE accessorValue, FX_BSTR szAccessorName);
- static FX_INT32 ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hParentValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor = TRUE, FX_BOOL bHasNoResolveName = FALSE);
- static void ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS& resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, FX_INT32 &iSize, FX_BOOL &bAttribute);
+ static int32_t ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hParentValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor = TRUE, FX_BOOL bHasNoResolveName = FALSE);
+ static void ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS& resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, int32_t &iSize, FX_BOOL &bAttribute);
- static FXJSE_HVALUE GetSimpleHValue (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FX_UINT32 index);
+ static FXJSE_HVALUE GetSimpleHValue (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, uint32_t index);
static FX_BOOL HValueIsNull (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
- static FX_INT32 HValueToInteger (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
+ static int32_t HValueToInteger (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
static FX_DOUBLE StringToDouble(FX_BSTR szStringVal);
static FX_FLOAT HValueToFloat (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
static FX_DOUBLE HValueToDouble (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
@@ -163,7 +163,7 @@ public: {
return m_pDocument;
}
- void ThrowScriptErrorMessage(FX_INT32 iStringID, ...);
+ void ThrowScriptErrorMessage(int32_t iStringID, ...);
private:
FXJSE_HRUNTIME m_hScriptRuntime;
FXJSE_CLASS m_fmClass;
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp b/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp index 5bc76c21e8..a3e127f3c6 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp @@ -23,7 +23,7 @@ CXFA_FMParse::~CXFA_FMParse() m_pScript = 0;
m_pToken = 0;
}
-FX_INT32 CXFA_FMParse::Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo)
+int32_t CXFA_FMParse::Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo)
{
m_pScript = wsFormcalc.GetPtr();
m_uLength = wsFormcalc.GetLength();
@@ -153,8 +153,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseFunction() if (m_pErrorInfo->message.IsEmpty()) {
e = FX_NEW CXFA_FMFunctionDefinition(line, 0, ident, pArguments, pExpressions);
} else {
- FX_INT32 size = 0;
- FX_INT32 index = 0;
+ int32_t size = 0;
+ int32_t index = 0;
if (pArguments) {
pArguments->RemoveAll();
delete pArguments;
@@ -622,8 +622,8 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi e = 0;
}
} else {
- FX_INT32 iSize = pArray->GetSize();
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ int32_t iSize = pArray->GetSize();
+ for (int32_t i = 0; i < iSize; ++i) {
CXFA_FMSimpleExpression *pTemp = (CXFA_FMSimpleExpression *)pArray->GetAt(i);
delete pTemp;
}
@@ -677,8 +677,8 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi e = 0;
}
} else {
- FX_INT32 iSize = pArray->GetSize();
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ int32_t iSize = pArray->GetSize();
+ for (int32_t i = 0; i < iSize; ++i) {
CXFA_FMSimpleExpression *pTemp = (CXFA_FMSimpleExpression *)pArray->GetAt(i);
delete pTemp;
}
@@ -882,8 +882,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseBlockExpression() if (m_pErrorInfo->message.IsEmpty()) {
pExp = FX_NEW CXFA_FMBlockExpression(line, expression);
} else {
- FX_INT32 size = expression->GetSize();
- FX_INT32 index = 0;
+ int32_t size = expression->GetSize();
+ int32_t index = 0;
while(index < size) {
e = (CXFA_FMExpression *)expression->GetAt(index);
delete e;
@@ -1033,7 +1033,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForExpression() CFX_WideString ws_TempString = m_pToken->m_wstring;
Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), FX_LPCWSTR(ws_TempString));
}
- FX_INT32 iDirection = 0;
+ int32_t iDirection = 0;
if (m_pToken->m_type == TOKupto) {
iDirection = 1;
} else if (m_pToken->m_type == TOKdownto) {
@@ -1112,8 +1112,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseForeachExpression() } else {
if (pAccessors) {
CXFA_FMSimpleExpression *s = 0;
- FX_INT32 size = pAccessors->GetSize();
- FX_INT32 index = 0;
+ int32_t size = pAccessors->GetSize();
+ int32_t index = 0;
while(index < size) {
s = (CXFA_FMSimpleExpression *)pAccessors->GetAt(index);
delete s;
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fmparse.h b/xfa/src/fxfa/src/fm2js/xfa_fmparse.h index d3adca7075..496a3dfa6e 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fmparse.h +++ b/xfa/src/fxfa/src/fm2js/xfa_fmparse.h @@ -11,7 +11,7 @@ class CXFA_FMParse public:
CXFA_FMParse();
~CXFA_FMParse();
- FX_INT32 Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo);
+ int32_t Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo);
void NextToken();
void Check(XFA_FM_TOKEN op);
void Error(FX_DWORD lineNum, XFA_FM_ERRMSG msg, ...);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp index 29594c760b..7ce3355861 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp @@ -16,7 +16,7 @@ struct XFA_FMDChar { --p;
return p;
}
- static FX_UINT16 get(FX_LPCWSTR p)
+ static uint16_t get(FX_LPCWSTR p)
{
return *p;
}
@@ -50,7 +50,7 @@ struct XFA_FMDChar { }
static FX_BOOL isAvalid(FX_LPCWSTR p, FX_BOOL flag = 0);
static FX_BOOL string2number(FX_LPCWSTR s, FX_DOUBLE *pValue, FX_LPCWSTR &pEnd);
- static FX_BOOL isUnicodeAlpha(FX_UINT16 ch);
+ static FX_BOOL isUnicodeAlpha(uint16_t ch);
};
inline FX_BOOL XFA_FMDChar::isAvalid(FX_LPCWSTR p, FX_BOOL flag)
{
@@ -74,7 +74,7 @@ inline FX_BOOL XFA_FMDChar::string2number(FX_LPCWSTR s, FX_DOUBLE *pValue, FX_LP }
return 0;
}
-inline FX_BOOL XFA_FMDChar::isUnicodeAlpha(FX_UINT16 ch)
+inline FX_BOOL XFA_FMDChar::isUnicodeAlpha(uint16_t ch)
{
if (ch == 0 || ch == 0x0A || ch == 0x0D || ch == 0x09 || ch == 0x0B || ch == 0x0C || ch == 0x20 || ch == '.'
|| ch == ';' || ch == '"' || ch == '=' || ch == '<' || ch == '>' || ch == ',' || ch == '(' || ch == ')'
@@ -195,7 +195,7 @@ CXFA_FMToken *CXFA_FMLexer::NextToken() }
CXFA_FMToken * CXFA_FMLexer::Scan()
{
- FX_UINT16 ch = 0;
+ uint16_t ch = 0;
CXFA_FMToken * p = FX_NEW CXFA_FMToken(m_uCurrentLine);
if (!XFA_FMDChar::isAvalid(m_ptr)) {
ch = XFA_FMDChar::get(m_ptr);
@@ -444,7 +444,7 @@ FX_DWORD CXFA_FMLexer::Number(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd) FX_DWORD CXFA_FMLexer::String(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd)
{
FX_LPCWSTR pStart = p;
- FX_UINT16 ch = 0;
+ uint16_t ch = 0;
XFA_FMDChar::inc(p);
ch = XFA_FMDChar::get(p);
while (ch) {
@@ -482,7 +482,7 @@ NEXT: FX_DWORD CXFA_FMLexer::Identifiers(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd)
{
FX_LPCWSTR pStart = p;
- FX_UINT16 ch = 0;
+ uint16_t ch = 0;
ch = XFA_FMDChar::get(p);
XFA_FMDChar::inc(p);
if (!XFA_FMDChar::isAvalid(p)) {
@@ -536,10 +536,10 @@ void CXFA_FMLexer::Comment( FX_LPCWSTR p, FX_LPCWSTR &pEnd ) }
XFA_FM_TOKEN CXFA_FMLexer::IsKeyword(FX_WSTR str)
{
- FX_INT32 iLength = str.GetLength();
- FX_UINT32 uHash = FX_HashCode_String_GetW(str.GetPtr(), iLength, TRUE);
- FX_INT32 iStart = KEYWORD_START, iEnd = KEYWORD_END;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iLength = str.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(str.GetPtr(), iLength, TRUE);
+ int32_t iStart = KEYWORD_START, iEnd = KEYWORD_END;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_FMKeyword keyword;
do {
iMid = (iStart + iEnd) / 2;
diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.h b/xfa/src/fxfa/src/fm2js/xfa_lexer.h index 3047a5028d..709307046b 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.h +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.h @@ -23,7 +23,7 @@ enum XFA_FM_TOKEN { };
struct XFA_FMKeyword {
XFA_FM_TOKEN m_type;
- FX_UINT32 m_uHash;
+ uint32_t m_uHash;
FX_LPCWSTR m_keword;
};
FX_LPCWSTR XFA_FM_KeywordToString(XFA_FM_TOKEN op);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_program.cpp b/xfa/src/fxfa/src/fm2js/xfa_program.cpp index d291e7a614..51faea0e91 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_program.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_program.cpp @@ -16,11 +16,11 @@ CXFA_FMProgram::~CXFA_FMProgram() m_globalFunction = 0;
}
}
-FX_INT32 CXFA_FMProgram::Init(FX_WSTR wsFormcalc)
+int32_t CXFA_FMProgram::Init(FX_WSTR wsFormcalc)
{
return m_parse.Init(wsFormcalc, &m_pErrorInfo);
}
-FX_INT32 CXFA_FMProgram::ParseProgram()
+int32_t CXFA_FMProgram::ParseProgram()
{
CFX_PtrArray * expressions = 0;
m_parse.NextToken();
@@ -30,7 +30,7 @@ FX_INT32 CXFA_FMProgram::ParseProgram() expressions = m_parse.ParseTopExpression();
if (!m_pErrorInfo.message.IsEmpty()) {
CXFA_FMExpression *e = 0;
- for (FX_INT32 u = 0; u < expressions->GetSize(); ++u) {
+ for (int32_t u = 0; u < expressions->GetSize(); ++u) {
e = (CXFA_FMExpression *)expressions->GetAt(u);
if (e) {
delete e;
@@ -42,7 +42,7 @@ FX_INT32 CXFA_FMProgram::ParseProgram() m_globalFunction = FX_NEW CXFA_FMFunctionDefinition(1, 1, FX_WSTRC(L""), 0, expressions);
return 0;
}
-FX_INT32 CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf &wsJavaScript)
+int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf &wsJavaScript)
{
m_globalFunction->ToJavaScript(wsJavaScript);
wsJavaScript.AppendChar(0);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_program.h b/xfa/src/fxfa/src/fm2js/xfa_program.h index 157d1e1faa..a7453d4d1d 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_program.h +++ b/xfa/src/fxfa/src/fm2js/xfa_program.h @@ -11,9 +11,9 @@ class CXFA_FMProgram public:
CXFA_FMProgram();
~CXFA_FMProgram();
- FX_INT32 Init(FX_WSTR wsFormcalc);
- FX_INT32 ParseProgram();
- FX_INT32 TranslateProgram(CFX_WideTextBuf &wsJavaScript);
+ int32_t Init(FX_WSTR wsFormcalc);
+ int32_t ParseProgram();
+ int32_t TranslateProgram(CFX_WideTextBuf &wsJavaScript);
CXFA_FMErrorInfo& GetError()
{
return m_pErrorInfo;
diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp index dc4f24449b..d52ab7c076 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp @@ -168,7 +168,7 @@ void CXFA_FMStringExpression::ToJavaScript(CFX_WideTextBuf& javascript) if (tempStr.GetLength() > 2) {
javascript.AppendChar(L'\"');
FX_WCHAR oneChar;
- for (FX_INT16 i = 1; i < tempStr.GetLength() - 1; i++) {
+ for (int16_t i = 1; i < tempStr.GetLength() - 1; i++) {
oneChar = tempStr[i];
switch (oneChar) {
case L'\"': {
@@ -489,8 +489,8 @@ CXFA_FMCallExpression::CXFA_FMCallExpression(FX_DWORD line, CXFA_FMSimpleExpress CXFA_FMCallExpression::~CXFA_FMCallExpression()
{
if (m_pArguments) {
- FX_INT32 argc = m_pArguments->GetSize();
- FX_INT32 index = 0;
+ int32_t argc = m_pArguments->GetSize();
+ int32_t index = 0;
CXFA_FMSimpleExpression *e = 0;
while (index < argc) {
e = (CXFA_FMSimpleExpression *)m_pArguments->GetAt(index);
@@ -504,11 +504,11 @@ CXFA_FMCallExpression::~CXFA_FMCallExpression() }
FX_BOOL CXFA_FMCallExpression::IsBuildInFunc(CFX_WideTextBuf& funcName)
{
- FX_INT32 iLength = funcName.GetLength();
- FX_UINT32 uHash = FX_HashCode_String_GetW(funcName.GetBuffer(), iLength, TRUE);
+ int32_t iLength = funcName.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(funcName.GetBuffer(), iLength, TRUE);
XFA_FMBuildInFunc buildinfunction;
- FX_INT32 iStart = 0, iEnd = (sizeof(buildInFuncs) / sizeof(buildInFuncs[0])) - 1;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0, iEnd = (sizeof(buildInFuncs) / sizeof(buildInFuncs[0])) - 1;
+ int32_t iMid = (iStart + iEnd) / 2;
do {
iMid = (iStart + iEnd) / 2;
buildinfunction = buildInFuncs[iMid];
@@ -526,12 +526,12 @@ FX_BOOL CXFA_FMCallExpression::IsBuildInFunc(CFX_WideTextBuf& funcName) }
FX_DWORD CXFA_FMCallExpression::IsSomMethodWithObjPara(FX_WSTR methodName)
{
- FX_INT32 iLength = methodName.GetLength();
- FX_UINT32 uHash = FX_HashCode_String_GetW(methodName.GetPtr(), iLength);
+ int32_t iLength = methodName.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(methodName.GetPtr(), iLength);
XFA_FMSOMMethod somMethodWithObjPara;
FX_DWORD parameters = 0x00;
- FX_INT32 iStart = 0, iEnd = (sizeof(gs_FMSomMethods) / sizeof(gs_FMSomMethods[0])) - 1;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0, iEnd = (sizeof(gs_FMSomMethods) / sizeof(gs_FMSomMethods[0])) - 1;
+ int32_t iMid = (iStart + iEnd) / 2;
do {
iMid = (iStart + iEnd) / 2;
somMethodWithObjPara = gs_FMSomMethods[iMid];
@@ -554,8 +554,8 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) javascript << funcName;
javascript << FX_WSTRC(L"(");
if (m_pArguments) {
- FX_INT32 argc = m_pArguments->GetSize();
- FX_INT32 index = 0;
+ int32_t argc = m_pArguments->GetSize();
+ int32_t index = 0;
FX_DWORD methodPara = IsSomMethodWithObjPara(funcName.GetWideString());
if (methodPara > 0) {
CXFA_FMSimpleExpression *e = 0;
@@ -623,8 +623,8 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) }
javascript << FX_WSTRC(L"catch(accessExceptions)\n{\nreturn 0;\n}\n}\n).call(this)\n");
} else if (m_pArguments) {
- FX_INT32 argc = m_pArguments->GetSize();
- FX_INT32 index = 0;
+ int32_t argc = m_pArguments->GetSize();
+ int32_t index = 0;
CXFA_FMSimpleExpression *e = 0;
while (index < argc) {
e = (CXFA_FMSimpleExpression *)m_pArguments->GetAt(index);
diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h index b492b80e04..7d9f9d5f79 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h +++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h @@ -35,11 +35,11 @@ enum XFA_FM_SimpleExpressionType { };
CFX_WideStringC XFA_FM_EXPTypeToString(XFA_FM_SimpleExpressionType simpleExpType);
struct XFA_FMBuildInFunc {
- FX_UINT32 m_uHash;
+ uint32_t m_uHash;
FX_LPCWSTR m_buildinfunc;
};
struct XFA_FMSOMMethod {
- FX_UINT32 m_uHash;
+ uint32_t m_uHash;
FX_LPCWSTR m_wsSomMethodName;
FX_DWORD m_dParameters;
};
diff --git a/xfa/src/fxfa/src/parser/xfa_basic_data.cpp b/xfa/src/fxfa/src/parser/xfa_basic_data.cpp index fa452b57fb..c061b80a34 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_data.cpp +++ b/xfa/src/fxfa/src/parser/xfa_basic_data.cpp @@ -291,7 +291,7 @@ extern const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[] = { {0xfefc4885, L"urlencoded", XFA_ATTRIBUTEENUM_Urlencoded},
{0xff795ad2, L"lowered", XFA_ATTRIBUTEENUM_Lowered},
};
-extern const FX_INT32 g_iXFAEnumCount = sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO);
+extern const int32_t g_iXFAEnumCount = sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO);
static const CXFA_Measurement g_XFAMeasurementData[] = {
CXFA_Measurement(0, XFA_UNIT_In),
CXFA_Measurement(0, XFA_UNIT_Pt),
@@ -548,7 +548,7 @@ extern const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0xf889e747, L"xdpContent", XFA_ATTRIBUTE_XdpContent, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (FX_LPVOID)NULL},
{0xfea53ec6, L"decipherOnly", XFA_ATTRIBUTE_DecipherOnly, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (FX_LPVOID)NULL},
};
-extern const FX_INT32 g_iXFAAttributeCount = sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
+extern const int32_t g_iXFAAttributeCount = sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = {
{XFA_ELEMENT_SubformSet, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Ordered},
{XFA_ELEMENT_NumberPattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Numeric},
@@ -599,7 +599,7 @@ extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_ELEMENT_Occur, XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)1},
{XFA_ELEMENT_NumberSymbol, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Decimal},
};
-extern const FX_INT32 g_iXFANotsureCount = sizeof(g_XFANotsureAttributes) / sizeof(XFA_NOTSUREATTRIBUTE);
+extern const int32_t g_iXFANotsureCount = sizeof(g_XFANotsureAttributes) / sizeof(XFA_NOTSUREATTRIBUTE);
extern const XFA_ELEMENTINFO g_XFAElementData[] = {
{0x23ee3, L"ps", XFA_ELEMENT_Ps, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0x25363, L"to", XFA_ELEMENT_To, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
@@ -914,7 +914,7 @@ extern const XFA_ELEMENTINFO g_XFAElementData[] = { {0xfcbd606c, L"tagged", XFA_ELEMENT_Tagged, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xff063802, L"items", XFA_ELEMENT_Items, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
};
-extern const FX_INT32 g_iXFAElementCount = sizeof(g_XFAElementData) / sizeof(XFA_ELEMENTINFO);
+extern const int32_t g_iXFAElementCount = sizeof(g_XFAElementData) / sizeof(XFA_ELEMENTINFO);
extern const XFA_ELEMENTHIERARCHY g_XFAElementPropertyIndex[] = {
{0, 8}, {8, 0}, {8, 14}, {22, 0}, {22, 0}, {22, 6}, {28, 0}, {28, 0}, {28, 1}, {29, 3}, {32, 0}, {32, 0}, {32, 0}, {32, 3}, {35, 1}, {36, 0}, {36, 0}, {36, 2}, {38, 0}, {38, 0},
{38, 0}, {38, 4}, {42, 0}, {42, 0}, {42, 1}, {43, 0}, {43, 8}, {51, 19}, {70, 0}, {70, 0}, {70, 2}, {72, 1}, {73, 0}, {73, 2}, {75, 4}, {79, 1}, {80, 1}, {81, 0}, {81, 0}, {81, 3},
@@ -1040,7 +1040,7 @@ extern const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[] = { {1037, 2}, {1039, 0}, {1039, 4}, {1043, 2}, {1045, 0}, {1045, 2}, {1047, 3}, {1050, 2}, {1052, 5}, {1057, 2}, {1059, 2}, {1061, 4}, {1065, 3}, {1068, 0}, {1068, 4}, {1072, 2}, {1074, 2}, {1076, 3}, {1079, 4}, {1083, 8},
{1091, 5}, {1096, 0}, {1096, 4}, {1100, 6}, {1106, 2}, {1108, 1}, {1109, 2}, {1111, 2}, {1113, 2}, {1115, 1}, {1116, 2}, {1118, 7},
};
-extern const FX_BYTE g_XFAElementAttributeData[] = {
+extern const uint8_t g_XFAElementAttributeData[] = {
XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Max, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_EofAction, XFA_ATTRIBUTE_CursorType, XFA_ATTRIBUTE_LockType, XFA_ATTRIBUTE_BofAction, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_CursorLocation, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTE_Relevant, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Id,
@@ -1172,7 +1172,7 @@ extern const XFA_PACKETINFO g_XFAPacketData[] = { {0xcd309ff4, L"form", XFA_XDPPACKET_Form, L"http://www.xfa.org/schema/xfa-form/", XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xe14c801c, L"connectionSet", XFA_XDPPACKET_ConnectionSet, L"http://www.xfa.org/schema/xfa-connection-set/", XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
};
-extern const FX_INT32 g_iXFAPacketCount = sizeof(g_XFAPacketData) / sizeof(XFA_PACKETINFO);
+extern const int32_t g_iXFAPacketCount = sizeof(g_XFAPacketData) / sizeof(XFA_PACKETINFO);
extern const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[] = {
{0, 0, 0, 2, 316}, {0, 0, 2, 2, 316}, {0, 0, 4, 2, 316}, {0, 0, 6, 8, 316}, {0, 0, 14, 4, 316}, {0, 0, 18, 5, 317}, {0, 0, 23, 2, 316}, {0, 0, 25, 1, 316}, {0, 0, 26, 12, 316}, {0, 0, 38, 2, 316}, {0, 0, 40, 1, 316}, {0, 0, 41, 3, 316}, {0, 0, 44, 2, 316}, {0, 0, 46, 6, 316}, {0, 0, 52, 0, 316}, {0, 0, 52, 2, 319}, {0, 0, 54, 2, 316}, {0, 0, 56, 6, 316}, {0, 0, 62, 0, 316}, {0, 0, 62, 0, 316},
{0, 0, 62, 2, 316}, {0, 0, 64, 2, 316}, {0, 0, 66, 6, 316}, {0, 0, 72, 4, 316}, {0, 0, 76, 7, 316}, {0, 0, 83, 2, 320}, {0, 0, 85, 3, 316}, {0, 0, 88, 3, 316}, {0, 0, 91, 2, 320}, {0, 0, 93, 6, 320}, {0, 0, 99, 4, 316}, {0, 0, 103, 2, 316}, {0, 0, 105, 3, 319}, {0, 0, 108, 4, 316}, {0, 0, 112, 3, 316}, {0, 0, 115, 2, 316}, {0, 0, 117, 6, 316}, {0, 0, 123, 12, 316}, {0, 0, 135, 2, 316}, {0, 0, 137, 5, 316},
@@ -1240,7 +1240,7 @@ extern const XFA_METHODINFO g_SomMethodData[] = { {0xe006a76b, L"assignNode", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_AssignNode}, {0x7303fcea, L"getDelta", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDelta}, {0xe7742c9d, L"getDeltas", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDeltas},
{0x30ff6aad, L"clearErrorList", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_ClearErrorList}, {0x712c6afa, L"createNode", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_CreateNode}, {0x83a6411d, L"isCompatibleNS", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_IsCompatibleNS},
};
-extern const FX_INT32 g_iSomMethodCount = sizeof(g_SomMethodData) / sizeof(XFA_METHODINFO);
+extern const int32_t g_iSomMethodCount = sizeof(g_SomMethodData) / sizeof(XFA_METHODINFO);
extern const _XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[] = {
{0xbe52dfbf, L"desc", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic}, {0xf6b47749, L"lock", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL, XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic}, {0xbe52dfbf, L"desc", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL, XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic}, {0xc0811ed, L"use", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic}, {0xbc254332, L"usehref", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
@@ -1603,4 +1603,4 @@ extern const _XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[] = { {0x97c1c65, L"context", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_Context, -1, XFA_SCRIPT_Object}, {0x58be2870, L"aliasNode", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_AliasNode, -1, XFA_SCRIPT_Object}, {0xa52682bd, L"{default}", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1, XFA_SCRIPT_Basic},
};
-extern const FX_INT32 g_iSomAttributeCount = sizeof(g_SomAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
+extern const int32_t g_iSomAttributeCount = sizeof(g_SomAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
diff --git a/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp b/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp index d97ec44fc8..618b7a2945 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp @@ -18,36 +18,36 @@ #include "xfa_debug_parser.h"
#include "xfa_basic_imp.h"
extern const XFA_PACKETINFO g_XFAPacketData[];
-extern const FX_INT32 g_iXFAPacketCount;
+extern const int32_t g_iXFAPacketCount;
extern const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[];
-extern const FX_INT32 g_iXFAEnumCount;
+extern const int32_t g_iXFAEnumCount;
extern const XFA_ATTRIBUTEINFO g_XFAAttributeData[];
-extern const FX_INT32 g_iXFAAttributeCount;
+extern const int32_t g_iXFAAttributeCount;
extern const XFA_ELEMENTINFO g_XFAElementData[];
-extern const FX_INT32 g_iXFAElementCount;
+extern const int32_t g_iXFAElementCount;
extern const XFA_ELEMENTHIERARCHY g_XFAElementChildrenIndex[];
extern const FX_WORD g_XFAElementChildrenData[];
extern const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[];
-extern const FX_BYTE g_XFAElementAttributeData[];
+extern const uint8_t g_XFAElementAttributeData[];
extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[];
-extern const FX_INT32 g_iXFANotsureCount;
+extern const int32_t g_iXFANotsureCount;
extern const XFA_ELEMENTHIERARCHY g_XFAElementPropertyIndex[];
extern const XFA_PROPERTY g_XFAElementPropertyData[];
extern const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[];
extern const XFA_METHODINFO g_SomMethodData[];
-extern const FX_INT32 g_iSomMethodCount;
+extern const int32_t g_iSomMethodCount;
extern const XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[];
-extern const FX_INT32 g_iSomAttributeCount;
+extern const int32_t g_iSomAttributeCount;
XFA_LPCPACKETINFO XFA_GetPacketByName(FX_WSTR wsName)
{
- FX_INT32 iLength = wsName.GetLength();
+ int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
- FX_INT32 iStart = 0, iEnd = g_iXFAPacketCount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
+ int32_t iStart = 0, iEnd = g_iXFAPacketCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCPACKETINFO pInfo = g_XFAPacketData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -61,9 +61,9 @@ XFA_LPCPACKETINFO XFA_GetPacketByName(FX_WSTR wsName) }
XFA_LPCPACKETINFO XFA_GetPacketByID(FX_DWORD dwPacket)
{
- FX_INT32 iStart = 0, iEnd = g_iXFAPacketCount - 1;
+ int32_t iStart = 0, iEnd = g_iXFAPacketCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FX_DWORD dwFind = (g_XFAPacketData + iMid)->eName;
if (dwPacket == dwFind) {
return g_XFAPacketData + iMid;
@@ -77,14 +77,14 @@ XFA_LPCPACKETINFO XFA_GetPacketByID(FX_DWORD dwPacket) }
XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByName(FX_WSTR wsName)
{
- FX_INT32 iLength = wsName.GetLength();
+ int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
- FX_INT32 iStart = 0, iEnd = g_iXFAEnumCount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
+ int32_t iStart = 0, iEnd = g_iXFAEnumCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCATTRIBUTEENUMINFO pInfo = g_XFAEnumData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -100,20 +100,20 @@ XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName) {
return g_XFAEnumData + eName;
}
-FX_INT32 XFA_GetAttributeCount()
+int32_t XFA_GetAttributeCount()
{
return g_iXFAAttributeCount;
}
XFA_LPCATTRIBUTEINFO XFA_GetAttributeByName(FX_WSTR wsName)
{
- FX_INT32 iLength = wsName.GetLength();
+ int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
- FX_INT32 iStart = 0, iEnd = g_iXFAAttributeCount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
+ int32_t iStart = 0, iEnd = g_iXFAAttributeCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCATTRIBUTEINFO pInfo = g_XFAAttributeData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -154,7 +154,7 @@ XFA_ATTRIBUTEENUM XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT eElement, XFA_AT {
FX_LPVOID pValue;
if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Enum, dwPacket)) {
- return (XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue;
+ return (XFA_ATTRIBUTEENUM)(uintptr_t)pValue;
}
return XFA_ATTRIBUTEENUM_Unknown;
}
@@ -170,15 +170,15 @@ FX_BOOL XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT eElement, XFA_ATTRIBUTE {
FX_LPVOID pValue;
if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Boolean, dwPacket)) {
- return (FX_BOOL)(FX_UINTPTR)pValue;
+ return (FX_BOOL)(uintptr_t)pValue;
}
return FALSE;
}
-FX_INT32 XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket)
+int32_t XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket)
{
FX_LPVOID pValue;
if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Integer, dwPacket)) {
- return (FX_INT32)(FX_UINTPTR)pValue;
+ return (int32_t)(uintptr_t)pValue;
}
return 0;
}
@@ -190,20 +190,20 @@ CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, XFA_ }
return CXFA_Measurement();
}
-FX_INT32 XFA_GetElementCount()
+int32_t XFA_GetElementCount()
{
return g_iXFAElementCount;
}
XFA_LPCELEMENTINFO XFA_GetElementByName(FX_WSTR wsName)
{
- FX_INT32 iLength = wsName.GetLength();
+ int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
- FX_INT32 iStart = 0, iEnd = g_iXFAElementCount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength);
+ int32_t iStart = 0, iEnd = g_iXFAElementCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCELEMENTINFO pInfo = g_XFAElementData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -219,7 +219,7 @@ XFA_LPCELEMENTINFO XFA_GetElementByID(XFA_ELEMENT eName) {
return (eName < g_iXFAElementCount) ? (g_XFAElementData + eName) : NULL;
}
-FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, FX_INT32 &iCount)
+FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t &iCount)
{
if (eElement >= g_iXFAElementCount) {
return NULL;
@@ -228,7 +228,7 @@ FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, FX_INT32 &iCount) iCount = pElement->wCount;
return g_XFAElementChildrenData + pElement->wStart;
}
-FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, FX_INT32 &iCount)
+FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t &iCount)
{
if (eElement >= g_iXFAElementCount) {
return NULL;
@@ -239,13 +239,13 @@ FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, FX_INT32 &iCount) }
XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
FX_LPCBYTE pAttr = XFA_GetElementAttributes(eElement, iCount);
if (pAttr == NULL || iCount < 1) {
return NULL;
}
- CFX_DSPATemplate<FX_BYTE> search;
- FX_INT32 index = search.Lookup(eAttribute, pAttr, iCount);
+ CFX_DSPATemplate<uint8_t> search;
+ int32_t index = search.Lookup(eAttribute, pAttr, iCount);
if (index < 0) {
return NULL;
}
@@ -258,13 +258,13 @@ XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, XFA_ATTRIBU }
XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChild, FX_DWORD dwPacket)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
FX_LPCWORD pChild = XFA_GetElementChildren(eElement, iCount);
if (pChild == NULL || iCount < 1) {
return NULL;
}
CFX_DSPATemplate<FX_WORD> search;
- FX_INT32 index = search.Lookup(eChild, pChild, iCount);
+ int32_t index = search.Lookup(eChild, pChild, iCount);
if (index < 0) {
return NULL;
}
@@ -275,7 +275,7 @@ XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChil }
return (dwPacket & pInfo->dwPackets) ? pInfo : NULL;
}
-XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, FX_INT32 &iCount)
+XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, int32_t &iCount)
{
if (eElement >= g_iXFAElementCount) {
return NULL;
@@ -286,12 +286,12 @@ XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, FX_INT32 &iCount) }
XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eProperty, FX_DWORD dwPacket)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
XFA_LPCPROPERTY pProperty = XFA_GetElementProperties(eElement, iCount);
if (pProperty == NULL || iCount < 1) {
return NULL;
}
- FX_INT32 iStart = 0, iEnd = iCount - 1, iMid;
+ int32_t iStart = 0, iEnd = iCount - 1, iMid;
do {
iMid = (iStart + iEnd) / 2;
XFA_ELEMENT eName = (XFA_ELEMENT)pProperty[iMid].eName;
@@ -315,9 +315,9 @@ XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eProp }
XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, XFA_ATTRIBUTETYPE eType)
{
- FX_INT32 iStart = 0, iEnd = g_iXFANotsureCount - 1;
+ int32_t iStart = 0, iEnd = g_iXFANotsureCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCNOTSUREATTRIBUTE pAttr = g_XFANotsureAttributes + iMid;
if (eElement == pAttr->eElement) {
if (pAttr->eAttribute == eAttribute) {
@@ -326,7 +326,7 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB }
return NULL;
} else {
- FX_INT32 iBefore = iMid - 1;
+ int32_t iBefore = iMid - 1;
if(iBefore >= 0) {
pAttr = g_XFANotsureAttributes + iBefore;
while(eElement == pAttr->eElement) {
@@ -343,7 +343,7 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB pAttr = g_XFANotsureAttributes + iBefore;
}
}
- FX_INT32 iAfter = iMid + 1;
+ int32_t iAfter = iMid + 1;
if(iAfter <= g_iXFANotsureCount - 1) {
pAttr = g_XFANotsureAttributes + iAfter;
while(eElement == pAttr->eElement) {
@@ -370,28 +370,28 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB } while (iStart <= iEnd);
return NULL;
}
-FX_INT32 XFA_GetMethodCount()
+int32_t XFA_GetMethodCount()
{
return g_iSomMethodCount;
}
XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, FX_WSTR wsMethodName)
{
- FX_INT32 iLength = wsMethodName.GetLength();
+ int32_t iLength = wsMethodName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_INT32 iElementIndex = eElement;
+ int32_t iElementIndex = eElement;
while(iElementIndex != -1) {
XFA_LPCSCRIPTHIERARCHY scriptIndex = g_XFAScriptIndex + iElementIndex;
- FX_INT32 icount = scriptIndex->wMethodCount;
+ int32_t icount = scriptIndex->wMethodCount;
if(icount == 0) {
iElementIndex = scriptIndex->wParentIndex;
continue;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsMethodName.GetPtr(), iLength);
- FX_INT32 iStart = scriptIndex->wMethodStart, iEnd = iStart + icount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsMethodName.GetPtr(), iLength);
+ int32_t iStart = scriptIndex->wMethodStart, iEnd = iStart + icount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCMETHODINFO pInfo = g_SomMethodData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -407,22 +407,22 @@ XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, FX_WSTR wsMethodName }
XFA_LPCSCRIPTATTRIBUTEINFO XFA_GetScriptAttributeByName(XFA_ELEMENT eElement, FX_WSTR wsAttributeName)
{
- FX_INT32 iLength = wsAttributeName.GetLength();
+ int32_t iLength = wsAttributeName.GetLength();
if (iLength == 0) {
return NULL;
}
- FX_INT32 iElementIndex = eElement;
+ int32_t iElementIndex = eElement;
while(iElementIndex != -1) {
XFA_LPCSCRIPTHIERARCHY scriptIndex = g_XFAScriptIndex + iElementIndex;
- FX_INT32 icount = scriptIndex->wAttributeCount;
+ int32_t icount = scriptIndex->wAttributeCount;
if(icount == 0) {
iElementIndex = scriptIndex->wParentIndex;
continue;
}
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsAttributeName.GetPtr(), iLength);
- FX_INT32 iStart = scriptIndex->wAttributeStart, iEnd = iStart + icount - 1;
+ uint32_t uHash = FX_HashCode_String_GetW(wsAttributeName.GetPtr(), iLength);
+ int32_t iStart = scriptIndex->wAttributeStart, iEnd = iStart + icount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCSCRIPTATTRIBUTEINFO pInfo = g_SomAttributeData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
@@ -443,8 +443,8 @@ void CXFA_Measurement::Set(FX_WSTR wsMeasure) m_eUnit = XFA_UNIT_Unknown;
return;
}
- FX_INT32 iUsedLen = 0;
- FX_INT32 iOffset = (wsMeasure.GetAt(0) == L'=') ? 1 : 0;
+ int32_t iUsedLen = 0;
+ int32_t iOffset = (wsMeasure.GetAt(0) == L'=') ? 1 : 0;
FX_FLOAT fValue = FX_wcstof(wsMeasure.GetPtr() + iOffset, wsMeasure.GetLength() - iOffset, &iUsedLen);
XFA_UNIT eUnit = GetUnit(wsMeasure.Mid(iOffset + iUsedLen));
Set(fValue, eUnit);
@@ -581,11 +581,11 @@ FX_DWORD CXFA_WideTextRead::GetAccessModes() const {
return FX_STREAMACCESS_Read | FX_STREAMACCESS_Text;
}
-FX_INT32 CXFA_WideTextRead::GetLength() const
+int32_t CXFA_WideTextRead::GetLength() const
{
return m_wsBuffer.GetLength() * sizeof(FX_WCHAR);
}
-FX_INT32 CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
switch (eSeek) {
case FX_STREAMSEEK_Begin:
@@ -606,7 +606,7 @@ FX_INT32 CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) }
return GetPosition();
}
-FX_INT32 CXFA_WideTextRead::GetPosition()
+int32_t CXFA_WideTextRead::GetPosition()
{
return m_iPosition * sizeof(FX_WCHAR);
}
@@ -614,7 +614,7 @@ FX_BOOL CXFA_WideTextRead::IsEOF() const {
return m_iPosition >= m_wsBuffer.GetLength();
}
-FX_INT32 CXFA_WideTextRead::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize )
+int32_t CXFA_WideTextRead::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize )
{
if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition) {
iMaxLength = m_wsBuffer.GetLength() - m_iPosition;
diff --git a/xfa/src/fxfa/src/parser/xfa_basic_imp.h b/xfa/src/fxfa/src/parser/xfa_basic_imp.h index 71bcbb6167..cbffe4e635 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_basic_imp.h @@ -22,31 +22,31 @@ public: virtual IFX_Stream* Retain();
virtual FX_DWORD GetAccessModes() const;
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return 0;
}
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const
+ virtual int32_t GetBOM(uint8_t bom[4]) const
{
return 0;
}
@@ -56,7 +56,7 @@ public: virtual void Lock() {}
virtual void Unlock() {}
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength)
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)
{
return NULL;
}
@@ -67,7 +67,7 @@ public: }
protected:
CFX_WideString m_wsBuffer;
- FX_INT32 m_iPosition;
- FX_INT32 m_iRefCount;
+ int32_t m_iPosition;
+ int32_t m_iRefCount;
};
#endif
diff --git a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp index f496e484ce..4e9e8eda30 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp @@ -21,7 +21,7 @@ #include "xfa_document_datadescription_imp.h"
#include "xfa_document_datamerger_imp.h"
#include "xfa_document_layout_imp.h"
-static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit)
+static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, int32_t& iMin, int32_t& iMax, int32_t& iInit)
{
if(!pOccurNode) {
return FALSE;
@@ -134,11 +134,11 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pDa if (pWidgetData->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) {
CFX_WideStringArray wsSelTextArray;
pWidgetData->GetSelectedItemsValue(wsSelTextArray);
- FX_INT32 iSize = wsSelTextArray.GetSize();
+ int32_t iSize = wsSelTextArray.GetSize();
if (iSize >= 1) {
CXFA_Node *pValue = NULL;
IFDE_XMLNode *pValueXMLNode = NULL;
- for (FX_INT32 i = 0; i < iSize; i++) {
+ for (int32_t i = 0; i < iSize; i++) {
pValue = pDataNode->CreateSamePacketNode(XFA_ELEMENT_DataValue);
pValue->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"value"));
pValueXMLNode = pValue->CreateXMLMappingNode();
@@ -277,11 +277,11 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pDa if (pWidgetData->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) {
CXFA_NodeArray items;
pDataNode->GetNodeList(items);
- FX_INT32 iCounts = items.GetSize();
+ int32_t iCounts = items.GetSize();
if (iCounts > 0) {
wsNormailizeValue.Empty();
CFX_WideString wsItem;
- for (FX_INT32 i = 0; i < iCounts; i++) {
+ for (int32_t i = 0; i < iCounts; i++) {
items[i]->TryContent(wsItem);
wsItem = (iCounts == 1) ? wsItem : wsItem + FX_WSTRC(L"\n");
wsNormailizeValue += wsItem;
@@ -545,7 +545,7 @@ static CXFA_Node* XFA_DataMerge_FindMatchingDataNode(CXFA_Document* pDocument, C continue;
}
CXFA_Node* pTemplateNodeOccur = pCurTemplateNode->GetFirstChildByClass(XFA_ELEMENT_Occur);
- FX_INT32 iMin, iMax, iInit;
+ int32_t iMin, iMax, iInit;
if(pTemplateNodeOccur && XFA_GetOccurInfo(pTemplateNodeOccur, iMin, iMax, iInit) && iMax == 0) {
pCurTemplateNode = pIterator->MoveToNext();
continue;
@@ -609,10 +609,10 @@ static CXFA_Node* XFA_DataMerge_FindMatchingDataNode(CXFA_Document* pDocument, C }
static void XFA_DataMerge_SortRecurseRecord(CFX_ArrayTemplate<XFA_DataMerge_RecurseRecord>& rgRecords, CXFA_Node* pDataScope, FX_BOOL bChoiceMode = FALSE)
{
- FX_INT32 iCount = rgRecords.GetSize();
+ int32_t iCount = rgRecords.GetSize();
CFX_ArrayTemplate<XFA_DataMerge_RecurseRecord> rgResultRecord;
for (CXFA_Node* pChildNode = pDataScope->GetNodeItem(XFA_NODEITEM_FirstChild); pChildNode; pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- for(FX_INT32 i = 0; i < iCount; i ++) {
+ for(int32_t i = 0; i < iCount; i ++) {
CXFA_Node* pNode = rgRecords[i].pDataChild;
if (pChildNode == pNode) {
XFA_DataMerge_RecurseRecord sNewRecord = {rgRecords[i].pTemplateChild, pNode};
@@ -628,7 +628,7 @@ static void XFA_DataMerge_SortRecurseRecord(CFX_ArrayTemplate<XFA_DataMerge_Recu }
if (rgResultRecord.GetSize() > 0) {
if (!bChoiceMode) {
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
XFA_DataMerge_RecurseRecord sNewRecord = {rgRecords[i].pTemplateChild, rgRecords[i].pDataChild};
rgResultRecord.Add(sNewRecord);
}
@@ -669,12 +669,12 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen }
}
}
- FX_INT32 iMax = 1, iInit = 1, iMin = 1;
+ int32_t iMax = 1, iInit = 1, iMin = 1;
if(!bOneInstance) {
XFA_GetOccurInfo(pOccurNode, iMin, iMax, iInit);
}
XFA_ATTRIBUTEENUM eRelation = eElement == XFA_ELEMENT_SubformSet ? pTemplateNode->GetEnum(XFA_ATTRIBUTE_Relation) : XFA_ATTRIBUTEENUM_Ordered;
- FX_INT32 iCurRepeatIndex = 0;
+ int32_t iCurRepeatIndex = 0;
XFA_ATTRIBUTEENUM eParentBindMatch = XFA_ATTRIBUTEENUM_None;
if (bDataMerge) {
CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sNodeIterator(pTemplateNode);
@@ -702,7 +702,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen subformArray.Add(pSubformNode);
}
FX_POSITION position = subformMapArray.GetStartPosition();
- for(FX_INT32 iIndex = 0; iIndex < subformArray.GetSize(); iIndex ++) {
+ for(int32_t iIndex = 0; iIndex < subformArray.GetSize(); iIndex ++) {
CXFA_Node* pSubform = subformArray[iIndex];
CXFA_Node* pDataNode = (CXFA_Node*)subformMapArray.GetValueAt(pSubform);
for (CXFA_Node *pTemplateChild = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -762,11 +762,11 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen case XFA_ATTRIBUTEENUM_Unordered: {
if(rgItemMatchList.GetSize()) {
XFA_DataMerge_SortRecurseRecord(rgItemMatchList, pDataScope);
- for(FX_INT32 i = 0, count = rgItemMatchList.GetSize(); i < count; i ++) {
+ for(int32_t i = 0, count = rgItemMatchList.GetSize(); i < count; i ++) {
pDocument->DataMerge_CopyContainer(rgItemMatchList[i].pTemplateChild, pSubformSetNode, pDataScope);
}
}
- for(FX_INT32 i = 0, count = rgItemUnmatchList.GetSize(); i < count; i ++) {
+ for(int32_t i = 0, count = rgItemUnmatchList.GetSize(); i < count; i ++) {
pDocument->DataMerge_CopyContainer(rgItemUnmatchList[i], pSubformSetNode, pDataScope);
}
}
@@ -790,7 +790,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen }
}
if(iCurRepeatIndex == 0 && bAccessedDataDOM == FALSE) {
- FX_INT32 iLimit = iMax;
+ int32_t iLimit = iMax;
if (pInstMgrNode && pTemplateNode->GetNameHash() == 0) {
iLimit = subformArray.GetSize();
if (iLimit < iMin) {
@@ -823,7 +823,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen }
}
}
- FX_INT32 iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin;
+ int32_t iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin;
for (; iCurRepeatIndex < iMinimalLimit; iCurRepeatIndex++) {
CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
FXSYS_assert(pSubformSetNode);
@@ -1111,7 +1111,7 @@ void CXFA_Document::DataMerge_UpdateBindingRelations(CXFA_Node* pFormUpdateRoot) }
CXFA_Node * CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes)
{
- for(FX_INT32 i = 0; i < arrayNodes.GetSize(); i++) {
+ for(int32_t i = 0; i < arrayNodes.GetSize(); i++) {
CXFA_Object* pObject = arrayNodes[i];
if(!pObject->IsNode()) {
continue;
diff --git a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp index ad1ff99253..d634079f58 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp @@ -282,9 +282,9 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(CFX_WideString& wsTemplateN if(nDotPos == (FX_STRSIZE)-1) {
return XFA_VERSION_UNKNOWN;
}
- FX_INT8 iMajor = FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength));
- FX_INT8 iMinor = FXSYS_wtoi(wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2));
- XFA_VERSION eVersion = (XFA_VERSION)((FX_INT32)iMajor * 100 + iMinor);
+ int8_t iMajor = FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength));
+ int8_t iMinor = FXSYS_wtoi(wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2));
+ XFA_VERSION eVersion = (XFA_VERSION)((int32_t)iMajor * 100 + iMinor);
if(eVersion < XFA_VERSION_MIN || eVersion > XFA_VERSION_MAX) {
return XFA_VERSION_UNKNOWN;
}
@@ -401,7 +401,7 @@ void CXFA_Document::DoProtoMerge() if(!wsSOM.IsEmpty()) {
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = m_pScriptContext->ResolveObjects(pUseHrefNode, wsSOM, resoveNodeRS, dwFlag);
+ int32_t iRet = m_pScriptContext->ResolveObjects(pUseHrefNode, wsSOM, resoveNodeRS, dwFlag);
if(iRet > 0 && resoveNodeRS.nodes[0]->IsNode()) {
pProtoNode = (CXFA_Node*)resoveNodeRS.nodes[0];
}
diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp index 5ca9bb7a9b..03557dd548 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp @@ -51,7 +51,7 @@ CXFA_Document* CXFA_LayoutProcessor::GetDocument() const {
return m_pDocument;
}
-FX_INT32 CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart)
+int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart)
{
if (!bForceRestart && !IsNeedLayout()) {
return 100;
@@ -85,7 +85,7 @@ FX_INT32 CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) m_nProgressCounter = 1;
return 0;
}
-FX_INT32 CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause )
+int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause )
{
if (m_nProgressCounter < 1) {
return -1;
@@ -120,7 +120,7 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() StartLayout(TRUE);
return DoLayout(NULL) == 100;
}
- for (FX_INT32 i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) {
+ for (int32_t i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) {
CXFA_Node *pNode = m_rgChangedContainers[i];
CXFA_Node *pParentNode = pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_OBJECTTYPE_ContainerNode);
if(!pParentNode) {
@@ -133,11 +133,11 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() m_rgChangedContainers.RemoveAll();
return TRUE;
}
-FX_INT32 CXFA_LayoutProcessor::CountPages() const
+int32_t CXFA_LayoutProcessor::CountPages() const
{
return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0;
}
-IXFA_LayoutPage* CXFA_LayoutProcessor::GetPage(FX_INT32 index) const
+IXFA_LayoutPage* CXFA_LayoutProcessor::GetPage(int32_t index) const
{
return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : NULL;
}
diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h index b1c9e0bc14..0572b89dcc 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h @@ -16,11 +16,11 @@ public: CXFA_LayoutProcessor(CXFA_Document* pDocument);
~CXFA_LayoutProcessor();
virtual CXFA_Document* GetDocument() const;
- virtual FX_INT32 StartLayout(FX_BOOL bForceRestart = FALSE);
- virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL);
+ virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE);
+ virtual int32_t DoLayout(IFX_Pause *pPause = NULL);
virtual FX_BOOL IncrementLayout();
- virtual FX_INT32 CountPages() const;
- virtual IXFA_LayoutPage* GetPage(FX_INT32 index) const;
+ virtual int32_t CountPages() const;
+ virtual IXFA_LayoutPage* GetPage(int32_t index) const;
virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node *pFormItem);
void AddChangedContainer(CXFA_Node* pContainer);
@@ -46,7 +46,7 @@ protected: CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor;
CXFA_LayoutPageMgr* m_pLayoutPageMgr;
CXFA_NodeArray m_rgChangedContainers;
- FX_UINT32 m_nProgressCounter;
+ uint32_t m_nProgressCounter;
FX_BOOL m_bNeeLayout;
};
#endif
diff --git a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp index 6df2483a1e..f9c22e8149 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp @@ -74,8 +74,8 @@ FX_BOOL CXFA_DataImporter::ImportData(IFX_FileRead* pDataDocument) CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str)
{
CFX_WideTextBuf textBuf;
- FX_INT32 iLen = str.GetLength();
- for (FX_INT32 i = 0; i < iLen; i++) {
+ int32_t iLen = str.GetLength();
+ for (int32_t i = 0; i < iLen; i++) {
switch (str[i]) {
case '&':
textBuf << FX_WSTRC(L"&");
@@ -101,8 +101,8 @@ CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str) CFX_WideString XFA_ExportEncodeContent(FX_WSTR str)
{
CFX_WideTextBuf textBuf;
- FX_INT32 iLen = str.GetLength();
- for (FX_INT32 i = 0; i < iLen; i++) {
+ int32_t iLen = str.GetLength();
+ for (int32_t i = 0; i < iLen; i++) {
FX_WCHAR ch = str.GetAt(i);
if (!FDE_IsXMLValidChar(ch)) {
continue;
@@ -202,7 +202,7 @@ static void XFA_DataExporter_RecognizeXFAVersionNumber(CXFA_Node *pTemplateRoot, static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_WideTextBuf& buf, FX_BOOL bSaveXML = FALSE)
{
CFX_WideString wsAttrs;
- FX_INT32 iAttrs = 0;
+ int32_t iAttrs = 0;
FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);
while (iAttrs--) {
XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]);
@@ -251,8 +251,8 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi break;
}
CFX_WideStringArray wsSelTextArray;
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = wsRawValue.Find(L'\n', iStart);
+ int32_t iStart = 0;
+ int32_t iEnd = wsRawValue.Find(L'\n', iStart);
iEnd = (iEnd == -1) ? wsRawValue.GetLength() : iEnd;
while (iEnd >= iStart) {
wsSelTextArray.Add(wsRawValue.Mid(iStart, iEnd - iStart));
@@ -274,7 +274,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi buf << FX_WSTRC(L"<");
buf << bodyTagName;
buf << FX_WSTRC(L" xmlns=\"\"\n>");
- for (FX_INT32 i = 0; i < wsSelTextArray.GetSize(); i++) {
+ for (int32_t i = 0; i < wsSelTextArray.GetSize(); i++) {
buf << FX_WSTRC(L"<value\n>");
buf << XFA_ExportEncodeContent(wsSelTextArray[i]);
buf << FX_WSTRC(L"</value\n>");
@@ -364,7 +364,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_ CFX_WideString wsOutput;
XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsOutput);
CFX_WideString wsAttrs;
- FX_INT32 iAttrs = 0;
+ int32_t iAttrs = 0;
FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);
while (iAttrs--) {
XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]);
@@ -521,7 +521,7 @@ void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node *pDataNode) if (!pDataNode || pDataNode->GetClassID() == XFA_ELEMENT_DataValue) {
return;
}
- FX_INT32 iChildNum = 0;
+ int32_t iChildNum = 0;
for (CXFA_Node *pChildNode = pDataNode->GetNodeItem(XFA_NODEITEM_FirstChild); pChildNode; pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
iChildNum++;
XFA_DataExporter_DealWithDataGroupNode(pChildNode);
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp index fb592b4c97..b276abca30 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp @@ -25,7 +25,7 @@ IXFA_DocLayout* IXFA_LayoutPage::GetLayout() const CXFA_ContainerLayoutItemImpl* pThis = (CXFA_ContainerLayoutItemImpl*)this;
return pThis->m_pFormNode->GetDocument()->GetLayoutProcessor();
}
-FX_INT32 IXFA_LayoutPage::GetPageIndex() const
+int32_t IXFA_LayoutPage::GetPageIndex() const
{
CXFA_ContainerLayoutItemImpl* pThis = (CXFA_ContainerLayoutItemImpl*)this;
return pThis->m_pFormNode->GetDocument()->GetLayoutProcessor()->GetLayoutPageMgr()->GetPageIndex((IXFA_LayoutPage*)this);
@@ -120,10 +120,10 @@ CXFA_LayoutItem* CXFA_LayoutItem::GetLast() const }
return (CXFA_LayoutItem*)pCurNode;
}
-FX_INT32 CXFA_LayoutItem::GetIndex() const
+int32_t CXFA_LayoutItem::GetIndex() const
{
CXFA_ContentLayoutItemImpl* pThis = (CXFA_ContentLayoutItemImpl*)this;
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
CXFA_ContentLayoutItemImpl* pCurNode = pThis;
while(pCurNode->m_pPrev) {
pCurNode = pCurNode->m_pPrev;
@@ -131,10 +131,10 @@ FX_INT32 CXFA_LayoutItem::GetIndex() const }
return iIndex;
}
-FX_INT32 CXFA_LayoutItem::GetCount() const
+int32_t CXFA_LayoutItem::GetCount() const
{
CXFA_ContentLayoutItemImpl* pThis = (CXFA_ContentLayoutItemImpl*)this;
- FX_INT32 iCount = 1;
+ int32_t iCount = 1;
CXFA_ContentLayoutItemImpl* pCurNode = NULL;
pCurNode = pThis;
while(pCurNode->m_pPrev) {
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp index 228086734b..4ebc248ec2 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp @@ -274,7 +274,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(CXFA_ContentLayoutItemImpl* pLayo pSecondLayoutItem->AddChild(pChildItem);
} else {
if(lHeightForKeep < XFA_LAYOUT_FLOAT_PERCISION) {
- for(FX_INT32 iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex ++) {
+ for(int32_t iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex ++) {
CXFA_ContentLayoutItemImpl *pPreItem = keepLayoutItems[iIndex];
pLayoutItem->RemoveChild(pPreItem);
pPreItem->m_sPos.y -= fSplitPos;
@@ -713,7 +713,7 @@ static inline void XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromCo void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos(CXFA_Node* pNode, FX_FLOAT fWidth, FX_FLOAT fHeight, FX_FLOAT& fAbsoluteX, FX_FLOAT& fAbsoluteY)
{
XFA_ATTRIBUTEENUM eAnchorType = pNode->GetEnum(XFA_ATTRIBUTE_AnchorType);
- FX_INT32 nAnchorType = 0;
+ int32_t nAnchorType = 0;
switch(eAnchorType) {
case XFA_ATTRIBUTEENUM_TopLeft:
nAnchorType = 0;
@@ -745,16 +745,16 @@ void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos(CXFA_Node* pNode, default:
break;
}
- static const FX_UINT8 nNextPos[4][9] = { {0, 1, 2, 3, 4, 5, 6, 7, 8},
+ static const uint8_t nNextPos[4][9] = { {0, 1, 2, 3, 4, 5, 6, 7, 8},
{6, 3, 0, 7, 4, 1, 8, 5, 2},
{8, 7, 6, 5, 4, 3, 2, 1, 0},
{2, 5, 8, 1, 4, 7, 0, 3, 6} };
FX_FLOAT fAnchorX = pNode->GetMeasure(XFA_ATTRIBUTE_X).ToUnit(XFA_UNIT_Pt);
FX_FLOAT fAnchorY = pNode->GetMeasure(XFA_ATTRIBUTE_Y).ToUnit(XFA_UNIT_Pt);
- FX_INT32 nRotate = FXSYS_round(pNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue());
+ int32_t nRotate = FXSYS_round(pNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue());
nRotate = XFA_MapRotation(nRotate) / 90;
- FX_INT32 nAbsoluteAnchorType = nNextPos[nRotate][nAnchorType];
+ int32_t nAbsoluteAnchorType = nNextPos[nRotate][nAnchorType];
fAbsoluteX = fAnchorX;
fAbsoluteY = fAnchorY;
switch(nAbsoluteAnchorType / 3) {
@@ -867,7 +867,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(CXFA_LayoutContext* p if(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) {
XFA_ItemLayoutProcessor_GotoNextContainerNode(m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE);
}
- FX_INT32 iColIndex = 0;
+ int32_t iColIndex = 0;
for(; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) {
if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) {
continue;
@@ -880,14 +880,14 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(CXFA_LayoutContext* p pProcessor->m_pPageMgrCreateItem = m_pPageMgrCreateItem;
#endif
if (pContext && pContext->m_prgSpecifiedColumnWidths) {
- FX_INT32 iColSpan = m_pCurChildNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
+ int32_t iColSpan = m_pCurChildNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
if (iColSpan <= pContext->m_prgSpecifiedColumnWidths->GetSize() - iColIndex) {
pContext->m_fCurColumnWidth = 0;
pContext->m_bCurColumnWidthAvaiable = TRUE;
if(iColSpan == -1) {
iColSpan = pContext->m_prgSpecifiedColumnWidths->GetSize();
}
- for (FX_INT32 i = 0; i < iColSpan; i++) {
+ for (int32_t i = 0; i < iColSpan; i++) {
pContext->m_fCurColumnWidth += pContext->m_prgSpecifiedColumnWidths->GetAt(iColIndex + i);
}
if(pContext->m_fCurColumnWidth == 0) {
@@ -993,16 +993,16 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(CXFA_ContentLay FX_FLOAT fContentCurrentHeight = pLayoutRow->m_sSize.y - fTopInset - fBottomInset;
FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0;
FX_FLOAT fCurrentColX = 0;
- FX_INT32 nCurrentColIdx = 0;
+ int32_t nCurrentColIdx = 0;
FX_BOOL bMetWholeRowCell = FALSE;
for(CXFA_ContentLayoutItemImpl* pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutRow->m_pFirstChild; pLayoutChild; pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pNextSibling) {
- FX_INT32 nOriginalColSpan = pLayoutChild->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
- FX_INT32 nColSpan = nOriginalColSpan;
+ int32_t nOriginalColSpan = pLayoutChild->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
+ int32_t nColSpan = nOriginalColSpan;
FX_FLOAT fColSpanWidth = 0;
if(nColSpan == -1 || nCurrentColIdx + nColSpan > rgSpecifiedColumnWidths.GetSize()) {
nColSpan = rgSpecifiedColumnWidths.GetSize() - nCurrentColIdx;
}
- for(FX_INT32 i = 0; i < nColSpan; i ++) {
+ for(int32_t i = 0; i < nColSpan; i ++) {
fColSpanWidth += rgSpecifiedColumnWidths[nCurrentColIdx + i];
}
if (nColSpan != nOriginalColSpan) {
@@ -1101,9 +1101,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) if (pLayoutNode->TryCData(XFA_ATTRIBUTE_ColumnWidths, wsColumnWidths)) {
CFX_WideStringArray widths;
if (FX_SeparateStringW(wsColumnWidths.GetPtr(), wsColumnWidths.GetLength(), L' ', widths) > 0) {
- FX_INT32 iCols = widths.GetSize();
+ int32_t iCols = widths.GetSize();
CFX_WideString wsWidth;
- for (FX_INT32 i = 0; i < iCols; i++) {
+ for (int32_t i = 0; i < iCols; i++) {
wsWidth = widths[i];
wsWidth.TrimLeft(L' ');
if (!wsWidth.IsEmpty()) {
@@ -1113,7 +1113,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) }
}
}
- FX_INT32 iSpecifiedColumnCount = m_rgSpecifiedColumnWidths.GetSize();
+ int32_t iSpecifiedColumnCount = m_rgSpecifiedColumnWidths.GetSize();
CXFA_LayoutContext layoutContext;
layoutContext.m_prgSpecifiedColumnWidths = &m_rgSpecifiedColumnWidths;
CXFA_LayoutContext* pLayoutContext = iSpecifiedColumnCount > 0 ? &layoutContext : NULL;
@@ -1138,10 +1138,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) m_pLayoutItem->AddChild(pProcessor->ExtractLayoutItem());
delete pProcessor;
}
- FX_INT32 iRowCount = 0, iColCount = 0;
+ int32_t iRowCount = 0, iColCount = 0;
{
CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> rgRowItems;
- CFX_ArrayTemplate<FX_INT32> rgRowItemsSpan;
+ CFX_ArrayTemplate<int32_t> rgRowItemsSpan;
CFX_ArrayTemplate<FX_FLOAT> rgRowItemsWidth;
for(CXFA_ContentLayoutItemImpl* pLayoutChild = (CXFA_ContentLayoutItemImpl*)m_pLayoutItem->m_pFirstChild; pLayoutChild; pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pNextSibling) {
if(pLayoutChild->m_pFormNode->GetClassID() != XFA_ELEMENT_Subform) {
@@ -1156,7 +1156,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) }
if (CXFA_ContentLayoutItemImpl* pRowLayoutCell = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pFirstChild) {
rgRowItems.Add(pRowLayoutCell);
- FX_INT32 iColSpan = pRowLayoutCell->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
+ int32_t iColSpan = pRowLayoutCell->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
rgRowItemsSpan.Add(iColSpan);
rgRowItemsWidth.Add(pRowLayoutCell->m_sSize.x);
}
@@ -1167,7 +1167,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) while(bMoreColumns) {
bMoreColumns = FALSE;
FX_BOOL bAutoCol = FALSE;
- for(FX_INT32 i = 0; i < iRowCount; i ++) {
+ for(int32_t i = 0; i < iRowCount; i ++) {
while(rgRowItems[i] != NULL && (rgRowItemsSpan[i] <= 0 || !XFA_ItemLayoutProcessor_IsTakingSpace(rgRowItems[i]->m_pFormNode))) {
CXFA_ContentLayoutItemImpl* pNewCell = (CXFA_ContentLayoutItemImpl*)rgRowItems[i]->m_pNextSibling;
if(rgRowItemsSpan[i] < 0 && XFA_ItemLayoutProcessor_IsTakingSpace(rgRowItems[i]->m_pFormNode)) {
@@ -1184,7 +1184,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) bMoreColumns = TRUE;
if (rgRowItemsSpan[i] == 1) {
if (iColCount >= iSpecifiedColumnCount) {
- for (FX_INT32 j = 0, c = iColCount + 1 - m_rgSpecifiedColumnWidths.GetSize(); j < c; j ++) {
+ for (int32_t j = 0, c = iColCount + 1 - m_rgSpecifiedColumnWidths.GetSize(); j < c; j ++) {
m_rgSpecifiedColumnWidths.Add(0);
}
}
@@ -1198,7 +1198,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) }
if(bMoreColumns) {
FX_FLOAT fFinalColumnWidth = m_rgSpecifiedColumnWidths[iColCount];
- for(FX_INT32 i = 0; i < iRowCount; i ++) {
+ for(int32_t i = 0; i < iRowCount; i ++) {
if(!rgRowItems[i]) {
continue;
}
@@ -1257,7 +1257,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(m_pFormNode, bContainerWidthAutoSize, fContentCalculatedWidth, fContainerWidth, bContainerHeightAutoSize, fContentCalculatedHeight, fContainerHeight);
SetCurrentComponentSize(fContainerWidth, fContainerHeight);
}
-static FX_UINT8 XFA_ItemLayoutProcessor_HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign)
+static uint8_t XFA_ItemLayoutProcessor_HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign)
{
switch(eHAlign) {
case XFA_ATTRIBUTEENUM_Center:
@@ -1427,7 +1427,7 @@ FX_FLOAT CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
m_pLayoutItem->m_sSize.Set(0, 0);
}
- for(FX_INT32 iIndex = m_arrayKeepItems.GetSize() - 1; iIndex >= 0 ; iIndex --) {
+ for(int32_t iIndex = m_arrayKeepItems.GetSize() - 1; iIndex >= 0 ; iIndex --) {
XFA_ItemLayoutProcessor_AddLeaderAfterSplit(this, m_arrayKeepItems[iIndex]);
fTotalHeight += m_arrayKeepItems[iIndex]->m_sSize.y;
}
@@ -1449,7 +1449,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(CXFA_ItemLayoutProcessor* CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> keepLayoutItems;
if(pParentProcessor->JudgePutNextPage(pParentProcessor->m_pLayoutItem, fChildHeight, keepLayoutItems)) {
m_arrayKeepItems.RemoveAll();
- for(FX_INT32 iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex++) {
+ for(int32_t iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex++) {
CXFA_ContentLayoutItemImpl* pItem = keepLayoutItems.GetAt(iIndex);
pParentProcessor->m_pLayoutItem->RemoveChild(pItem);
fContentCurRowY -= pItem->m_sSize.y;
@@ -1531,12 +1531,12 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow(CXFA_Node* pLeaderNode, CXFA }
}
static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(CXFA_ItemLayoutProcessor* pThis, CXFA_ItemLayoutProcessor*& pProcessor,
- FX_BOOL bContainerWidthAutoSize, FX_BOOL bContainerHeightAutoSize, FX_FLOAT fContainerHeight, XFA_ATTRIBUTEENUM eFlowStrategy, FX_UINT8& uCurHAlignState, CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> (&rgCurLineLayoutItems)[3],
+ FX_BOOL bContainerWidthAutoSize, FX_BOOL bContainerHeightAutoSize, FX_FLOAT fContainerHeight, XFA_ATTRIBUTEENUM eFlowStrategy, uint8_t& uCurHAlignState, CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> (&rgCurLineLayoutItems)[3],
FX_BOOL bUseBreakControl, FX_FLOAT fAvailHeight, FX_FLOAT fRealHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT& fContentWidthLimit, FX_FLOAT& fContentCurRowAvailWidth,
FX_FLOAT& fContentCurRowHeight, FX_BOOL& bAddedItemInRow, FX_BOOL& bForceEndPage, CXFA_LayoutContext* pLayoutContext = NULL, FX_BOOL bNewRow = FALSE)
{
FX_BOOL bTakeSpace = XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode);
- FX_UINT8 uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign));
+ uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign));
if(bContainerWidthAutoSize) {
uHAlign = 0;
}
@@ -1883,7 +1883,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( FX_FLOAT fContentCurRowAvailWidth = fContentWidthLimit;
m_fWidthLimite = fContentCurRowAvailWidth;
CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> rgCurLineLayoutItems[3];
- FX_UINT8 uCurHAlignState = (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb ? 0 : 2);
+ uint8_t uCurHAlignState = (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb ? 0 : 2);
if (pLayoutChild) {
for (CXFA_ContentLayoutItemImpl* pLayoutNext = pLayoutChild; pLayoutNext; pLayoutNext = (CXFA_ContentLayoutItemImpl*)pLayoutNext->m_pNextSibling) {
if (pLayoutNext->m_pNextSibling == NULL && m_pCurChildPreprocessor && m_pCurChildPreprocessor->m_pFormNode == pLayoutNext->m_pFormNode) {
@@ -1891,7 +1891,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pCurChildPreprocessor->m_pLayoutItem = pLayoutNext;
break;
}
- FX_UINT8 uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pLayoutNext->m_pFormNode->GetEnum(XFA_ATTRIBUTE_HAlign));
+ uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pLayoutNext->m_pFormNode->GetEnum(XFA_ATTRIBUTE_HAlign));
rgCurLineLayoutItems[uHAlign].Add(pLayoutNext);
if (eFlowStrategy == XFA_ATTRIBUTEENUM_Lr_tb) {
if (uHAlign > uCurHAlignState) {
@@ -1936,7 +1936,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( case XFA_ItemLayoutProcessorStages_None:
break;
case XFA_ItemLayoutProcessorStages_BreakBefore: {
- for(FX_INT32 iIndex = 0; iIndex < m_arrayKeepItems.GetSize(); iIndex++) {
+ for(int32_t iIndex = 0; iIndex < m_arrayKeepItems.GetSize(); iIndex++) {
CXFA_ContentLayoutItemImpl* pItem = m_arrayKeepItems.GetAt(iIndex);
m_pLayoutItem->RemoveChild(pItem);
fContentCalculatedHeight -= pItem->m_sSize.y;
@@ -2152,12 +2152,12 @@ SuspendAndCreateNewRow: FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*>(&rgCurLineLayoutItems)[3], XFA_ATTRIBUTEENUM eFlowStrategy, FX_BOOL bContainerHeightAutoSize,
FX_BOOL bContainerWidthAutoSize, FX_FLOAT& fContentCalculatedWidth, FX_FLOAT& fContentCalculatedHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, FX_BOOL bRootForceTb)
{
- FX_INT32 nGroupLengths[3] = {0, 0, 0};
+ int32_t nGroupLengths[3] = {0, 0, 0};
FX_FLOAT fGroupWidths[3] = {0, 0, 0};
- FX_INT32 nTotalLength = 0;
- for(FX_INT32 i = 0; i < 3; i ++) {
+ int32_t nTotalLength = 0;
+ for(int32_t i = 0; i < 3; i ++) {
nGroupLengths[i] = rgCurLineLayoutItems[i].GetSize();
- for(FX_INT32 c = nGroupLengths[i], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[i], j = 0; j < c; j++) {
nTotalLength++;
if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[i][j]->m_pFormNode)) {
fGroupWidths[i] += rgCurLineLayoutItems[i][j]->m_sSize.x;
@@ -2179,7 +2179,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate if (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb) {
FX_FLOAT fCurPos;
fCurPos = 0;
- for(FX_INT32 c = nGroupLengths[0], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[0], j = 0; j < c; j++) {
if(bRootForceTb) {
FX_FLOAT fAbsoluteX, fAbsoluteY;
CalculatePositionedContainerPos(rgCurLineLayoutItems[0][j]->m_pFormNode, rgCurLineLayoutItems[0][j]->m_sSize.x, rgCurLineLayoutItems[0][j]->m_sSize.y, fAbsoluteX, fAbsoluteY);
@@ -2194,7 +2194,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos;
}
fCurPos = (fContentWidthLimit + fGroupWidths[0] - fGroupWidths[1] - fGroupWidths[2]) / 2;
- for(FX_INT32 c = nGroupLengths[1], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[1], j = 0; j < c; j++) {
if(bRootForceTb) {
FX_FLOAT fAbsoluteX, fAbsoluteY;
CalculatePositionedContainerPos(rgCurLineLayoutItems[1][j]->m_pFormNode, rgCurLineLayoutItems[1][j]->m_sSize.x, rgCurLineLayoutItems[1][j]->m_sSize.y, fAbsoluteX, fAbsoluteY);
@@ -2209,7 +2209,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos;
}
fCurPos = fContentWidthLimit - fGroupWidths[2];
- for(FX_INT32 c = nGroupLengths[2], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[2], j = 0; j < c; j++) {
if(bRootForceTb) {
FX_FLOAT fAbsoluteX, fAbsoluteY;
CalculatePositionedContainerPos(rgCurLineLayoutItems[2][j]->m_pFormNode, rgCurLineLayoutItems[2][j]->m_sSize.x, rgCurLineLayoutItems[2][j]->m_sSize.y, fAbsoluteX, fAbsoluteY);
@@ -2226,7 +2226,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate } else {
FX_FLOAT fCurPos;
fCurPos = fGroupWidths[0];
- for(FX_INT32 c = nGroupLengths[0], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[0], j = 0; j < c; j++) {
if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[0][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[0][j]->m_sSize.x;
}
@@ -2235,7 +2235,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos;
}
fCurPos = (fContentWidthLimit + fGroupWidths[0] + fGroupWidths[1] - fGroupWidths[2]) / 2;
- for(FX_INT32 c = nGroupLengths[1], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[1], j = 0; j < c; j++) {
if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[1][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[1][j]->m_sSize.x;
}
@@ -2244,7 +2244,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos;
}
fCurPos = fContentWidthLimit;
- for(FX_INT32 c = nGroupLengths[2], j = 0; j < c; j++) {
+ for(int32_t c = nGroupLengths[2], j = 0; j < c; j++) {
if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[2][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[2][j]->m_sSize.x;
}
@@ -2300,7 +2300,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutField() FX_FLOAT fHeight = -1;
FX_FLOAT fWidth = -1;
pNotify->StartFieldDrawLayout(m_pFormNode, fWidth, fHeight);
- FX_INT32 nRotate = FXSYS_round(m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue());
+ int32_t nRotate = FXSYS_round(m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue());
nRotate = XFA_MapRotation(nRotate);
if(nRotate == 90 || nRotate == 270) {
FX_FLOAT fTmp = fWidth;
@@ -2381,14 +2381,14 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormN pTemplate = pFormNode;
}
CXFA_Occur NodeOccur = pTemplate->GetFirstChildByClass(XFA_ELEMENT_Occur);
- FX_INT32 iMax = NodeOccur.GetMax();
+ int32_t iMax = NodeOccur.GetMax();
if (iMax > -1) {
- FX_INT32 iCount = (FX_INT32)(FX_UINTPTR)m_PendingNodesCount.GetValueAt(pTemplate);
+ int32_t iCount = (int32_t)(uintptr_t)m_PendingNodesCount.GetValueAt(pTemplate);
if (iCount >= iMax) {
return FALSE;
}
iCount++;
- m_PendingNodesCount.SetAt(pTemplate, (FX_LPVOID)(FX_UINTPTR)(iCount));
+ m_PendingNodesCount.SetAt(pTemplate, (FX_LPVOID)(uintptr_t)(iCount));
return TRUE;
}
return TRUE;
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h index 68bd59910e..27cb5b2c2e 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h +++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h @@ -6,7 +6,7 @@ #ifndef _XFA_LAYOUT_ITEMLAYOUT_H_
#define _XFA_LAYOUT_ITEMLAYOUT_H_
-#define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(FX_INTPTR)-1)
+#define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(intptr_t)-1)
#define XFA_LAYOUT_FLOAT_PERCISION (0.0005f)
#include "float.h"
#define XFA_LAYOUT_FLOAT_MAX FLT_MAX
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp index bc2d8104fd..d5814b921b 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp @@ -69,7 +69,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) }
InitPageSetMap();
CXFA_Node* pPageArea = NULL;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
for (pPageArea = m_pTemplatePageSetRoot->GetNodeItem(XFA_NODEITEM_FirstChild); pPageArea; pPageArea = pPageArea->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pPageArea->GetClassID() == XFA_ELEMENT_PageArea) {
iCount++;
@@ -251,11 +251,11 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, FX_BOOL bNewEx CFX_WideString wsTargetAll = wsTargetExpr;
wsTargetAll.TrimLeft();
wsTargetAll.TrimRight();
- FX_INT32 iSpliteIndex = 0;
+ int32_t iSpliteIndex = 0;
FX_BOOL bTargetAllFind = TRUE;
while(iSpliteIndex != -1) {
CFX_WideString wsTargetExpr;
- FX_INT32 iSpliteNextIndex = 0;
+ int32_t iSpliteNextIndex = 0;
if(!bTargetAllFind) {
iSpliteNextIndex = wsTargetAll.Find(' ', iSpliteIndex);
wsTargetExpr = wsTargetAll.Mid(iSpliteIndex, iSpliteNextIndex - iSpliteIndex);
@@ -277,7 +277,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, FX_BOOL bNewEx wsProcessedTarget = wsTargetExpr.Mid(4, wsTargetExpr.GetLength() - 5);
}
XFA_RESOLVENODE_RS rs;
- FX_INT32 iCount = pDocument->GetScriptContext()->ResolveObjects(pPageSetRoot, wsProcessedTarget, rs, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent);
+ int32_t iCount = pDocument->GetScriptContext()->ResolveObjects(pPageSetRoot, wsProcessedTarget, rs, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent);
if(iCount > 0 && rs.nodes[0]->IsNode()) {
return (CXFA_Node*)rs.nodes[0];
}
@@ -368,7 +368,7 @@ void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_ContainerLayoutItemImpl* pContainerItem = (CXFA_ContainerLayoutItemImpl*)pNotify->OnCreateLayoutItem(pNewPageArea);
m_PageArray.Add(pContainerItem);
m_nAvailPages++;
- pNotify->OnPageEvent((IXFA_LayoutPage*)pContainerItem, XFA_PAGEEVENT_PageAdded, (FX_LPVOID)(FX_UINTPTR)m_nAvailPages);
+ pNotify->OnPageEvent((IXFA_LayoutPage*)pContainerItem, XFA_PAGEEVENT_PageAdded, (FX_LPVOID)(uintptr_t)m_nAvailPages);
pNewPageAreaLayoutItem = pContainerItem;
}
pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem);
@@ -429,7 +429,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() case XFA_ATTRIBUTEENUM_SimplexPaginated:
case XFA_ATTRIBUTEENUM_DuplexPaginated: {
CXFA_LayoutItemImpl* pLastPageAreaLayoutItem = NULL;
- FX_INT32 nPageAreaCount = 0;
+ int32_t nPageAreaCount = 0;
for(CXFA_LayoutItemImpl* pPageAreaLayoutItem = pPageSetLayoutItem->m_pFirstChild; pPageAreaLayoutItem; pPageAreaLayoutItem = pPageAreaLayoutItem->m_pNextSibling) {
if(pPageAreaLayoutItem->m_pFormNode->GetClassID() != XFA_ELEMENT_PageArea) {
continue;
@@ -471,7 +471,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() }
rgUsedHeights.Add(fUsedHeight);
}
- FX_INT32 iCurContentAreaIndex = -1;
+ int32_t iCurContentAreaIndex = -1;
for(CXFA_Node* pContentAreaNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); pContentAreaNode; pContentAreaNode = pContentAreaNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if(pContentAreaNode->GetClassID() != XFA_ELEMENT_ContentArea) {
continue;
@@ -509,18 +509,18 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() }
}
}
-FX_INT32 CXFA_LayoutPageMgr::GetPageCount() const
+int32_t CXFA_LayoutPageMgr::GetPageCount() const
{
return m_PageArray.GetSize();
}
-IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(FX_INT32 index) const
+IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(int32_t index) const
{
if (m_PageArray.GetSize() > index) {
return (IXFA_LayoutPage*)m_PageArray[index];
}
return NULL;
}
-FX_INT32 CXFA_LayoutPageMgr::GetPageIndex(IXFA_LayoutPage* pPage) const
+int32_t CXFA_LayoutPageMgr::GetPageIndex(IXFA_LayoutPage* pPage) const
{
return m_PageArray.Find((CXFA_ContainerLayoutItemImpl*)pPage);
}
@@ -807,7 +807,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_No if(pPageSet == NULL && pStartChild == NULL) {
return FALSE;
}
- FX_INT32 iPageSetCount = 0;
+ int32_t iPageSetCount = 0;
if(IsPageSetRootOrderedOccurrence()) {
return FindPageAreaFromPageSet_Ordered(pPageSet, pStartChild, pTargetPageArea, pTargetContentArea, bNewPage, bQuery);
}
@@ -816,10 +816,10 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_No }
FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea, FX_BOOL bNewPage, FX_BOOL bQuery)
{
- FX_INT32 iPageSetCount = 0;
+ int32_t iPageSetCount = 0;
if(!pStartChild && !bQuery) {
m_pPageSetMap.Lookup(pPageSet, iPageSetCount);
- FX_INT32 iMax = -1;
+ int32_t iMax = -1;
CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_ELEMENT_Occur);
if(pOccurNode) {
pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
@@ -965,7 +965,7 @@ FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any;
pPageArea->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven);
if (eOddOrEven != XFA_ATTRIBUTEENUM_Any) {
- FX_INT32 iPageCount = GetPageCount();
+ int32_t iPageCount = GetPageCount();
if (bLastMatch) {
return eOddOrEven == XFA_ATTRIBUTEENUM_Odd ? iPageCount % 2 == 1 : iPageCount % 2 == 0;
}
@@ -985,7 +985,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(CXFA_Node* pTargetPageArea, return m_pCurPageArea;
}
if(IsPageSetRootOrderedOccurrence()) {
- FX_INT32 iMax = -1;
+ int32_t iMax = -1;
CXFA_Node* pOccurNode = m_pCurPageArea->GetFirstChildByClass(XFA_ELEMENT_Occur);
if(pOccurNode) {
pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
@@ -1086,19 +1086,19 @@ void CXFA_LayoutPageMgr::InitPageSetMap() }
}
}
-FX_INT32 CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast)
+int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast)
{
if(pPageArea == NULL) {
return 0;
}
CXFA_Node* pOccurNode = pPageArea->GetFirstChildByClass(XFA_ELEMENT_Occur);
- FX_INT32 iMin = 0;
+ int32_t iMin = 0;
if((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) || bTargetPageArea) {
CXFA_Node* pContentArea = pPageArea->GetFirstChildByClass(XFA_ELEMENT_ContentArea);
if (iMin < 1 && bTargetPageArea && !pContentArea) {
iMin = 1;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
if(bCreateLast) {
i = m_nCurPageCount;
}
@@ -1115,7 +1115,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCr if(pPageSet == NULL) {
return;
}
- FX_INT32 iCurSetCount = 0;
+ int32_t iCurSetCount = 0;
if(!m_pPageSetMap.Lookup(pPageSet, iCurSetCount)) {
return;
}
@@ -1123,10 +1123,10 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCr iCurSetCount = 0;
}
CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_ELEMENT_Occur);
- FX_INT32 iMin = 0;
+ int32_t iMin = 0;
if(pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) {
if(iCurSetCount < iMin) {
- for(FX_INT32 i = 0; i < iMin - iCurSetCount; i++) {
+ for(int32_t i = 0; i < iMin - iCurSetCount; i++) {
for(CXFA_Node *pCurrentPageNode = pPageSet->GetNodeItem(XFA_NODEITEM_FirstChild); pCurrentPageNode; pCurrentPageNode = pCurrentPageNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if(pCurrentPageNode->GetClassID() == XFA_ELEMENT_PageArea) {
CreateMinPageRecord(pCurrentPageNode, FALSE);
@@ -1179,11 +1179,11 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) }
CXFA_Node* pPageNode = GetCurrentContainerRecord()->pCurPageArea->m_pFormNode;
CXFA_Node* pOccurNode = pPageNode->GetFirstChildByClass(XFA_ELEMENT_Occur);
- FX_INT32 iMax = 0;
+ int32_t iMax = 0;
if(pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) {
if(m_nCurPageCount == iMax) {
CXFA_Node* pSrcPage = m_pCurPageArea;
- FX_INT32 nSrcPageCount = m_nCurPageCount;
+ int32_t nSrcPageCount = m_nCurPageCount;
FX_POSITION psSrcRecord = m_rgProposedContainerRecord.GetTailPosition();
CXFA_Node* pNextPage = GetNextAvailPageArea(NULL, NULL, FALSE, TRUE);
m_pCurPageArea = pSrcPage;
@@ -1367,7 +1367,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() IXFA_DocLayout* pDocLayout = pDocument->GetDocLayout();
CXFA_ContainerLayoutItemImpl* pRootLayout = this->GetRootLayoutItem();
{
- for(FX_INT32 iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); iIndex ++) {
+ for(int32_t iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); iIndex ++) {
CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode> sIterator(pDocument->m_pPendingPageSet.GetAt(iIndex));
for(CXFA_Node *pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) {
if(pNode->IsContainerNode()) {
@@ -1381,7 +1381,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() }
}
}
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
CXFA_Node* pPendingPageSet = NULL;
for(; pRootLayout; pRootLayout = (CXFA_ContainerLayoutItemImpl* )pRootLayout->m_pNextSibling) {
pPendingPageSet = NULL;
@@ -1419,7 +1419,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() CXFA_ContainerLayoutItemImpl* pFormLayout = pContainerItem;
CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode;
FX_BOOL bIsExistForm = TRUE;
- for(FX_INT32 iLevel = 0; iLevel < 3; iLevel ++) {
+ for(int32_t iLevel = 0; iLevel < 3; iLevel ++) {
pFormLayout = (CXFA_ContainerLayoutItemImpl*)pFormLayout->m_pFirstChild;
if(iLevel == 2) {
while(pFormLayout && !XFA_ItemLayoutProcessor_IsTakingSpace(pFormLayout->m_pFormNode)) {
@@ -1535,7 +1535,7 @@ void CXFA_LayoutPageMgr::LayoutPageSetContents() }
}
}
-void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_LayoutItemImpl* pContainerItem, FX_DWORD dwRelevant, FX_BOOL bVisible, FX_INT32 nPageIndex)
+void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_LayoutItemImpl* pContainerItem, FX_DWORD dwRelevant, FX_BOOL bVisible, int32_t nPageIndex)
{
FX_BOOL bVisibleItem = FALSE;
FX_DWORD dwStatus = 0;
@@ -1548,7 +1548,7 @@ void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_La dwRelevantContainer = XFA_GetRelevant(pContainerItem->m_pFormNode, dwRelevant);
dwStatus = (bVisibleItem ? XFA_LAYOUTSTATUS_Visible : 0) | dwRelevantContainer;
}
- pNotify->OnLayoutEvent(pDocLayout, (CXFA_LayoutItem*)pContainerItem, XFA_LAYOUTEVENT_ItemAdded, (FX_LPVOID)(FX_UINTPTR)nPageIndex, (FX_LPVOID)(FX_UINTPTR)dwStatus);
+ pNotify->OnLayoutEvent(pDocLayout, (CXFA_LayoutItem*)pContainerItem, XFA_LAYOUTEVENT_ItemAdded, (FX_LPVOID)(uintptr_t)nPageIndex, (FX_LPVOID)(uintptr_t)dwStatus);
CXFA_LayoutItemImpl *pChild = pContainerItem->m_pFirstChild;
while (pChild) {
if (!pChild->IsContentLayoutItem()) {
@@ -1564,7 +1564,7 @@ void CXFA_LayoutPageMgr::SyncLayoutData() MergePageSetContents();
LayoutPageSetContents();
IXFA_Notify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify();
- FX_INT32 nPageIdx = -1;
+ int32_t nPageIdx = -1;
CXFA_ContainerLayoutItemImpl* pRootLayoutItem = this->GetRootLayoutItem();
for(; pRootLayoutItem; pRootLayoutItem = (CXFA_ContainerLayoutItemImpl*)pRootLayoutItem->m_pNextSibling) {
CXFA_NodeIteratorTemplate<CXFA_ContainerLayoutItemImpl, CXFA_TraverseStrategy_ContentAreaContainerLayoutItem> iteratorParent(pRootLayoutItem);
@@ -1592,8 +1592,8 @@ void CXFA_LayoutPageMgr::SyncLayoutData() }
}
}
- FX_INT32 nPage = m_PageArray.GetSize();
- for (FX_INT32 i = nPage - 1; i >= m_nAvailPages; i--) {
+ int32_t nPage = m_PageArray.GetSize();
+ for (int32_t i = nPage - 1; i >= m_nAvailPages; i--) {
CXFA_ContainerLayoutItemImpl* pPage = m_PageArray[i];
m_PageArray.RemoveAt(i);
pNotify->OnPageEvent((IXFA_LayoutPage*)pPage, XFA_PAGEEVENT_PageRemoved);
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h index 4faf9e30db..bf82a35323 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h @@ -29,9 +29,9 @@ public: void SubmitContentItem(CXFA_ContentLayoutItemImpl* pContentLayoutItem, XFA_ItemLayoutProcessorResult eStatus);
void FinishPaginatedPageSets();
void SyncLayoutData();
- FX_INT32 GetPageCount() const;
- IXFA_LayoutPage* GetPage(FX_INT32 index) const;
- FX_INT32 GetPageIndex(IXFA_LayoutPage* pPage) const;
+ int32_t GetPageCount() const;
+ IXFA_LayoutPage* GetPage(int32_t index) const;
+ int32_t GetPageIndex(IXFA_LayoutPage* pPage) const;
inline CXFA_ContainerLayoutItemImpl* GetRootLayoutItem() const
{
return m_pPageSetLayoutItemRoot;
@@ -59,7 +59,7 @@ protected: FX_BOOL ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode, FX_BOOL bLeader, CXFA_Node* &pBookendAppendTemplate);
FX_BOOL ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode, FX_BOOL bBefore, CXFA_Node* &pBreakLeaderTemplate, CXFA_Node* &pBreakTrailerTemplate);
- FX_INT32 CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast = FALSE);
+ int32_t CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast = FALSE);
void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE);
void CreateNextMinRecord(CXFA_Node* pRecordNode);
FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea = NULL, CXFA_Node* pTargetContentArea = NULL, FX_BOOL bNewPage = FALSE, FX_BOOL bQuery = FALSE);
@@ -86,11 +86,11 @@ protected: FX_POSITION m_pCurrentContainerRecord;
CFX_PtrList m_rgProposedContainerRecord;
CXFA_Node* m_pCurPageArea;
- FX_INT32 m_nAvailPages;
- FX_INT32 m_nCurPageCount;
+ int32_t m_nAvailPages;
+ int32_t m_nCurPageCount;
XFA_ATTRIBUTEENUM m_ePageSetMode;
FX_BOOL m_bCreateOverFlowPage;
- CFX_MapPtrTemplate<CXFA_Node*, FX_INT32> m_pPageSetMap;
+ CFX_MapPtrTemplate<CXFA_Node*, int32_t> m_pPageSetMap;
#ifdef _XFA_LAYOUTITEM_MAPCACHE_
void SaveLayoutItem(CXFA_LayoutItemImpl* pParentLayoutItem);
CFX_MapPtrToPtr m_NodeToContent;
diff --git a/xfa/src/fxfa/src/parser/xfa_locale.cpp b/xfa/src/fxfa/src/parser/xfa_locale.cpp index 52a1b4c265..83c61d1a72 100644 --- a/xfa/src/fxfa/src/parser/xfa_locale.cpp +++ b/xfa/src/fxfa/src/parser/xfa_locale.cpp @@ -93,11 +93,11 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const }
wsDtSymbol = pNumberSymbols->GetContent(0);
}
-void CXFA_XMLLocale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
+void CXFA_XMLLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
{
wsMonthName = GetCalendarSymbol(FX_BSTRC("month"), nMonth, bAbbr);
}
-void CXFA_XMLLocale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
+void CXFA_XMLLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
{
wsDayName = GetCalendarSymbol(FX_BSTRC("day"), nWeek, bAbbr);
}
@@ -208,8 +208,8 @@ void CXFA_XMLLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString }
void CXFA_XMLLocale::GetPattern(CXML_Element* pElement, FX_BSTR bsTag, FX_WSTR wsName, CFX_WideString& wsPattern) const
{
- FX_INT32 iCount = pElement->CountElements(FX_BSTRC(""), bsTag);
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = pElement->CountElements(FX_BSTRC(""), bsTag);
+ for (int32_t i = 0; i < iCount; i++) {
CXML_Element* pChild = pElement->GetElement(FX_BSTRC(""), bsTag, i);
if (pChild->GetAttrValue(FX_BSTRC("name")) == wsName) {
wsPattern = pChild->GetContent(0);
@@ -263,11 +263,11 @@ void CXFA_NodeLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const CXFA_Node *pSymbols = m_pLocale ? m_pLocale->GetChild(0, XFA_ELEMENT_DateTimeSymbols) : NULL;
wsDtSymbol = pSymbols ? pSymbols->GetContent() : CFX_WideString();
}
-void CXFA_NodeLocale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
+void CXFA_NodeLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
{
wsMonthName = GetCalendarSymbol(XFA_ELEMENT_MonthNames, nMonth, bAbbr);
}
-void CXFA_NodeLocale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
+void CXFA_NodeLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
{
wsDayName = GetCalendarSymbol(XFA_ELEMENT_DayNames, nWeek, bAbbr);
}
diff --git a/xfa/src/fxfa/src/parser/xfa_locale.h b/xfa/src/fxfa/src/parser/xfa_locale.h index ccea088741..2df6201c56 100644 --- a/xfa/src/fxfa/src/parser/xfa_locale.h +++ b/xfa/src/fxfa/src/parser/xfa_locale.h @@ -15,8 +15,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const;
virtual void GetTimeZone(FX_TIMEZONE& tz) const;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const;
@@ -41,8 +41,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const;
virtual void GetTimeZone(FX_TIMEZONE& tz) const;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const;
diff --git a/xfa/src/fxfa/src/parser/xfa_localemgr.cpp b/xfa/src/fxfa/src/parser/xfa_localemgr.cpp index 8c56c95dc9..cc136ae2ac 100644 --- a/xfa/src/fxfa/src/parser/xfa_localemgr.cpp +++ b/xfa/src/fxfa/src/parser/xfa_localemgr.cpp @@ -17,7 +17,7 @@ #include "../common/xfa_fm2jsapi.h"
#include "xfa_debug_parser.h"
#include "xfa_locale.h"
-const FX_BYTE g_enUS_Locale[] = {
+const uint8_t g_enUS_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0x9B, 0x30, 0x14, 0x7D, 0x9F, 0xB4, 0x7F, 0x40, 0xD6, 0x2A, 0xB5, 0x52, 0x56, 0x6F,
0x8F, 0xA9, 0x88, 0xA5, 0x6C, 0x24, 0x9B, 0x3A, 0xD1, 0x55, 0x22, 0x55, 0xB5, 0xBE, 0x4C, 0x0E, 0xDC, 0x05, 0x34, 0xB0,
0x23, 0x83, 0x37, 0x05, 0xED, 0xE3, 0x67, 0x07, 0xC3, 0xC0, 0xF6, 0x24, 0xC2, 0x4B, 0x7C, 0xCF, 0x3D, 0xE7, 0xE6, 0xDE,
@@ -51,7 +51,7 @@ const FX_BYTE g_enUS_Locale[] = { 0x20, 0xF2, 0x94, 0x44, 0xB3, 0x45, 0x63, 0xCB, 0x5D, 0x09, 0xB6, 0x7B, 0xD5, 0x58, 0xF7, 0x55, 0xA4, 0x96, 0x7F, 0x01,
0x75, 0x37, 0x1B, 0x8B,
};
-const FX_BYTE g_enGB_Locale[] = {
+const uint8_t g_enGB_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0xD3, 0x30, 0x14, 0x7D, 0x47, 0xE2, 0x1F, 0xA2, 0x88, 0x49, 0x20, 0x6D, 0x33, 0x3C,
0x6E, 0xEA, 0x2C, 0x75, 0xEB, 0xD6, 0x32, 0xC8, 0xA8, 0x48, 0xC5, 0xC4, 0x5E, 0x90, 0x9B, 0x78, 0x8D, 0x59, 0x62, 0x57,
0x4E, 0xCC, 0x94, 0xFC, 0x02, 0x9F, 0xC0, 0x23, 0xCF, 0x08, 0xF1, 0x01, 0xBC, 0xF0, 0x2F, 0x48, 0xFB, 0x0C, 0x6E, 0x1A,
@@ -91,7 +91,7 @@ const FX_BYTE g_enGB_Locale[] = { 0xF7, 0x5B, 0x7E, 0x14, 0x98, 0xAB, 0x72, 0x32, 0xE7, 0xED, 0x16, 0x92, 0x2F, 0x06, 0x90, 0xBC, 0x5C, 0xF1, 0xD5, 0x67,
0xB1, 0xE1, 0xE9, 0xE6, 0xD0, 0xFD, 0x9E, 0x95, 0x51, 0xF5, 0x19, 0x0B, 0xCB, 0x7F, 0x8E, 0x69, 0xAC, 0xD0
};
-const FX_BYTE g_zhCN_Locale[] = {
+const uint8_t g_zhCN_Locale[] = {
0x78, 0x9C, 0xED, 0x56, 0x41, 0x4F, 0xD4, 0x40, 0x14, 0xBE, 0x9B, 0xF8, 0x1F, 0x9A, 0x46, 0x52, 0x4D, 0x58, 0x46, 0x8F,
0x90, 0xD2, 0x64, 0x03, 0x08, 0x06, 0xBB, 0x21, 0x96, 0x68, 0xE0, 0x62, 0xBA, 0xED, 0xB0, 0x2D, 0x6C, 0x3B, 0x64, 0xB6,
0x0D, 0x6E, 0x4F, 0x18, 0x82, 0x82, 0xC2, 0x45, 0x89, 0x9A, 0x80, 0xE1, 0x64, 0x3C, 0x28, 0x9E, 0x8C, 0x01, 0x22, 0xF1,
@@ -133,7 +133,7 @@ const FX_BYTE g_zhCN_Locale[] = { 0x43, 0x12, 0xEA, 0x93, 0x21, 0x9B, 0x02, 0x73, 0xD8, 0x68, 0x39, 0xA9, 0x1D, 0xFA, 0x8D, 0x55, 0xD2, 0xE3, 0xF1, 0x7D,
0xD1, 0xCD, 0x33, 0x63, 0x51, 0xFC, 0x15, 0x0D, 0xCB, 0xBF, 0xC0, 0xE4, 0x3D, 0x40
};
-const FX_BYTE g_zhTW_Locale[] = {
+const uint8_t g_zhTW_Locale[] = {
0x78, 0x9C, 0xED, 0x57, 0xCD, 0x4F, 0xD4, 0x40, 0x14, 0x3F, 0x63, 0xE2, 0xFF, 0x30, 0x69, 0x20, 0xD5, 0x04, 0xA8, 0x1E,
0x21, 0xA5, 0xC9, 0xC6, 0x45, 0x30, 0x58, 0x42, 0xEC, 0x46, 0x22, 0x17, 0x33, 0xDB, 0x0E, 0xDB, 0xC2, 0xB6, 0x43, 0x66,
0xDB, 0xC0, 0xF6, 0x24, 0x12, 0x14, 0x14, 0x62, 0xA2, 0xC4, 0x8F, 0x80, 0xE1, 0x64, 0x3C, 0x28, 0x89, 0x07, 0x0F, 0x2C,
@@ -176,7 +176,7 @@ const FX_BYTE g_zhTW_Locale[] = { 0xF0, 0x6A, 0x0D, 0x5F, 0x21, 0x77, 0xF4, 0x2A, 0x6D, 0xCF, 0x69, 0xAC, 0xE0, 0x00, 0x19, 0xDE, 0x1E, 0x2C, 0xB6, 0xD4,
0x7B, 0xCA, 0x52, 0xF8, 0x67, 0x41, 0xF9, 0x03, 0x11, 0xC2, 0x4A, 0xC9
};
-const FX_BYTE g_zhHK_Locale[] = {
+const uint8_t g_zhHK_Locale[] = {
0x78, 0x9C, 0xA5, 0x57, 0x4D, 0x4F, 0x13, 0x41, 0x18, 0x3E, 0x63, 0xE2, 0x7F, 0x98, 0x6C, 0x20, 0x0B, 0x09, 0x50, 0x8A,
0x9F, 0x25, 0xCB, 0x26, 0x44, 0x90, 0x9A, 0x5A, 0x43, 0x2C, 0xD1, 0xC8, 0xC5, 0x6C, 0x77, 0x87, 0xEE, 0x42, 0x77, 0x87,
0x4C, 0xB7, 0xC1, 0x6E, 0x3C, 0x88, 0x04, 0xA5, 0x5A, 0x2E, 0x4A, 0x54, 0x02, 0x86, 0x78, 0x50, 0x0F, 0x48, 0xBC, 0x78,
@@ -222,7 +222,7 @@ const FX_BYTE g_zhHK_Locale[] = { 0x52, 0xAB, 0x1A, 0xA5, 0x15, 0x64, 0x33, 0x9D, 0xDD, 0xED, 0x47, 0x2E, 0x70, 0x9E, 0x42, 0xCA, 0xF9, 0x27, 0x42, 0xFC,
0x0B, 0xD9, 0x0E, 0x4B, 0xED
};
-const FX_BYTE g_jaJP_Locale[] = {
+const uint8_t g_jaJP_Locale[] = {
0x78, 0x9C, 0xED, 0x56, 0xCB, 0x6E, 0xD3, 0x40, 0x14, 0x5D, 0x17, 0x89, 0x7F, 0x18, 0x59, 0x20, 0x83, 0xD4, 0xD6, 0x0D,
0xEF, 0x56, 0xAE, 0xA5, 0x8A, 0x96, 0x86, 0x16, 0xA3, 0x08, 0x57, 0xA0, 0x76, 0x83, 0x26, 0xF6, 0x34, 0x99, 0x36, 0x9E,
0xA9, 0x26, 0xB6, 0x4A, 0xBC, 0xE2, 0x21, 0x20, 0x48, 0x74, 0x01, 0x1B, 0x04, 0x44, 0x62, 0x55, 0x40, 0x02, 0x04, 0x8B,
@@ -264,7 +264,7 @@ const FX_BYTE g_jaJP_Locale[] = { 0xC6, 0xD2, 0x0C, 0x5A, 0x8A, 0xA6, 0x77, 0x5C, 0xD2, 0xD8, 0xA2, 0x3E, 0x33, 0x18, 0x89, 0x7F, 0xAA, 0x25, 0xE6, 0xA9,
0x2A, 0xC1, 0x87, 0xBD, 0xF6, 0x17, 0x6C, 0x42, 0x08, 0x21
};
-const FX_BYTE g_koKR_Locale[] = {
+const uint8_t g_koKR_Locale[] = {
0x78, 0x9C, 0xED, 0x56, 0x4D, 0x6B, 0xD4, 0x40, 0x18, 0x3E, 0x57, 0xF0, 0x3F, 0x0C, 0xC1, 0x12, 0x85, 0x76, 0xB7, 0xEB,
0x77, 0x4B, 0x1A, 0x28, 0x6E, 0x6D, 0x65, 0x8D, 0x94, 0xA6, 0x58, 0xEC, 0x45, 0x66, 0x93, 0xE9, 0x26, 0xED, 0x26, 0x53,
0x26, 0x09, 0x75, 0x73, 0xAE, 0x52, 0xF0, 0xE2, 0xA1, 0x87, 0xEA, 0x6E, 0xB1, 0x07, 0x11, 0x2A, 0x88, 0x22, 0x22, 0x1E,
@@ -307,7 +307,7 @@ const FX_BYTE g_koKR_Locale[] = { 0x3E, 0x9A, 0x72, 0x3B, 0x81, 0xDD, 0xF7, 0x47, 0xD2, 0x64, 0x9C, 0xA1, 0x05, 0x53, 0x2D, 0x75, 0x9E, 0x42, 0x3D, 0xFC,
0xFC, 0x17, 0xFF, 0x01, 0xDC, 0xF1, 0x18, 0xD3
};
-const FX_BYTE g_esES_Locale[] = {
+const uint8_t g_esES_Locale[] = {
0x78, 0x9C, 0x9D, 0x56, 0xCF, 0x6B, 0xD4, 0x40, 0x14, 0xBE, 0x0B, 0xFE, 0x0F, 0x21, 0x58, 0x56, 0xA1, 0xDD, 0xD1, 0x63,
0xCB, 0x36, 0x50, 0xDA, 0xDA, 0x95, 0x1A, 0x59, 0x9A, 0xAA, 0xD8, 0x8B, 0x4C, 0x92, 0xE9, 0xEE, 0xB4, 0xC9, 0xCC, 0x32,
0x49, 0x2C, 0x9B, 0xA3, 0xE0, 0x41, 0x10, 0x0B, 0xDE, 0x8A, 0x27, 0x0F, 0x1E, 0x04, 0x8B, 0x77, 0x51, 0x3C, 0xF4, 0x3F,
@@ -350,7 +350,7 @@ const FX_BYTE g_esES_Locale[] = { 0x43, 0x39, 0x99, 0xF1, 0x70, 0x01, 0xC9, 0xE1, 0x2D, 0x48, 0xF6, 0x24, 0x61, 0xC3, 0x23, 0x3E, 0xE5, 0xA9, 0xE6, 0xD0,
0x6C, 0xCF, 0x64, 0x94, 0xFD, 0xFC, 0xC2, 0xF2, 0x2F, 0x7C, 0xDC, 0xCC, 0x2F,
};
-const FX_BYTE g_esLA_Locale[] = {
+const uint8_t g_esLA_Locale[] = {
0x78, 0x9C, 0x9D, 0x56, 0xCD, 0x4E, 0xDC, 0x30, 0x10, 0x3E, 0x53, 0xA9, 0xEF, 0x60, 0x45, 0x45, 0x80, 0x04, 0x9B, 0xF6,
0xB8, 0x28, 0x44, 0x5A, 0x01, 0xA5, 0x15, 0x0D, 0x5A, 0x75, 0x51, 0x4B, 0xB9, 0x54, 0x4E, 0x62, 0x36, 0x86, 0xC4, 0x5E,
0x39, 0x09, 0x68, 0xA3, 0xBE, 0x40, 0x4F, 0x3D, 0xF4, 0xD4, 0x63, 0x2B, 0x21, 0xB5, 0x07, 0xD4, 0x47, 0xE8, 0x81, 0x67,
@@ -393,7 +393,7 @@ const FX_BYTE g_esLA_Locale[] = { 0xD6, 0x3C, 0x66, 0xD3, 0x73, 0x9E, 0x31, 0xF3, 0x22, 0xB3, 0x11, 0x57, 0x3B, 0x4F, 0x43, 0xCF, 0x3F, 0xEF, 0xCD, 0xBF,
0xC4, 0xB5, 0xD4, 0x04
};
-const FX_BYTE g_deDE_Loacale[] = {
+const uint8_t g_deDE_Loacale[] = {
0x78, 0x9C, 0x95, 0x56, 0x4D, 0x6F, 0xD4, 0x30, 0x10, 0xBD, 0x23, 0xF1, 0x1F, 0xAC, 0x88, 0xAA, 0x20, 0xB5, 0x1B, 0x38,
0xB6, 0xDA, 0x46, 0x5A, 0x75, 0xFB, 0x41, 0x4B, 0xCA, 0xAA, 0x69, 0x41, 0xF4, 0x82, 0xBC, 0x89, 0xBB, 0x71, 0x9B, 0xD8,
0x2B, 0xC7, 0x69, 0xB5, 0x39, 0xF2, 0x37, 0xB8, 0x72, 0x04, 0x71, 0xE4, 0x04, 0x17, 0xFE, 0x09, 0x52, 0x25, 0x7E, 0x06,
@@ -434,7 +434,7 @@ const FX_BYTE g_deDE_Loacale[] = { 0x0A, 0xCC, 0x59, 0x39, 0x19, 0x7A, 0xB3, 0x82, 0x04, 0x6F, 0xFA, 0xC7, 0x49, 0xFE, 0x22, 0x67, 0xB3, 0x2B, 0xBE, 0xE4,
0xA9, 0xE6, 0xDC, 0xFB, 0x3D, 0x2B, 0xA3, 0xEA, 0x73, 0x16, 0x96, 0xFF, 0x00, 0x29, 0x27, 0xAF, 0x17,
};
-const FX_BYTE g_frFR_Locale[] = {
+const uint8_t g_frFR_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0x4D, 0x6F, 0xD3, 0x40, 0x10, 0xBD, 0x23, 0xF1, 0x1F, 0x56, 0x16, 0x55, 0x41, 0x6A, 0xBD, 0x70,
0x4C, 0x95, 0x5A, 0xAA, 0xFA, 0x15, 0x28, 0x46, 0x51, 0x53, 0x40, 0xF4, 0x82, 0x36, 0xF6, 0x36, 0xDE, 0xD4, 0xDE, 0x8D,
0xD6, 0x76, 0x4A, 0x7C, 0xE4, 0x3F, 0x70, 0xE2, 0xC2, 0xB5, 0x12, 0x88, 0x03, 0x47, 0xC4, 0x85, 0xFE, 0x13, 0x24, 0x10,
@@ -476,7 +476,7 @@ const FX_BYTE g_frFR_Locale[] = { 0x7A, 0xBE, 0x86, 0x34, 0x12, 0x1D, 0x48, 0xEE, 0x22, 0xE5, 0x93, 0xA9, 0x58, 0xF2, 0x54, 0x73, 0xF8, 0x76, 0xCF, 0xF2,
0xA8, 0xF8, 0xD2, 0x85, 0xE5, 0x3F, 0x5D, 0x49, 0xBE, 0x1B
};
-const FX_BYTE g_itIT_Locale[] = {
+const uint8_t g_itIT_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6A, 0xD4, 0x40, 0x14, 0x7D, 0x17, 0xFC, 0x87, 0x21, 0x58, 0x50, 0x68, 0x3B, 0xFA, 0xD8,
0x92, 0x06, 0x4A, 0x5B, 0xBB, 0xA5, 0x46, 0x96, 0xEE, 0xAA, 0xD8, 0x17, 0x99, 0x64, 0xA6, 0xD9, 0xB1, 0xC9, 0xCC, 0x32,
0x49, 0x5A, 0x92, 0x47, 0xF1, 0xC1, 0x37, 0x7F, 0x42, 0x10, 0x41, 0xF1, 0x23, 0xFC, 0x13, 0xA1, 0xE2, 0x67, 0x78, 0xB3,
@@ -517,7 +517,7 @@ const FX_BYTE g_itIT_Locale[] = { 0x53, 0x60, 0x46, 0xD5, 0x64, 0xE8, 0xC5, 0x1A, 0xD2, 0x4C, 0x8E, 0x20, 0xF9, 0x45, 0x2E, 0xA2, 0xF7, 0x72, 0xC5, 0xD3,
0xCD, 0xE1, 0xDB, 0x3D, 0xAB, 0xA2, 0xFA, 0xD3, 0x16, 0x96, 0xFF, 0x00, 0x20, 0x8B, 0xBE, 0xF7
};
-const FX_BYTE g_ptBR_Locale[] = {
+const uint8_t g_ptBR_Locale[] = {
0x78, 0x9C, 0x9D, 0x56, 0x3D, 0x6F, 0xD4, 0x40, 0x10, 0xAD, 0x83, 0xC4, 0x7F, 0x58, 0x59, 0x89, 0x0E, 0xA4, 0x24, 0x86,
0x92, 0xC8, 0x67, 0xE9, 0x92, 0x0B, 0x39, 0x94, 0x18, 0x9D, 0xCE, 0x11, 0x88, 0x34, 0x68, 0x6D, 0xEF, 0xD9, 0x9B, 0xD8,
0xBB, 0xC7, 0xDA, 0x4E, 0xB0, 0x6B, 0x1A, 0x3A, 0x28, 0x29, 0x53, 0x20, 0x2A, 0x44, 0x83, 0x44, 0x49, 0x91, 0xDF, 0x82,
@@ -560,7 +560,7 @@ const FX_BYTE g_ptBR_Locale[] = { 0xD6, 0x4E, 0xAA, 0x04, 0x67, 0xBD, 0x30, 0x9D, 0x0E, 0x82, 0x69, 0x51, 0x48, 0xEC, 0x4B, 0x9A, 0x22, 0xB3, 0x24, 0xD3,
0xC1, 0x56, 0x39, 0x4F, 0x45, 0xCE, 0xFE, 0xF7, 0xD5, 0x3F, 0x30, 0xBB, 0xD9, 0x9B
};
-const FX_BYTE g_nlNL_Locale[] = {
+const uint8_t g_nlNL_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0x4D, 0x4F, 0xDC, 0x30, 0x10, 0x3D, 0x53, 0xA9, 0xFF, 0xC1, 0x8A, 0x8A, 0x68, 0x25, 0x96, 0x2D,
0x47, 0x50, 0x88, 0xB4, 0x05, 0x0A, 0x15, 0x04, 0xAD, 0x58, 0xDA, 0xAA, 0x5C, 0x2A, 0x6F, 0x62, 0x76, 0xBD, 0x24, 0xF6,
0xCA, 0x89, 0x41, 0xC9, 0xB1, 0x52, 0x8F, 0xFD, 0x27, 0xAD, 0xDA, 0x5B, 0xFF, 0x4F, 0xA5, 0x4A, 0xFC, 0x8C, 0x8E, 0xF3,
@@ -601,7 +601,7 @@ const FX_BYTE g_nlNL_Locale[] = { 0xF6, 0xFE, 0x34, 0x70, 0x17, 0xAA, 0x4B, 0x74, 0xDE, 0x4B, 0x9B, 0xF1, 0x41, 0x34, 0x37, 0x91, 0x6C, 0xB1, 0xE2, 0x19,
0x33, 0x2F, 0x32, 0x1B, 0x6D, 0xB5, 0xF3, 0xB4, 0xC7, 0xF9, 0xA7, 0xBA, 0xF3, 0x0F, 0xD5, 0xFA, 0xC0, 0xFA
};
-const FX_BYTE g_ruRU_Locale[] = {
+const uint8_t g_ruRU_Locale[] = {
0x78, 0x9C, 0xAD, 0x57, 0x4D, 0x4F, 0x13, 0x41, 0x18, 0x3E, 0x63, 0xE2, 0x7F, 0x98, 0x6C, 0x24, 0x68, 0x02, 0xAD, 0x1E,
0x25, 0x65, 0x13, 0x22, 0x0A, 0x06, 0xD7, 0x90, 0x16, 0x34, 0x72, 0x31, 0xDB, 0xDD, 0xA1, 0x5D, 0xE8, 0xEE, 0x90, 0xE9,
0x6E, 0xB0, 0x7B, 0x2A, 0x85, 0xE8, 0x05, 0x25, 0xE1, 0xA0, 0x47, 0xF4, 0xE4, 0xC9, 0x50, 0xBE, 0x12, 0x82, 0xB6, 0x24,
@@ -753,12 +753,12 @@ CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid) }
CXFA_LocaleMgr::~CXFA_LocaleMgr()
{
- FX_INT32 iCount = m_LocaleArray.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = m_LocaleArray.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
((IFX_Locale*)m_LocaleArray[i])->Release();
}
- FX_INT32 iXmls = m_XMLLocaleArray.GetSize();
- for (FX_INT32 j = 0; j < iXmls; j++) {
+ int32_t iXmls = m_XMLLocaleArray.GetSize();
+ for (int32_t j = 0; j < iXmls; j++) {
((IFX_Locale*)m_XMLLocaleArray[j])->Release();
}
}
@@ -840,15 +840,15 @@ IFX_Locale* CXFA_LocaleMgr::GetLocale(FX_WORD lcid) }
IFX_Locale* CXFA_LocaleMgr::GetLocaleByName(FX_WSTR wsLocaleName)
{
- FX_INT32 iCount = m_LocaleArray.GetSize();
- FX_INT32 i = 0;
+ int32_t iCount = m_LocaleArray.GetSize();
+ int32_t i = 0;
for (i = 0; i < iCount; i++) {
IFX_Locale* pLocale = ((IFX_Locale*)m_LocaleArray[i]);
if (pLocale->GetName() == wsLocaleName) {
return pLocale;
}
}
- FX_INT32 iLen = wsLocaleName.GetLength();
+ int32_t iLen = wsLocaleName.GetLength();
if (iLen < 2) {
return NULL;
}
@@ -913,12 +913,12 @@ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() {
#if _FXM_PLATFORM_==_FXM_PLATFORM_WINDOWS_
_tzset();
- m_tz.tzHour = (FX_INT8)(_timezone / 3600 * -1);
- m_tz.tzMinute = (FX_INT8)((FXSYS_abs(_timezone) % 3600) / 60);
+ m_tz.tzHour = (int8_t)(_timezone / 3600 * -1);
+ m_tz.tzMinute = (int8_t)((FXSYS_abs(_timezone) % 3600) / 60);
#else
tzset();
- m_tz.tzHour = (FX_INT8)(timezone / 3600 * -1);
- m_tz.tzMinute = (FX_INT8)((FXSYS_abs((int)timezone) % 3600) / 60);
+ m_tz.tzHour = (int8_t)(timezone / 3600 * -1);
+ m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60);
#endif
}
CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider()
diff --git a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp index 46ea47dc5d..3f9d066122 100644 --- a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp +++ b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp @@ -100,8 +100,8 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, const CFX CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsPattern, wsPatterns);
FX_BOOL bRet = FALSE;
- FX_INT32 iCount = wsPatterns.GetSize();
- FX_INT32 i = 0;
+ int32_t iCount = wsPatterns.GetSize();
+ int32_t i = 0;
for (; i < iCount && !bRet; i++) {
CFX_WideString wsFormat = wsPatterns[i];
FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat);
@@ -199,9 +199,9 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const {
if (m_bValid && (m_dwType == XFA_VT_BOOLEAN || m_dwType == XFA_VT_INTEGER ||
m_dwType == XFA_VT_DECIMAL || m_dwType == XFA_VT_FLOAT)) {
- FX_INT64 nIntegral = 0;
+ int64_t nIntegral = 0;
FX_DWORD dwFractional = 0;
- FX_INT32 nExponent = 0;
+ int32_t nExponent = 0;
int cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue;
@@ -275,10 +275,10 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const {
if (m_bValid && (m_dwType == XFA_VT_BOOLEAN || m_dwType == XFA_VT_INTEGER ||
m_dwType == XFA_VT_DECIMAL || m_dwType == XFA_VT_FLOAT)) {
- FX_INT64 nIntegral = 0;
+ int64_t nIntegral = 0;
FX_DWORD dwFractional = 0;
- FX_INT32 nExponent = 0;
- FX_INT32 cc = 0;
+ int32_t nExponent = 0;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue;
int len = m_wsValue.GetLength();
@@ -294,7 +294,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.' || !XFA_IsDigit(str[cc]) || nIntegralLen > 17) {
break;
@@ -304,7 +304,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const nIntegralLen++;
}
nIntegral = bNegative ? -nIntegral : nIntegral;
- FX_INT32 scale = 0;
+ int32_t scale = 0;
FX_DOUBLE fraction = 0.0;
if (cc < len && str[cc] == '.') {
cc ++;
@@ -369,7 +369,7 @@ CFX_Unitime CXFA_LocaleValue::GetTime() const CFX_Unitime CXFA_LocaleValue::GetDateTime() const
{
if (m_bValid && m_dwType == XFA_VT_DATETIME) {
- FX_INT32 index = m_wsValue.Find('T');
+ int32_t index = m_wsValue.Find('T');
CFX_Unitime dt;
FX_DateFromCanonical(m_wsValue.Left(index), dt);
FXSYS_assert(m_pLocaleMgr);
@@ -454,8 +454,8 @@ FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, const CFX_Wid IFX_FormatString* pFormat = IFX_FormatString::Create(m_pLocaleMgr, FALSE);
CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsFormat, wsPatterns);
- FX_INT32 iCount = wsPatterns.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = wsPatterns.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
bRet = FormatSinglePattern(wsResult, wsPatterns[i], pLocale, eValueType);
if (bRet) {
break;
@@ -650,7 +650,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, CF return FALSE;
}
CFX_Unitime ut;
- ut.Set(wYear, static_cast<FX_BYTE>(wMonth), static_cast<FX_BYTE>(wDay));
+ ut.Set(wYear, static_cast<uint8_t>(wMonth), static_cast<uint8_t>(wDay));
unDate = unDate + ut;
return TRUE;
}
@@ -718,7 +718,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) if (pTime[nIndex] == 'Z') {
nIndex++;
} else if (pTime[nIndex] == '-' || pTime[nIndex] == '+') {
- FX_SHORT nOffsetH = 0, nOffsetM = 0;
+ int16_t nOffsetH = 0, nOffsetM = 0;
nIndex++;
nStart = nIndex;
while (pTime[nIndex] != '\0' && nIndex - nStart < wCountH && nIndex < nLen) {
@@ -796,8 +796,8 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, const CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsPattern, wsPatterns);
FX_BOOL bRet = FALSE;
- FX_INT32 iCount = wsPatterns.GetSize();
- for (FX_INT32 i = 0; i < iCount && !bRet; i++) {
+ int32_t iCount = wsPatterns.GetSize();
+ for (int32_t i = 0; i < iCount && !bRet; i++) {
CFX_WideString wsFormat = wsPatterns[i];
FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat);
eCategory = XFA_ValugeCategory(eCategory, m_dwType);
@@ -867,17 +867,17 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, const }
return bRet;
}
-void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nIntLen, FX_INT32 nDecLen, FX_BOOL bSign )
+void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, int32_t nIntLen, int32_t nDecLen, FX_BOOL bSign )
{
FXSYS_assert(wsFormat.IsEmpty());
FXSYS_assert(nIntLen >= -1 && nDecLen >= -1);
- FX_INT32 nTotalLen \
+ int32_t nTotalLen \
= (nIntLen >= 0 ? nIntLen : 2) \
+ (bSign ? 1 : 0) \
+ (nDecLen >= 0 ? nDecLen : 2) \
+ (nDecLen == 0 ? 0 : 1);
FX_LPWSTR lpBuf = wsFormat.GetBuffer(nTotalLen);
- FX_INT32 nPos = 0;
+ int32_t nPos = 0;
if (bSign) {
lpBuf[nPos++] = L's';
}
@@ -904,14 +904,14 @@ void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nInt }
wsFormat.ReleaseBuffer(nTotalLen);
}
-FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale , FX_INT32* pos )
+FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale , int32_t* pos )
{
if (wsFormat.IsEmpty() || wsNumeric.IsEmpty()) {
return TRUE;
}
FX_LPCWSTR pNum = FX_LPCWSTR(wsNumeric);
FX_LPCWSTR pFmt = FX_LPCWSTR(wsFormat);
- FX_INT32 n = 0, nf = 0;
+ int32_t n = 0, nf = 0;
FX_WCHAR c = pNum[n];
FX_WCHAR cf = pFmt[nf];
if (cf == L's') {
@@ -921,8 +921,8 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_Wid ++nf;
}
FX_BOOL bLimit = TRUE;
- FX_INT32 nCount = wsNumeric.GetLength();
- FX_INT32 nCountFmt = wsFormat.GetLength();
+ int32_t nCount = wsNumeric.GetLength();
+ int32_t nCountFmt = wsFormat.GetLength();
while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) && XFA_IsDigit(c = pNum[n])) {
if (bLimit == TRUE) {
if ((cf = pFmt[nf]) == L'*') {
diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index f275780952..153110492f 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -29,7 +29,7 @@ void CXFA_Object::GetClassName(CFX_WideStringC &wsName) const ASSERT(pElement != NULL);
wsName = pElement->pName;
}
-FX_UINT32 CXFA_Object::GetClassHashCode() const
+uint32_t CXFA_Object::GetClassHashCode() const
{
XFA_LPCELEMENTINFO pElement = XFA_GetElementByID(GetClassID());
ASSERT(pElement != NULL);
@@ -59,7 +59,7 @@ void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, FX_BOOL bSet ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
}
-void CXFA_Object::ThrowScriptErrorMessage(FX_INT32 iStringID, ...)
+void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...)
{
IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider();
FXSYS_assert(pAppProvider);
@@ -225,7 +225,7 @@ CXFA_Node* CXFA_Node::GetNodeItem(XFA_NODEITEM eItem, XFA_OBJECTTYPE eType) cons }
return pNode;
}
-FX_INT32 CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , XFA_ELEMENT eElementFilter , FX_INT32 iLevel )
+int32_t CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , XFA_ELEMENT eElementFilter , int32_t iLevel )
{
if (--iLevel < 0) {
return nodes.GetSize();
@@ -273,12 +273,12 @@ FX_INT32 CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , X pChild = pChild->m_pNext;
}
if (bFilterOneOfProperties && nodes.GetSize() < 1) {
- FX_INT32 iProperties = 0;
+ int32_t iProperties = 0;
XFA_LPCPROPERTY pProperty = XFA_GetElementProperties(GetClassID(), iProperties);
if (pProperty == NULL || iProperties < 1) {
return 0;
}
- for (FX_INT32 i = 0; i < iProperties; i++) {
+ for (int32_t i = 0; i < iProperties; i++) {
if (pProperty[i].uFlags & XFA_PROPERTYFLAG_DefaultOneOf) {
IXFA_ObjFactory *pFactory = m_pDocument->GetParser()->GetFactory();
XFA_LPCPACKETINFO pPacket = XFA_GetPacketByID(GetPacketID());
@@ -335,7 +335,7 @@ CXFA_Node* CXFA_Node::GetBindData() ASSERT(GetPacketID() == XFA_XDPPACKET_Form);
return (CXFA_Node*)GetObject(XFA_ATTRIBUTE_BindingNode);
}
-FX_INT32 CXFA_Node::GetBindItems(CXFA_NodeArray& formItems)
+int32_t CXFA_Node::GetBindItems(CXFA_NodeArray& formItems)
{
if (m_uFlags & XFA_NODEFLAG_BindFormItems) {
CXFA_NodeArray* pItems = NULL;
@@ -356,7 +356,7 @@ static void XFA_DataNodeDeleteBindItem(FX_LPVOID pData) }
}
static XFA_MAPDATABLOCKCALLBACKINFO deleteBindItemCallBack = {XFA_DataNodeDeleteBindItem, NULL};
-FX_INT32 CXFA_Node::AddBindItem(CXFA_Node* pFormNode)
+int32_t CXFA_Node::AddBindItem(CXFA_Node* pFormNode)
{
ASSERT(pFormNode);
if (m_uFlags & XFA_NODEFLAG_BindFormItems) {
@@ -382,14 +382,14 @@ FX_INT32 CXFA_Node::AddBindItem(CXFA_Node* pFormNode) m_uFlags |= XFA_NODEFLAG_BindFormItems;
return 2;
}
-FX_INT32 CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode)
+int32_t CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode)
{
if (m_uFlags & XFA_NODEFLAG_BindFormItems) {
CXFA_NodeArray* pItems = NULL;
TryObject(XFA_ATTRIBUTE_BindingNode, (FX_LPVOID&)pItems);
ASSERT(pItems);
- FX_INT32 iIndex = pItems->Find(pFormNode);
- FX_INT32 iCount = pItems->GetSize();
+ int32_t iIndex = pItems->Find(pFormNode);
+ int32_t iCount = pItems->GetSize();
if (iIndex >= 0) {
if (iIndex != iCount - 1) {
pItems->SetAt(iIndex, pItems->GetAt(iCount - 1));
@@ -451,7 +451,7 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() pFieldWidgetData = NULL;
CXFA_NodeArray formNodes;
pDataNode->GetBindItems(formNodes);
- for (FX_INT32 i = 0; i < formNodes.GetSize(); i++) {
+ for (int32_t i = 0; i < formNodes.GetSize(); i++) {
CXFA_Node* pFormNode = formNodes.GetAt(i);
if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) {
continue;
@@ -600,7 +600,7 @@ void CXFA_Node::SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode) }
void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNode");
return;
@@ -618,7 +618,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) }
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag);
if (iRet < 1) {
return FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -641,7 +641,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNodes");
return;
@@ -670,10 +670,10 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, CFX_WideString w if(refNode == NULL) {
refNode = this;
}
- FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag);
CXFA_ArrayNodeList* pNodeList = FX_NEW CXFA_ArrayNodeList(m_pDocument);
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
- for (FX_INT32 i = 0; i < resoveNodeRS.nodes.GetSize(); i++) {
+ for (int32_t i = 0; i < resoveNodeRS.nodes.GetSize(); i++) {
if (resoveNodeRS.nodes[i]->IsNode()) {
pNodeList->Append((CXFA_Node*)resoveNodeRS.nodes[i]);
}
@@ -683,7 +683,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, CFX_WideString w if (resoveNodeRS.GetAttributeResult(hValueArray) > 0) {
CXFA_ObjArray objectArray;
hValueArray.GetAttributeObject(objectArray);
- for (FX_INT32 i = 0; i < objectArray.GetSize(); i++) {
+ for (int32_t i = 0; i < objectArray.GetSize(); i++) {
if (objectArray[i]->IsNode()) {
pNodeList->Append((CXFA_Node*)objectArray[i]);
}
@@ -774,7 +774,7 @@ void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue, FX_BOOL bSet }
void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"applyXSL");
return;
@@ -785,14 +785,14 @@ void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 3) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"assignNode");
return;
}
CFX_WideString wsExpression;
CFX_WideString wsValue;
- FX_INT32 iAction = 0;
+ int32_t iAction = 0;
if (iLength >= 1) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
@@ -807,7 +807,7 @@ void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_Clone(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clone");
return;
@@ -819,7 +819,7 @@ void CXFA_Node::Script_NodeClass_Clone(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getAttribute");
return;
@@ -836,13 +836,13 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getElement");
return;
}
CFX_WideString wsExpression;
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
if (iLength >= 1) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
@@ -856,14 +856,14 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_IsPropertySpecified(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 3) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isPropertySpecified");
return;
}
CFX_WideString wsExpression;
FX_BOOL bParent = TRUE;
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
if (iLength >= 1) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
@@ -891,7 +891,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(CFXJSE_Arguments* pArgument }
void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 3) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"loadXML");
return;
@@ -917,7 +917,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) return;
}
IFDE_XMLNode* pXMLNode = NULL;
- FX_INT32 iParserStatus = pParser->ParseXMLData(wsExpression, pXMLNode, NULL);
+ int32_t iParserStatus = pParser->ParseXMLData(wsExpression, pXMLNode, NULL);
if (iParserStatus != XFA_PARSESTATUS_Done || !pXMLNode) {
pParser->Release();
pParser = NULL;
@@ -962,7 +962,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) if (bOverwrite) {
CXFA_Node *pChild = this->GetNodeItem(XFA_NODEITEM_FirstChild);
CXFA_Node* pNewChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild);
- FX_INT32 index = 0;
+ int32_t index = 0;
while (pNewChild) {
CXFA_Node* pItem = pNewChild->GetNodeItem(XFA_NODEITEM_NextSibling);
pFakeRoot->RemoveChild(pNewChild);
@@ -1016,7 +1016,7 @@ void CXFA_Node::Script_NodeClass_SaveFilteredXML(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 0 || iLength > 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"saveXML");
return;
@@ -1090,7 +1090,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setAttribute");
return;
@@ -1105,7 +1105,7 @@ void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1 && iLength != 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setElement");
return;
@@ -1165,7 +1165,7 @@ void CXFA_Node::Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue, FX_BOOL bSettin ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
CXFA_NodeArray properts;
- FX_INT32 iSize = this->GetNodeList(properts, XFA_NODEFILTER_OneOfProperty);
+ int32_t iSize = this->GetNodeList(properts, XFA_NODEFILTER_OneOfProperty);
if (iSize > 0) {
FXJSE_Value_Set(hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(properts[0]));
}
@@ -1188,7 +1188,7 @@ void CXFA_Node::Script_ModelClass_CreateNode(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isCompatibleNS");
return;
@@ -1412,7 +1412,7 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, FX_BOOL bSetting, X if(!wsSOM.IsEmpty()) {
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = m_pDocument->GetScriptContext()->ResolveObjects(pProtoRoot, wsSOM, resoveNodeRS, dwFlag);
+ int32_t iRet = m_pDocument->GetScriptContext()->ResolveObjects(pProtoRoot, wsSOM, resoveNodeRS, dwFlag);
if(iRet > 0 && resoveNodeRS.nodes[0]->IsNode()) {
pProtoNode = (CXFA_Node*)resoveNodeRS.nodes[0];
}
@@ -1456,7 +1456,7 @@ void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue, FX_BOOL bSettin }
void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc == 0) || (argc == 1)) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE);
} else {
@@ -1465,7 +1465,7 @@ void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Delta_Restore(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"restore");
@@ -1575,7 +1575,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, FX_BOOL bSetting, X CXFA_NodeArray formNodes;
this->GetBindItems(formNodes);
CFX_WideString wsPicture;
- for (FX_INT32 i = 0; i < formNodes.GetSize(); i++) {
+ for (int32_t i = 0; i < formNodes.GetSize(); i++) {
CXFA_Node* pFormNode = formNodes.GetAt(i);
if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) {
continue;
@@ -1630,7 +1630,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) {
FXJSE_Value_ToUTF8String(hValue, newValue);
}
- FX_INT32 iValue = FXSYS_atoi(newValue);
+ int32_t iValue = FXSYS_atoi(newValue);
CFX_WideString wsNewValue = (iValue == 0) ? FX_WSTRC(L"0") : FX_WSTRC(L"1");
CFX_WideString wsFormatValue(wsNewValue);
CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData();
@@ -1645,10 +1645,10 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ }
struct XFA_ExecEventParaInfo {
public:
- FX_UINT32 m_uHash;
+ uint32_t m_uHash;
FX_LPCWSTR m_lpcEventName;
XFA_EVENTTYPE m_eventType;
- FX_UINT32 m_validFlags;
+ uint32_t m_validFlags;
};
static const XFA_ExecEventParaInfo gs_eventParaInfos[] = {
{0x02a6c55a, L"postSubmit", XFA_EVENT_PostSubmit, 0},
@@ -1679,11 +1679,11 @@ static const XFA_ExecEventParaInfo gs_eventParaInfos[] = { };
const XFA_ExecEventParaInfo* GetEventParaInfoByName(FX_WSTR wsEventName)
{
- FX_INT32 iLength = wsEventName.GetLength();
- FX_UINT32 uHash = FX_HashCode_String_GetW(wsEventName.GetPtr(), iLength);
+ int32_t iLength = wsEventName.GetLength();
+ uint32_t uHash = FX_HashCode_String_GetW(wsEventName.GetPtr(), iLength);
const XFA_ExecEventParaInfo* eventParaInfo = NULL;
- FX_INT32 iStart = 0, iEnd = (sizeof(gs_eventParaInfos) / sizeof(gs_eventParaInfos[0])) - 1;
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0, iEnd = (sizeof(gs_eventParaInfos) / sizeof(gs_eventParaInfos[0])) - 1;
+ int32_t iMid = (iStart + iEnd) / 2;
do {
iMid = (iStart + iEnd) / 2;
eventParaInfo = &gs_eventParaInfos[iMid];
@@ -1697,15 +1697,15 @@ const XFA_ExecEventParaInfo* GetEventParaInfoByName(FX_WSTR wsEventName) } while (iStart <= iEnd);
return NULL;
}
-void XFA_STRING_TO_RGB(CFX_WideString &strRGB, FX_INT32 &r, FX_INT32 &g, FX_INT32 &b)
+void XFA_STRING_TO_RGB(CFX_WideString &strRGB, int32_t &r, int32_t &g, int32_t &b)
{
r = 0;
g = 0;
b = 0;
FX_WCHAR zero = '0';
- FX_INT32 iIndex = 0;
- FX_INT32 iLen = strRGB.GetLength();
- for (FX_INT32 i = 0; i < iLen; ++i) {
+ int32_t iIndex = 0;
+ int32_t iLen = strRGB.GetLength();
+ for (int32_t i = 0; i < iLen; ++i) {
FX_WCHAR ch = strRGB.GetAt(i);
if (ch == L',') {
++iIndex;
@@ -1713,7 +1713,7 @@ void XFA_STRING_TO_RGB(CFX_WideString &strRGB, FX_INT32 &r, FX_INT32 &g, FX_INT3 if (iIndex > 2) {
break;
}
- FX_INT32 iValue = ch - zero;
+ int32_t iValue = ch - zero;
if (iValue >= 0 && iValue <= 9) {
switch (iIndex) {
case 0:
@@ -1736,23 +1736,23 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XF return;
}
CXFA_Border border = pWidgetData->GetBorder(TRUE);
- FX_INT32 iSize = border.CountEdges();
+ int32_t iSize = border.CountEdges();
CFX_WideString strColor;
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
strColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
- FX_INT32 r = 0, g = 0, b = 0;
+ int32_t r = 0, g = 0, b = 0;
XFA_STRING_TO_RGB(strColor, r, g, b);
FX_ARGB rgb = ArgbEncode(100, r, g, b);
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ for (int32_t i = 0; i < iSize; ++i) {
CXFA_Edge edge = border.GetEdge(i);
edge.SetColor(rgb);
}
} else {
CXFA_Edge edge = border.GetEdge(0);
FX_ARGB color = edge.GetColor();
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
strColor.Format(L"%d,%d,%d", r, g, b);
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor));
@@ -1765,13 +1765,13 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue, FX_BOOL bSetting, XF return;
}
CXFA_Border border = pWidgetData->GetBorder(TRUE);
- FX_INT32 iSize = border.CountEdges();
+ int32_t iSize = border.CountEdges();
CFX_WideString wsThickness;
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
wsThickness = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ for (int32_t i = 0; i < iSize; ++i) {
CXFA_Edge edge = border.GetEdge(i);
CXFA_Measurement thickness(wsThickness);
edge.SetMSThickness(thickness);
@@ -1800,13 +1800,13 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
wsColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
- FX_INT32 r, g, b;
+ int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
FX_ARGB color = ArgbEncode(0xff, r, g, b);
borderfill.SetColor(color);
} else {
FX_ARGB color = borderfill.GetColor();
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
wsColor.Format(L"%d,%d,%d", r, g, b);
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor));
@@ -1871,8 +1871,8 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue, FX_BOOL bSetting, CFX_WideString wsNewText = CFX_WideString::FromUTF8(newValue, newValue.GetLength());
CXFA_Node *pUIChild = pWidgetData->GetUIChild();
if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) {
- FX_INT32 iLeadDigits = 0;
- FX_INT32 iFracDigits = 0;
+ int32_t iLeadDigits = 0;
+ int32_t iFracDigits = 0;
pWidgetData->GetLeadDigits(iLeadDigits);
pWidgetData->GetFracDigits(iFracDigits);
wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits);
@@ -1945,13 +1945,13 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
wsColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
- FX_INT32 r, g, b;
+ int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
FX_ARGB color = ArgbEncode(0xff, r, g, b);
font.SetColor(color);
} else {
FX_ARGB color = font.GetColor();
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
wsColor.Format(L"%d,%d,%d", r, g, b);
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor));
@@ -1992,7 +1992,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength());
validate.SetNullTest(wsValue);
} else {
- FX_INT32 iValue = validate.GetNullTest();
+ int32_t iValue = validate.GetNullTest();
XFA_LPCATTRIBUTEENUMINFO pInfo = XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)iValue);
if (pInfo) {
wsValue = pInfo->pName;
@@ -2019,7 +2019,7 @@ void CXFA_Node::Script_Field_SelectedIndex(FXJSE_HVALUE hValue, FX_BOOL bSetting return;
}
if (bSetting) {
- FX_INT32 iIndex = FXJSE_Value_ToInteger(hValue);
+ int32_t iIndex = FXJSE_Value_ToInteger(hValue);
if (iIndex == -1) {
pWidgetData->ClearAllSelections();
return;
@@ -2039,10 +2039,10 @@ void CXFA_Node::Script_Field_ClearItems(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CFX_ByteString eventString = pArguments->GetUTF8String(0);
- FX_INT32 iRet = execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Field);
+ int32_t iRet = execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Field);
if (eventString == FX_BSTRC("validate")) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE));
}
@@ -2052,7 +2052,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2065,7 +2065,7 @@ void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"deleteItem");
return;
@@ -2074,7 +2074,7 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) if (!pWidgetData) {
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bValue = pWidgetData->DeleteItem(iIndex, TRUE, TRUE);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
@@ -2083,12 +2083,12 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getSaveItem");
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
if (iIndex < 0) {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
return;
@@ -2108,7 +2108,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"boundItem");
return;
@@ -2128,7 +2128,7 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getItemState");
return;
@@ -2137,7 +2137,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) if (!pWidgetData) {
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bValue = pWidgetData->GetItemState(iIndex);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
@@ -2146,7 +2146,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2162,12 +2162,12 @@ void CXFA_Node::Script_Field_SetItems(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getDisplayItem");
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
if (iIndex < 0) {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
return;
@@ -2187,7 +2187,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setItemState");
return;
@@ -2196,7 +2196,7 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) if (!pWidgetData) {
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bAdd = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
if (bAdd) {
pWidgetData->SetItemState(iIndex, TRUE, TRUE, TRUE);
@@ -2208,7 +2208,7 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addItem");
return;
@@ -2231,13 +2231,13 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE);
} else {
- FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE);
+ int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE);
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE));
}
} else {
@@ -2276,7 +2276,7 @@ void CXFA_Node::Script_ExclGroup_Transient(FXJSE_HVALUE hValue, FX_BOOL bSetting }
void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CFX_ByteString eventString = pArguments->GetUTF8String(0);
execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_ExclGroup);
@@ -2286,7 +2286,7 @@ void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc == 0) || (argc == 1)) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2312,7 +2312,7 @@ void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2325,7 +2325,7 @@ void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2338,23 +2338,23 @@ void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE);
} else {
- FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
+ int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE));
}
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
}
}
-static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, FX_INT32 iIndex)
+static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, int32_t iIndex)
{
ASSERT(pInstMgrNode);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
FX_DWORD dwNameHash = 0;
for(CXFA_Node* pNode = pInstMgrNode->GetNodeItem(XFA_NODEITEM_NextSibling); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
XFA_ELEMENT eCurType = pNode->GetClassID();
@@ -2385,8 +2385,8 @@ static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, FX_ void CXFA_Node::Script_Som_InstanceIndex(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute)
{
if (bSetting) {
- FX_INT32 iTo = FXJSE_Value_ToInteger(hValue);
- FX_INT32 iFrom = Subform_and_SubformSet_InstanceIndex();
+ int32_t iTo = FXJSE_Value_ToInteger(hValue);
+ int32_t iFrom = Subform_and_SubformSet_InstanceIndex();
CXFA_Node *pManagerNode = NULL;
for (CXFA_Node *pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) {
if (pNode->GetClassID() == XFA_ELEMENT_InstanceManager) {
@@ -2450,7 +2450,7 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA }
void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CFX_ByteString eventString = pArguments->GetUTF8String(0);
execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Subform);
@@ -2460,7 +2460,7 @@ void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2473,7 +2473,7 @@ void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2486,13 +2486,13 @@ void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE);
} else {
- FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
+ int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE));
}
} else {
@@ -2501,15 +2501,15 @@ void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Subform_GetInvalidObjects(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getInvalidObjects");
}
}
-FX_INT32 CXFA_Node::Subform_and_SubformSet_InstanceIndex()
+int32_t CXFA_Node::Subform_and_SubformSet_InstanceIndex()
{
- FX_INT32 index = 0;
+ int32_t index = 0;
for (CXFA_Node *pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) {
if ((pNode->GetClassID() == XFA_ELEMENT_Subform) || (pNode->GetClassID() == XFA_ELEMENT_SubformSet)) {
index++;
@@ -2521,7 +2521,7 @@ FX_INT32 CXFA_Node::Subform_and_SubformSet_InstanceIndex() }
void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), TRUE);
} else {
@@ -2530,7 +2530,7 @@ void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
m_pDocument->DoDataRemerge(TRUE);
} else {
@@ -2539,7 +2539,7 @@ void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2553,7 +2553,7 @@ void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc > 0) && (argc < 4)) {
CFX_WideString strTagName;
CFX_WideString strName;
@@ -2593,7 +2593,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
FX_BOOL bScriptFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), TRUE);
@@ -2603,7 +2603,7 @@ void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2617,7 +2617,7 @@ void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2631,7 +2631,7 @@ void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2663,10 +2663,10 @@ void CXFA_Node::Script_InstanceManager_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting FXJSE_Value_SetInteger(hValue, nodeOccur.GetMin());
}
}
-static FX_INT32 XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode)
+static int32_t XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode)
{
ASSERT(pInstMgrNode);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
FX_DWORD dwNameHash = 0;
for(CXFA_Node* pNode = pInstMgrNode->GetNodeItem(XFA_NODEITEM_NextSibling); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
XFA_ELEMENT eCurType = pNode->GetClassID();
@@ -2691,15 +2691,15 @@ static FX_INT32 XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode) }
return iCount;
}
-static void XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, CXFA_NodeArray& rgNodeArray, CFX_ArrayTemplate<FX_INT32>& rgIdxArray)
+static void XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, CXFA_NodeArray& rgNodeArray, CFX_ArrayTemplate<int32_t>& rgIdxArray)
{
- FX_INT32 iCount = rgNodeSet.GetCount();
+ int32_t iCount = rgNodeSet.GetCount();
rgNodeArray.SetSize(iCount);
rgIdxArray.SetSize(iCount);
if(iCount == 0) {
return;
}
- FX_INT32 iIndex = -1, iTotalIndex = -1;
+ int32_t iIndex = -1, iTotalIndex = -1;
CXFA_Node* pNode = NULL;
FX_POSITION pos = rgNodeSet.GetStartPosition();
rgNodeSet.GetNextAssoc(pos, pNode);
@@ -2782,10 +2782,10 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA }
if(pDualNodeArray->firstNodeList.GetCount() != 0 && pDualNodeArray->secondNodeList.GetCount() != 0) {
CXFA_NodeArray rgNodeArray1, rgNodeArray2;
- CFX_ArrayTemplate<FX_INT32> rgIdxArray1, rgIdxArray2;
+ CFX_ArrayTemplate<int32_t> rgIdxArray1, rgIdxArray2;
XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(pDualNodeArray->firstNodeList, rgNodeArray1, rgIdxArray1);
XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(pDualNodeArray->secondNodeList, rgNodeArray2, rgIdxArray2);
- FX_INT32 iLimit;
+ int32_t iLimit;
CXFA_Node *pParentNode = NULL, *pBeforeNode = NULL;
if(bInsertBefore) {
iLimit = rgIdxArray2[0];
@@ -2797,7 +2797,7 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA pParentNode = pLastNode->GetNodeItem(XFA_NODEITEM_Parent);
pBeforeNode = pLastNode->GetNodeItem(XFA_NODEITEM_NextSibling);
}
- for(FX_INT32 iIdx = 0, iCount = rgIdxArray1.GetSize(); iIdx < iCount; iIdx++) {
+ for(int32_t iIdx = 0, iCount = rgIdxArray1.GetSize(); iIdx < iCount; iIdx++) {
CXFA_Node* pCurNode = rgNodeArray1[iIdx];
pParentNode->RemoveChild(pCurNode);
pParentNode->InsertChild(pCurNode, pBeforeNode);
@@ -2809,7 +2809,7 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA }
rgNodeListMap.RemoveAll();
}
-static void XFA_ScriptInstanceManager_InsertItem(CXFA_Node *pInstMgrNode, CXFA_Node *pNewInstance, FX_INT32 iPos, FX_INT32 iCount = -1, FX_BOOL bMoveDataBindingNodes = TRUE)
+static void XFA_ScriptInstanceManager_InsertItem(CXFA_Node *pInstMgrNode, CXFA_Node *pNewInstance, int32_t iPos, int32_t iCount = -1, FX_BOOL bMoveDataBindingNodes = TRUE)
{
if(iCount < 0) {
iCount = XFA_ScriptInstanceManager_GetCount(pInstMgrNode);
@@ -2912,7 +2912,7 @@ static CXFA_Node* XFA_ScriptInstanceManager_CreateInstance(CXFA_Node *pInstMgrNo void CXFA_Node::Script_InstanceManager_Count(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute)
{
if (bSetting) {
- FX_INT32 iDesired = FXJSE_Value_ToInteger(hValue);
+ int32_t iDesired = FXJSE_Value_ToInteger(hValue);
InstanceManager_SetInstances(iDesired);
} else {
FXJSE_Value_SetInteger(hValue, XFA_ScriptInstanceManager_GetCount(this));
@@ -2920,13 +2920,13 @@ void CXFA_Node::Script_InstanceManager_Count(FXJSE_HVALUE hValue, FX_BOOL bSetti }
void CXFA_Node::Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc != 2) {
FXJSE_Value_SetUndefined(pArguments->GetReturnValue());
return;
}
- FX_INT32 iFrom = pArguments->GetInt32(0);
- FX_INT32 iTo = pArguments->GetInt32(1);
+ int32_t iFrom = pArguments->GetInt32(0);
+ int32_t iTo = pArguments->GetInt32(1);
InstanceManager_MoveInstance(iTo, iFrom);
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -2943,19 +2943,19 @@ void CXFA_Node::Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments }
void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc != 1) {
FXJSE_Value_SetUndefined(pArguments->GetReturnValue());
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
- FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this);
+ int32_t iIndex = pArguments->GetInt32(0);
+ int32_t iCount = XFA_ScriptInstanceManager_GetCount(this);
if (iIndex < 0 || iIndex >= iCount) {
ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS);
return;
}
CXFA_Occur nodeOccur = GetOccurNode();
- FX_INT32 iMin = nodeOccur.GetMin();
+ int32_t iMin = nodeOccur.GetMin();
if (iCount - 1 < iMin) {
ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min");
return;
@@ -2964,7 +2964,7 @@ void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArgumen XFA_ScriptInstanceManager_RemoveItem(this, pRemoveInstance);
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (pNotify) {
- for (FX_INT32 i = iIndex; i < iCount - 1; i++) {
+ for (int32_t i = iIndex; i < iCount - 1; i++) {
CXFA_Node *pSubformInstance = XFA_ScriptInstanceManager_GetItem(this, i);
if (pSubformInstance && pSubformInstance->GetClassID() == XFA_ELEMENT_Subform) {
pNotify->RunSubformIndexChange(pSubformInstance);
@@ -2979,17 +2979,17 @@ void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArgumen }
void CXFA_Node::Script_InstanceManager_SetInstances(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc != 1) {
FXJSE_Value_SetUndefined(pArguments->GetReturnValue());
return;
}
- FX_INT32 iDesired = pArguments->GetInt32(0);
+ int32_t iDesired = pArguments->GetInt32(0);
InstanceManager_SetInstances(iDesired);
}
void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc != 0) && (argc != 1)) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addInstance");
return;
@@ -2998,9 +2998,9 @@ void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments) if (argc == 1) {
fFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
}
- FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this);
+ int32_t iCount = XFA_ScriptInstanceManager_GetCount(this);
CXFA_Occur nodeOccur = GetOccurNode();
- FX_INT32 iMax = nodeOccur.GetMax();
+ int32_t iMax = nodeOccur.GetMax();
if (iMax >= 0 && iCount >= iMax) {
ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max");
return;
@@ -3021,23 +3021,23 @@ void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc != 1) && (argc != 2)) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"insertInstance");
return;
}
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bBind = FALSE;
if (argc == 2) {
bBind = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
}
CXFA_Occur nodeOccur = GetOccurNode();
- FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this);
+ int32_t iCount = XFA_ScriptInstanceManager_GetCount(this);
if (iIndex < 0 || iIndex > iCount) {
ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS);
return;
}
- FX_INT32 iMax = nodeOccur.GetMax();
+ int32_t iMax = nodeOccur.GetMax();
if (iMax >= 0 && iCount >= iMax) {
ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max");
return;
@@ -3056,11 +3056,11 @@ void CXFA_Node::Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArgumen }
pLayoutPro->AddChangedContainer((CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Form));
}
-FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired)
+int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired)
{
CXFA_Occur nodeOccur = GetOccurNode();
- FX_INT32 iMax = nodeOccur.GetMax();
- FX_INT32 iMin = nodeOccur.GetMin();
+ int32_t iMax = nodeOccur.GetMax();
+ int32_t iMin = nodeOccur.GetMin();
if (iDesired < iMin) {
ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min");
return 1;
@@ -3069,7 +3069,7 @@ FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired) ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max");
return 2;
}
- FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this);
+ int32_t iCount = XFA_ScriptInstanceManager_GetCount(this);
if (iDesired == iCount) {
return 0;
}
@@ -3113,9 +3113,9 @@ FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired) pLayoutPro->AddChangedContainer((CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Form));
return 0;
}
-FX_INT32 CXFA_Node::InstanceManager_MoveInstance(FX_INT32 iTo, FX_INT32 iFrom)
+int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom)
{
- FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this);
+ int32_t iCount = XFA_ScriptInstanceManager_GetCount(this);
if (iFrom > iCount || iTo > iCount - 1) {
ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS);
return 1;
@@ -3137,7 +3137,7 @@ void CXFA_Node::Script_Occur_Max(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR {
CXFA_Occur occur(this);
if (bSetting) {
- FX_INT32 iMax = FXJSE_Value_ToInteger(hValue);
+ int32_t iMax = FXJSE_Value_ToInteger(hValue);
occur.SetMax(iMax);
} else {
FXJSE_Value_SetInteger(hValue, occur.GetMax());
@@ -3147,7 +3147,7 @@ void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR {
CXFA_Occur occur(this);
if (bSetting) {
- FX_INT32 iMin = FXJSE_Value_ToInteger(hValue);
+ int32_t iMin = FXJSE_Value_ToInteger(hValue);
occur.SetMin(iMin);
} else {
FXJSE_Value_SetInteger(hValue, occur.GetMin());
@@ -3155,7 +3155,7 @@ void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR }
void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if ((argc == 0) || (argc == 1)) {
FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), FX_BSTRC(""));
} else {
@@ -3164,12 +3164,12 @@ void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CXFA_Node * pDataNode = (CXFA_Node *)pArguments->GetObject(0);
if (pDataNode) {
CXFA_NodeArray formItems;
- FX_INT32 iSize = pDataNode->GetBindItems(formItems);
+ int32_t iSize = pDataNode->GetBindItems(formItems);
CXFA_ArrayNodeList *pFormNodes = FX_NEW CXFA_ArrayNodeList(m_pDocument);
pFormNodes->SetArrayNodeList(formItems);
FXJSE_Value_SetObject(pArguments->GetReturnValue(), (CXFA_Object*)pFormNodes, m_pDocument->GetScriptContext()->GetJseNormalClass());
@@ -3182,7 +3182,7 @@ void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
m_pDocument->DoDataRemerge(TRUE);
} else {
@@ -3191,7 +3191,7 @@ void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Form_ExecInitialize(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -3208,7 +3208,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) if (pEventParam->m_eType == XFA_EVENT_Calculate || pEventParam->m_eType == XFA_EVENT_InitCalculate) {
return;
}
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
FX_BOOL bScriptFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -3227,7 +3227,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
@@ -3240,13 +3240,13 @@ void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE);
} else {
- FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
+ int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE));
}
} else {
@@ -3267,7 +3267,7 @@ void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ }
void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CFX_ByteString bsAttributeName = pArguments->GetUTF8String(0);
CFX_WideString wsAttributeValue;
@@ -3282,7 +3282,7 @@ void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 2) {
CFX_ByteString bsValue = pArguments->GetUTF8String(0);
CFX_ByteString bsName = pArguments->GetUTF8String(1);
@@ -3297,7 +3297,7 @@ void CXFA_Node::Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 1) {
CFX_ByteString bsName = pArguments->GetUTF8String(0);
CFX_WideString wsName = CFX_WideString::FromUTF8(bsName, bsName.GetLength());
@@ -3335,7 +3335,7 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA }
void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"next");
@@ -3343,7 +3343,7 @@ void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_CancelBatch(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"cancelBatch");
@@ -3351,7 +3351,7 @@ void CXFA_Node::Script_Source_CancelBatch(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_First(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"first");
@@ -3359,7 +3359,7 @@ void CXFA_Node::Script_Source_First(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_UpdateBatch(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"updateBatch");
@@ -3367,7 +3367,7 @@ void CXFA_Node::Script_Source_UpdateBatch(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Previous(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"previous");
@@ -3375,7 +3375,7 @@ void CXFA_Node::Script_Source_Previous(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_IsBOF(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isBOF");
@@ -3383,7 +3383,7 @@ void CXFA_Node::Script_Source_IsBOF(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_IsEOF(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isEOF");
@@ -3391,7 +3391,7 @@ void CXFA_Node::Script_Source_IsEOF(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Cancel(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"cancel");
@@ -3399,7 +3399,7 @@ void CXFA_Node::Script_Source_Cancel(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Update(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"update");
@@ -3407,7 +3407,7 @@ void CXFA_Node::Script_Source_Update(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Open(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"open");
@@ -3415,7 +3415,7 @@ void CXFA_Node::Script_Source_Open(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Delete(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"delete");
@@ -3423,7 +3423,7 @@ void CXFA_Node::Script_Source_Delete(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_AddNew(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addNew");
@@ -3431,7 +3431,7 @@ void CXFA_Node::Script_Source_AddNew(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Requery(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"requery");
@@ -3439,7 +3439,7 @@ void CXFA_Node::Script_Source_Requery(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Resync(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resync");
@@ -3447,7 +3447,7 @@ void CXFA_Node::Script_Source_Resync(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Close(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"close");
@@ -3455,7 +3455,7 @@ void CXFA_Node::Script_Source_Close(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_Last(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"last");
@@ -3463,7 +3463,7 @@ void CXFA_Node::Script_Source_Last(CFXJSE_Arguments* pArguments) }
void CXFA_Node::Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if (argc == 0) {
} else {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"hasDataChanged");
@@ -3507,11 +3507,11 @@ enum XFA_KEYTYPE { FX_LPVOID XFA_GetMapKey_Custom(FX_WSTR wsKey)
{
FX_DWORD dwKey = FX_HashCode_String_GetW(wsKey.GetPtr(), wsKey.GetLength());
- return (FX_LPVOID)(FX_UINTPTR)((dwKey << 1) | XFA_KEYTYPE_Custom);
+ return (FX_LPVOID)(uintptr_t)((dwKey << 1) | XFA_KEYTYPE_Custom);
}
FX_LPVOID XFA_GetMapKey_Element(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute)
{
- return (FX_LPVOID)(FX_UINTPTR)((eElement << 16) | (eAttribute << 8) | XFA_KEYTYPE_Element);
+ return (FX_LPVOID)(uintptr_t)((eElement << 16) | (eAttribute << 8) | XFA_KEYTYPE_Element);
}
static inline FX_BOOL XFA_NodeData_PrepareKey(XFA_ELEMENT eElem, XFA_ATTRIBUTE eAttr, FX_LPVOID &pKey)
{
@@ -3540,7 +3540,7 @@ FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, FX_WSTR wsValue, FX_BOOL bN switch (eType) {
case XFA_ATTRIBUTETYPE_Enum: {
XFA_LPCATTRIBUTEENUMINFO pEnum = XFA_GetAttributeEnumByName(wsValue);
- return SetEnum(pAttr->eName, pEnum ? pEnum->eName : (XFA_ATTRIBUTEENUM)(FX_INTPTR)(pAttr->pDefValue), bNotify);
+ return SetEnum(pAttr->eName, pEnum ? pEnum->eName : (XFA_ATTRIBUTEENUM)(intptr_t)(pAttr->pDefValue), bNotify);
}
break;
case XFA_ATTRIBUTETYPE_Cdata:
@@ -3596,7 +3596,7 @@ FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr, CFX_WideString &wsValue, FX }
break;
case XFA_ATTRIBUTETYPE_Integer: {
- FX_INT32 iValue;
+ int32_t iValue;
if (!TryInteger(pAttr->eName, iValue, bUseDefault)) {
return FALSE;
}
@@ -3653,16 +3653,16 @@ FX_BOOL CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL &bValue, FX_BOOL bUse if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, bUseDefault, pValue)) {
return FALSE;
}
- bValue = (FX_BOOL)(FX_UINTPTR)pValue;
+ bValue = (FX_BOOL)(uintptr_t)pValue;
return TRUE;
}
-FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, FX_INT32 &iValue, FX_BOOL bUseDefault)
+FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, int32_t &iValue, FX_BOOL bUseDefault)
{
FX_LPVOID pValue = NULL;
if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, bUseDefault, pValue)) {
return FALSE;
}
- iValue = (FX_INT32)(FX_UINTPTR)pValue;
+ iValue = (int32_t)(uintptr_t)pValue;
return TRUE;
}
FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BOOL bUseDefault)
@@ -3671,7 +3671,7 @@ FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BO if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, bUseDefault, pValue)) {
return FALSE;
}
- eValue = (XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue;
+ eValue = (XFA_ATTRIBUTEENUM)(uintptr_t)pValue;
return TRUE;
}
FX_BOOL CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr, CXFA_Measurement mValue, FX_BOOL bNotify )
@@ -3692,7 +3692,7 @@ FX_BOOL CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr, CXFA_Measurement &mValue, FX_ return FALSE;
}
FX_LPVOID pValue;
- FX_INT32 iBytes;
+ int32_t iBytes;
if(GetMapModuleBuffer(pKey, pValue, iBytes) && iBytes == sizeof(mValue)) {
FX_memcpy(&mValue, pValue, sizeof(mValue));
return TRUE;
@@ -3906,13 +3906,13 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTETYPE eType, FX_LPV if (pInfo) {
switch (eType) {
case XFA_ATTRIBUTETYPE_Enum:
- ((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue)->pName);
+ ((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)(uintptr_t)pValue)->pName);
break;
case XFA_ATTRIBUTETYPE_Boolean:
((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, pValue ? FX_WSTRC(L"1") : FX_WSTRC(L"0"));
break;
case XFA_ATTRIBUTETYPE_Integer:
- ((IFDE_XMLElement*)m_pXMLNode)->SetInteger(pInfo->pName, (FX_INT32)(FX_UINTPTR)pValue);
+ ((IFDE_XMLElement*)m_pXMLNode)->SetInteger(pInfo->pName, (int32_t)(uintptr_t)pValue);
break;
default:
FXSYS_assert(0);
@@ -3946,7 +3946,7 @@ FX_BOOL CXFA_Node::SetUserData(FX_LPVOID pKey, FX_LPVOID pData, XFA_MAPDATABLOCK }
FX_BOOL CXFA_Node::TryUserData(FX_LPVOID pKey, FX_LPVOID &pData, FX_BOOL bProtoAlso)
{
- FX_INT32 iBytes = 0;
+ int32_t iBytes = 0;
if (!GetMapModuleBuffer(pKey, pData, iBytes, bProtoAlso)) {
return FALSE;
}
@@ -3967,11 +3967,11 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W CXFA_Node *pBind = GetBindData();
if (bSyncData && pBind) {
CFX_WideStringArray wsSaveTextArray;
- FX_INT32 iSize = 0;
+ int32_t iSize = 0;
if (!wsContent.IsEmpty()) {
- FX_INT32 iStart = 0;
- FX_INT32 iLength = wsContent.GetLength();
- FX_INT32 iEnd = wsContent.Find(L'\n', iStart);
+ int32_t iStart = 0;
+ int32_t iLength = wsContent.GetLength();
+ int32_t iEnd = wsContent.Find(L'\n', iStart);
iEnd = (iEnd == -1) ? iLength : iEnd;
while (iEnd >= iStart) {
wsSaveTextArray.Add(wsContent.Mid(iStart, iEnd - iStart));
@@ -3992,9 +3992,9 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W }
} else {
CXFA_NodeArray valueNodes;
- FX_INT32 iDatas = pBind->GetNodeList(valueNodes, XFA_NODEFILTER_Children, XFA_ELEMENT_DataValue);
+ int32_t iDatas = pBind->GetNodeList(valueNodes, XFA_NODEFILTER_Children, XFA_ELEMENT_DataValue);
if (iDatas < iSize) {
- FX_INT32 iAddNodes = iSize - iDatas;
+ int32_t iAddNodes = iSize - iDatas;
CXFA_Node *pValueNodes = NULL;
while (iAddNodes-- > 0) {
pValueNodes = pBind->CreateSamePacketNode(XFA_ELEMENT_DataValue);
@@ -4004,12 +4004,12 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W }
pValueNodes = NULL;
} else if (iDatas > iSize) {
- FX_INT32 iDelNodes = iDatas - iSize;
+ int32_t iDelNodes = iDatas - iSize;
while (iDelNodes-- > 0) {
pBind->RemoveChild(pBind->GetNodeItem(XFA_NODEITEM_FirstChild));
}
}
- FX_INT32 i = 0;
+ int32_t i = 0;
for (CXFA_Node *pValueNode = pBind->GetNodeItem(XFA_NODEITEM_FirstChild); pValueNode; pValueNode = pValueNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
pValueNode->SetAttributeValue(wsSaveTextArray[i], wsSaveTextArray[i], FALSE);
i++;
@@ -4017,7 +4017,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W }
CXFA_NodeArray nodeArray;
pBind->GetBindItems(nodeArray);
- for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) {
+ for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
CXFA_Node* pNode = nodeArray[i];
if (pNode == this) {
continue;
@@ -4039,7 +4039,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify, bScriptModify, FALSE);
CXFA_NodeArray nodeArray;
pBindNode->GetBindItems(nodeArray);
- for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) {
+ for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
CXFA_Node* pNode = nodeArray[i];
if (pNode == this) {
continue;
@@ -4101,7 +4101,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W if (pBindNode && bSyncData) {
CXFA_NodeArray nodeArray;
pBindNode->GetBindItems(nodeArray);
- for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) {
+ for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
CXFA_Node* pNode = nodeArray[i];
pNode->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify, FALSE);
}
@@ -4234,7 +4234,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) return pModelNode->TryNamespace(wsNamespace);
}
}
-CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty )
+CXFA_Node* CXFA_Node::GetProperty(int32_t index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty )
{
XFA_ELEMENT eElement = GetClassID();
FX_DWORD dwPacket = GetPacketID();
@@ -4243,7 +4243,7 @@ CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL return NULL;
}
CXFA_Node *pNode = m_pChild;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() == eProperty) {
iCount ++;
@@ -4277,10 +4277,10 @@ CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL }
return pNewNode;
}
-FX_INT32 CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild)
+int32_t CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild)
{
CXFA_Node *pNode = m_pChild;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() == eElement || eElement == XFA_ELEMENT_UNKNOWN) {
if(bOnlyChild) {
@@ -4294,11 +4294,11 @@ FX_INT32 CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild) }
return iCount;
}
-CXFA_Node* CXFA_Node::GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild)
+CXFA_Node* CXFA_Node::GetChild(int32_t index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild)
{
FXSYS_assert(index > -1);
CXFA_Node *pNode = m_pChild;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() == eElement || eElement == XFA_ELEMENT_UNKNOWN) {
if(bOnlyChild) {
@@ -4315,7 +4315,7 @@ CXFA_Node* CXFA_Node::GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOn }
return NULL;
}
-FX_INT32 CXFA_Node::InsertChild(FX_INT32 index, CXFA_Node *pNode)
+int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node *pNode)
{
ASSERT(pNode != NULL && pNode->m_pNext == NULL);
pNode->m_pParent = this;
@@ -4332,7 +4332,7 @@ FX_INT32 CXFA_Node::InsertChild(FX_INT32 index, CXFA_Node *pNode) m_pLastChild->m_pNext = pNode;
} else {
CXFA_Node *pPrev = m_pChild;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (++iCount != index && pPrev->m_pNext) {
pPrev = pPrev->m_pNext;
}
@@ -4367,7 +4367,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node *pNode, CXFA_Node *pBeforeNode) }
FX_BOOL bWasPurgeNode = m_pDocument->RemovePurgeNode(pNode);
FXSYS_assert(bWasPurgeNode == TRUE);
- FX_INT32 nIndex = -1;
+ int32_t nIndex = -1;
pNode->m_pParent = this;
if (m_pChild == NULL || pBeforeNode == m_pChild) {
pNode->m_pNext = m_pChild;
@@ -4508,7 +4508,7 @@ CXFA_Node* CXFA_Node::GetNextSameClassSibling(XFA_ELEMENT eElement) const }
return NULL;
}
-FX_INT32 CXFA_Node::GetNodeSameNameIndex() const
+int32_t CXFA_Node::GetNodeSameNameIndex() const
{
IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
@@ -4516,7 +4516,7 @@ FX_INT32 CXFA_Node::GetNodeSameNameIndex() const }
return pScriptContext->GetIndexByName((CXFA_Node*)this);
}
-FX_INT32 CXFA_Node::GetNodeSameClassIndex() const
+int32_t CXFA_Node::GetNodeSameClassIndex() const
{
IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
@@ -4612,22 +4612,22 @@ void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNo if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) {
IXFA_Notify *pNotify = m_pDocument->GetParser()->GetNotify();
if (pNotify) {
- pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, (FX_LPVOID)(FX_UINTPTR)eAttr, pNewValue);
+ pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, (FX_LPVOID)(uintptr_t)eAttr, pNewValue);
}
}
}
void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify, FX_BOOL bScriptModify)
{
if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) {
- Script_Attribute_SendAttributeChangeMessage((FX_LPVOID)(FX_UINTPTR)eAttr, pNewValue, bScriptModify);
+ Script_Attribute_SendAttributeChangeMessage((FX_LPVOID)(uintptr_t)eAttr, pNewValue, bScriptModify);
}
}
-FX_INT32 CXFA_Node::execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType)
+int32_t CXFA_Node::execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType)
{
- FX_INT32 iRet = XFA_EVENTERROR_NotExist;
+ int32_t iRet = XFA_EVENTERROR_NotExist;
const XFA_ExecEventParaInfo* eventParaInfo = GetEventParaInfoByName(wsEventName);
if (eventParaInfo) {
- FX_UINT32 validFlags = eventParaInfo->m_validFlags;
+ uint32_t validFlags = eventParaInfo->m_validFlags;
IXFA_Notify * pNotify = m_pDocument->GetParser()->GetNotify();
if (!pNotify) {
return iRet;
@@ -4730,14 +4730,14 @@ void CXFA_Node::SetMapModuleString(FX_LPVOID pKey, FX_WSTR wsValue) FX_BOOL CXFA_Node::GetMapModuleString(FX_LPVOID pKey, CFX_WideStringC &wsValue)
{
FX_LPVOID pValue;
- FX_INT32 iBytes;
+ int32_t iBytes;
if (!GetMapModuleBuffer(pKey, pValue, iBytes)) {
return FALSE;
}
wsValue = CFX_WideStringC((FX_LPCWSTR)pValue, iBytes / sizeof(FX_WCHAR));
return TRUE;
}
-void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo )
+void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo )
{
XFA_LPMAPMODULEDATA pMoudle = this->GetMapModuleData(TRUE);
if (!pMoudle) {
@@ -4745,12 +4745,12 @@ void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iB }
XFA_LPMAPDATABLOCK &pBuffer = pMoudle->m_BufferMap[pKey];
if (pBuffer == NULL) {
- pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(FX_BYTE, sizeof(XFA_MAPDATABLOCK) + iBytes);
+ pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + iBytes);
} else if (pBuffer->iBytes != iBytes) {
if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) {
pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData());
}
- pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(FX_BYTE, pBuffer, sizeof(XFA_MAPDATABLOCK) + iBytes);
+ pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + iBytes);
} else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) {
pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData());
}
@@ -4761,7 +4761,7 @@ void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iB pBuffer->iBytes = iBytes;
FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes);
}
-FX_BOOL CXFA_Node::GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, FX_INT32 &iBytes, FX_BOOL bProtoAlso)
+FX_BOOL CXFA_Node::GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, int32_t &iBytes, FX_BOOL bProtoAlso)
{
XFA_LPMAPDATABLOCK pBuffer = NULL;
CXFA_Node* pNode = this;
@@ -4865,12 +4865,12 @@ void CXFA_Node::MergeAllData(FX_LPVOID pDstModule, FX_BOOL bUseSrcAttr ) continue;
}
if (pBuffer == NULL) {
- pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(FX_BYTE, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes);
+ pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes);
} else if (pBuffer->iBytes != pSrcBuffer->iBytes) {
if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) {
pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData());
}
- pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(FX_BYTE, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes);
+ pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes);
} else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) {
pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData());
}
@@ -4948,9 +4948,9 @@ CXFA_NodeList::CXFA_NodeList(CXFA_Document* pDocument) }
CXFA_Node* CXFA_NodeList::NamedItem(FX_WSTR wsName)
{
- FX_INT32 iCount = GetLength();
+ int32_t iCount = GetLength();
FX_DWORD dwHashCode = FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength());
- for (FX_INT32 i = 0; i < iCount; i++) {
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_Node* ret = Item(i);
if (dwHashCode == ret->GetNameHash()) {
return ret;
@@ -4960,7 +4960,7 @@ CXFA_Node* CXFA_NodeList::NamedItem(FX_WSTR wsName) }
void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if(argc == 1) {
CXFA_Node *pNode = (CXFA_Node *)pArguments->GetObject(0);
if(pNode) {
@@ -4974,7 +4974,7 @@ void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments) }
void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if(argc == 2) {
CXFA_Node *pNewNode = (CXFA_Node *)pArguments->GetObject(0);
CXFA_Node *pBeforeNode = (CXFA_Node *)pArguments->GetObject(1);
@@ -4989,7 +4989,7 @@ void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments) }
void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if(argc == 1) {
CXFA_Node *pNode = (CXFA_Node *)pArguments->GetObject(0);
if(pNode) {
@@ -5003,9 +5003,9 @@ void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments) }
void CXFA_NodeList::Script_ListClass_Item(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if(argc == 1) {
- FX_INT32 iIndex = pArguments->GetInt32(0);
+ int32_t iIndex = pArguments->GetInt32(0);
if((iIndex >= 0) && (iIndex + 1 <= GetLength())) {
FXJSE_Value_Set(pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(Item(iIndex)));
} else {
@@ -5017,7 +5017,7 @@ void CXFA_NodeList::Script_ListClass_Item(CFXJSE_Arguments* pArguments) }
void CXFA_NodeList::Script_TreelistClass_NamedItem(CFXJSE_Arguments* pArguments)
{
- FX_INT32 argc = pArguments->GetLength();
+ int32_t argc = pArguments->GetLength();
if(argc == 1) {
CFX_ByteString szName = pArguments->GetUTF8String(0);
CXFA_Node* pNode = NamedItem(CFX_WideString::FromUTF8(szName, szName.GetLength()));
@@ -5047,7 +5047,7 @@ void CXFA_ArrayNodeList::SetArrayNodeList(const CXFA_NodeArray &srcArray) m_array.Copy(srcArray);
}
}
-FX_INT32 CXFA_ArrayNodeList::GetLength()
+int32_t CXFA_ArrayNodeList::GetLength()
{
return m_array.GetSize();
}
@@ -5061,8 +5061,8 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) if (pBeforeNode == NULL) {
m_array.Add(pNewNode);
} else {
- FX_INT32 iSize = m_array.GetSize();
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ int32_t iSize = m_array.GetSize();
+ for (int32_t i = 0; i < iSize; ++i) {
if (m_array[i] == pBeforeNode) {
m_array.InsertAt(i, pNewNode);
break;
@@ -5073,8 +5073,8 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) }
FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode)
{
- FX_INT32 iSize = m_array.GetSize();
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ int32_t iSize = m_array.GetSize();
+ for (int32_t i = 0; i < iSize; ++i) {
if (m_array[i] == pNode) {
m_array.RemoveAt(i);
break;
@@ -5082,9 +5082,9 @@ FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) }
return TRUE;
}
-CXFA_Node* CXFA_ArrayNodeList::Item(FX_INT32 iIndex)
+CXFA_Node* CXFA_ArrayNodeList::Item(int32_t iIndex)
{
- FX_INT32 iSize = m_array.GetSize();
+ int32_t iSize = m_array.GetSize();
if (iIndex >= 0 && iIndex < iSize) {
return m_array[iIndex];
}
@@ -5095,7 +5095,7 @@ CXFA_AttachNodeList::CXFA_AttachNodeList(CXFA_Document* pDocument, CXFA_Node* pA {
m_pAttachNode = pAttachNode;
}
-FX_INT32 CXFA_AttachNodeList::GetLength()
+int32_t CXFA_AttachNodeList::GetLength()
{
return m_pAttachNode->CountChildren(XFA_ELEMENT_UNKNOWN, m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE);
}
@@ -5119,7 +5119,7 @@ FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
return m_pAttachNode->RemoveChild(pNode);
}
-CXFA_Node* CXFA_AttachNodeList::Item(FX_INT32 iIndex)
+CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex)
{
return m_pAttachNode->GetChild(iIndex, XFA_ELEMENT_UNKNOWN, m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE);
}
diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp index c6ece3691b..1cc9d4aa03 100644 --- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp @@ -18,7 +18,7 @@ #include "xfa_debug_parser.h"
static FX_ARGB XFA_WStringToColor(FX_WSTR wsValue)
{
- FX_BYTE r = 0, g = 0, b = 0;
+ uint8_t r = 0, g = 0, b = 0;
if (wsValue.GetLength() == 0) {
return 0xff000000;
}
@@ -91,7 +91,7 @@ CXFA_Fill::CXFA_Fill(CXFA_Node* pNode) CXFA_Fill::~CXFA_Fill()
{
}
-FX_INT32 CXFA_Fill::GetPresence()
+int32_t CXFA_Fill::GetPresence()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence);
}
@@ -117,11 +117,11 @@ FX_ARGB CXFA_Fill::GetColor(FX_BOOL bText) }
return 0xFFFFFFFF;
}
-FX_INT32 CXFA_Fill::GetFillType()
+int32_t CXFA_Fill::GetFillType()
{
CXFA_Node* pChild = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChild) {
- FX_INT32 eType = pChild->GetClassID();
+ int32_t eType = pChild->GetClassID();
if (eType != XFA_ELEMENT_Color && eType != XFA_ELEMENT_Extras) {
return eType;
}
@@ -129,7 +129,7 @@ FX_INT32 CXFA_Fill::GetFillType() }
return XFA_ELEMENT_Solid;
}
-FX_INT32 CXFA_Fill::GetPattern(FX_ARGB& foreColor)
+int32_t CXFA_Fill::GetPattern(FX_ARGB& foreColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Pattern);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_ELEMENT_Color)) {
@@ -141,10 +141,10 @@ FX_INT32 CXFA_Fill::GetPattern(FX_ARGB& foreColor) }
return pNode->GetEnum(XFA_ATTRIBUTE_Type);
}
-FX_INT32 CXFA_Fill::GetStipple(FX_ARGB& stippleColor)
+int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Stipple);
- FX_INT32 eAttr = 50;
+ int32_t eAttr = 50;
pNode->TryInteger(XFA_ATTRIBUTE_Rate, eAttr);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_ELEMENT_Color)) {
CFX_WideStringC wsColor;
@@ -155,7 +155,7 @@ FX_INT32 CXFA_Fill::GetStipple(FX_ARGB& stippleColor) }
return eAttr;
}
-FX_INT32 CXFA_Fill::GetLinear(FX_ARGB& endColor)
+int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Linear);
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight;
@@ -169,7 +169,7 @@ FX_INT32 CXFA_Fill::GetLinear(FX_ARGB& endColor) }
return eAttr;
}
-FX_INT32 CXFA_Fill::GetRadial(FX_ARGB& endColor)
+int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Radial);
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge;
@@ -183,15 +183,15 @@ FX_INT32 CXFA_Fill::GetRadial(FX_ARGB& endColor) }
return eAttr;
}
-FX_BOOL CXFA_Fill::SetPresence(FX_INT32 iPresence)
+FX_BOOL CXFA_Fill::SetPresence(int32_t iPresence)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence);
}
-FX_BOOL CXFA_Fill::SetFillType(FX_INT32 iType)
+FX_BOOL CXFA_Fill::SetFillType(int32_t iType)
{
return FALSE;
}
-FX_BOOL CXFA_Fill::SetPattern(FX_INT32 iPattern, FX_ARGB foreColor)
+FX_BOOL CXFA_Fill::SetPattern(int32_t iPattern, FX_ARGB foreColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Pattern);
CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color);
@@ -202,7 +202,7 @@ FX_BOOL CXFA_Fill::SetPattern(FX_INT32 iPattern, FX_ARGB foreColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor);
return pNode->SetEnum(XFA_ATTRIBUTE_Type, (XFA_ATTRIBUTEENUM)iPattern);
}
-FX_BOOL CXFA_Fill::SetStipple(FX_INT32 iStipple, FX_ARGB stippleColor)
+FX_BOOL CXFA_Fill::SetStipple(int32_t iStipple, FX_ARGB stippleColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Stipple);
CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color);
@@ -213,7 +213,7 @@ FX_BOOL CXFA_Fill::SetStipple(FX_INT32 iStipple, FX_ARGB stippleColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor);
return pNode->SetEnum(XFA_ATTRIBUTE_Rate, (XFA_ATTRIBUTEENUM)iStipple);
}
-FX_BOOL CXFA_Fill::SetLinear(FX_INT32 iLinear, FX_ARGB endColor)
+FX_BOOL CXFA_Fill::SetLinear(int32_t iLinear, FX_ARGB endColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Linear);
CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color);
@@ -224,7 +224,7 @@ FX_BOOL CXFA_Fill::SetLinear(FX_INT32 iLinear, FX_ARGB endColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor);
return pNode->SetEnum(XFA_ATTRIBUTE_Type, (XFA_ATTRIBUTEENUM)iLinear);
}
-FX_BOOL CXFA_Fill::SetRadial(FX_INT32 iRadial, FX_ARGB endColor)
+FX_BOOL CXFA_Fill::SetRadial(int32_t iRadial, FX_ARGB endColor)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Radial);
CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color);
@@ -287,14 +287,14 @@ FX_FLOAT CXFA_Font::GetHorizontalScale() {
CFX_WideString wsValue;
m_pNode->TryCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue);
- FX_INT32 iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue);
+ int32_t iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue);
return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
}
FX_FLOAT CXFA_Font::GetVerticalScale()
{
CFX_WideString wsValue;
m_pNode->TryCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue);
- FX_INT32 iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue);
+ int32_t iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue);
return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
}
FX_FLOAT CXFA_Font::GetLetterSpacing()
@@ -309,37 +309,37 @@ FX_FLOAT CXFA_Font::GetLetterSpacing() }
return ms.ToUnit(XFA_UNIT_Pt);
}
-FX_INT32 CXFA_Font::GetLineThrough()
+int32_t CXFA_Font::GetLineThrough()
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
m_pNode->TryInteger(XFA_ATTRIBUTE_LineThrough, iValue);
return iValue;
}
-FX_INT32 CXFA_Font::GetLineThroughPeriod()
+int32_t CXFA_Font::GetLineThroughPeriod()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All;
m_pNode->TryEnum(XFA_ATTRIBUTE_LineThroughPeriod, eAttr);
return eAttr;
}
-FX_INT32 CXFA_Font::GetOverline()
+int32_t CXFA_Font::GetOverline()
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
m_pNode->TryInteger(XFA_ATTRIBUTE_Overline, iValue);
return iValue;
}
-FX_INT32 CXFA_Font::GetOverlinePeriod()
+int32_t CXFA_Font::GetOverlinePeriod()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All;
m_pNode->TryEnum(XFA_ATTRIBUTE_OverlinePeriod, eAttr);
return eAttr;
}
-FX_INT32 CXFA_Font::GetUnderline()
+int32_t CXFA_Font::GetUnderline()
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
m_pNode->TryInteger(XFA_ATTRIBUTE_Underline, iValue);
return iValue;
}
-FX_INT32 CXFA_Font::GetUnderlinePeriod()
+int32_t CXFA_Font::GetUnderlinePeriod()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All;
m_pNode->TryEnum(XFA_ATTRIBUTE_UnderlinePeriod, eAttr);
@@ -393,40 +393,40 @@ FX_BOOL CXFA_Font::SetBaselineShift(FX_FLOAT fBaselineShift) FX_BOOL CXFA_Font::SetHorizontalScale(FX_FLOAT fHorizontalScale)
{
CFX_WideString wsValue;
- wsValue.Format(L"%d", (FX_INT32)fHorizontalScale);
+ wsValue.Format(L"%d", (int32_t)fHorizontalScale);
return m_pNode->SetCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue);
}
FX_BOOL CXFA_Font::SetVerticalScale(FX_FLOAT fVerticalScale)
{
CFX_WideString wsValue;
- wsValue.Format(L"%d", (FX_INT32)fVerticalScale);
+ wsValue.Format(L"%d", (int32_t)fVerticalScale);
return m_pNode->SetCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue);
}
FX_BOOL CXFA_Font::SetLetterSpacing(FX_FLOAT fLetterSpacing, XFA_UNIT eUnit)
{
return FALSE;
}
-FX_BOOL CXFA_Font::SetLineThrough(FX_INT32 iLineThrough)
+FX_BOOL CXFA_Font::SetLineThrough(int32_t iLineThrough)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_LineThrough, iLineThrough);
}
-FX_BOOL CXFA_Font::SetLineThroughPeriod(FX_INT32 iLineThroughPeriod)
+FX_BOOL CXFA_Font::SetLineThroughPeriod(int32_t iLineThroughPeriod)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_LineThroughPeriod, (XFA_ATTRIBUTEENUM)iLineThroughPeriod);
}
-FX_BOOL CXFA_Font::SetOverline(FX_INT32 iOverline)
+FX_BOOL CXFA_Font::SetOverline(int32_t iOverline)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_Overline, iOverline);
}
-FX_BOOL CXFA_Font::SetOverlinePeriod(FX_INT32 iOverlinePeriod)
+FX_BOOL CXFA_Font::SetOverlinePeriod(int32_t iOverlinePeriod)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_OverlinePeriod, (XFA_ATTRIBUTEENUM)iOverlinePeriod);
}
-FX_BOOL CXFA_Font::SetUnderline(FX_INT32 iUnderline)
+FX_BOOL CXFA_Font::SetUnderline(int32_t iUnderline)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_Underline, iUnderline);
}
-FX_BOOL CXFA_Font::SetUnderlinePeriod(FX_INT32 iUnderlinePeriod)
+FX_BOOL CXFA_Font::SetUnderlinePeriod(int32_t iUnderlinePeriod)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_UnderlinePeriod, (XFA_ATTRIBUTEENUM)iUnderlinePeriod);
}
@@ -434,13 +434,13 @@ CXFA_Caption::CXFA_Caption(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Caption::GetPresence()
+int32_t CXFA_Caption::GetPresence()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Visible;
m_pNode->TryEnum(XFA_ATTRIBUTE_Presence, eAttr);
return eAttr;
}
-FX_INT32 CXFA_Caption::GetPlacementType()
+int32_t CXFA_Caption::GetPlacementType()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left;
m_pNode->TryEnum(XFA_ATTRIBUTE_Placement, eAttr);
@@ -468,11 +468,11 @@ CXFA_Para CXFA_Caption::GetPara() {
return CXFA_Para(m_pNode ? m_pNode->GetChild(0, XFA_ELEMENT_Para) : NULL);
}
-FX_BOOL CXFA_Caption::SetPresence(FX_INT32 iPresence)
+FX_BOOL CXFA_Caption::SetPresence(int32_t iPresence)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence);
}
-FX_BOOL CXFA_Caption::SetPlacementType(FX_INT32 iType)
+FX_BOOL CXFA_Caption::SetPlacementType(int32_t iType)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Placement, (XFA_ATTRIBUTEENUM)iType);
}
@@ -485,13 +485,13 @@ CXFA_Para::CXFA_Para(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Para::GetHorizontalAlign()
+int32_t CXFA_Para::GetHorizontalAlign()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left;
m_pNode->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr);
return eAttr;
}
-FX_INT32 CXFA_Para::GetVerticalAlign()
+int32_t CXFA_Para::GetVerticalAlign()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Top;
m_pNode->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr);
@@ -515,9 +515,9 @@ FX_FLOAT CXFA_Para::GetMarginRight() m_pNode->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms);
return ms.ToUnit(XFA_UNIT_Pt);
}
-FX_INT32 CXFA_Para::GetOrphans()
+int32_t CXFA_Para::GetOrphans()
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
m_pNode->TryInteger(XFA_ATTRIBUTE_Orphans, iValue);
return iValue;
}
@@ -545,17 +545,17 @@ FX_FLOAT CXFA_Para::GetTextIndent() m_pNode->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms);
return ms.ToUnit(XFA_UNIT_Pt);
}
-FX_INT32 CXFA_Para::GetWidows()
+int32_t CXFA_Para::GetWidows()
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
m_pNode->TryInteger(XFA_ATTRIBUTE_Widows, iValue);
return iValue;
}
-FX_BOOL CXFA_Para::SetHorizontalAlign(FX_INT32 iHorizontalAlign)
+FX_BOOL CXFA_Para::SetHorizontalAlign(int32_t iHorizontalAlign)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_HAlign, (XFA_ATTRIBUTEENUM)iHorizontalAlign);
}
-FX_BOOL CXFA_Para::SetVerticalAlign(FX_INT32 iVerticalAlign)
+FX_BOOL CXFA_Para::SetVerticalAlign(int32_t iVerticalAlign)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_VAlign, (XFA_ATTRIBUTEENUM)iVerticalAlign);
}
@@ -574,7 +574,7 @@ FX_BOOL CXFA_Para::SetMarginRight(FX_FLOAT fMarginRight) CXFA_Measurement ms(fMarginRight, XFA_UNIT_Pt);
return m_pNode->SetMeasure(XFA_ATTRIBUTE_MarginRight, ms);
}
-FX_BOOL CXFA_Para::SetOrphans(FX_INT32 iOrphans)
+FX_BOOL CXFA_Para::SetOrphans(int32_t iOrphans)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_Orphans, iOrphans);
}
@@ -598,7 +598,7 @@ FX_BOOL CXFA_Para::SetTextIndent(FX_FLOAT fTextIndent) CXFA_Measurement ms(fTextIndent, XFA_UNIT_Pt);
return m_pNode->SetMeasure(XFA_ATTRIBUTE_TextIndent, ms);
}
-FX_BOOL CXFA_Para::SetWidows(FX_INT32 iWidows)
+FX_BOOL CXFA_Para::SetWidows(int32_t iWidows)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_Widows, iWidows);
}
@@ -607,7 +607,7 @@ CXFA_Keep::CXFA_Keep(CXFA_Node *pNode, CXFA_Node *pParent) , m_pParent(pParent)
{
}
-FX_INT32 CXFA_Keep::GetIntact()
+int32_t CXFA_Keep::GetIntact()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None;
switch (m_pParent->GetClassID()) {
@@ -628,27 +628,27 @@ FX_INT32 CXFA_Keep::GetIntact() m_pNode->TryEnum(XFA_ATTRIBUTE_Intact, eAttr, FALSE);
return eAttr;
}
-FX_INT32 CXFA_Keep::GetNext()
+int32_t CXFA_Keep::GetNext()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None;
m_pNode->TryEnum(XFA_ATTRIBUTE_Next, eAttr);
return eAttr;
}
-FX_INT32 CXFA_Keep::GetPrevious()
+int32_t CXFA_Keep::GetPrevious()
{
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None;
m_pNode->TryEnum(XFA_ATTRIBUTE_Previous, eAttr);
return eAttr;
}
-FX_BOOL CXFA_Keep::SetIntact(FX_INT32 iIntact)
+FX_BOOL CXFA_Keep::SetIntact(int32_t iIntact)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Intact, (XFA_ATTRIBUTEENUM)iIntact);
}
-FX_BOOL CXFA_Keep::SetNext(FX_INT32 iNext)
+FX_BOOL CXFA_Keep::SetNext(int32_t iNext)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Next, (XFA_ATTRIBUTEENUM)iNext);
}
-FX_BOOL CXFA_Keep::SetPrevious(FX_INT32 iPrevious)
+FX_BOOL CXFA_Keep::SetPrevious(int32_t iPrevious)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Previous, (XFA_ATTRIBUTEENUM)iPrevious);
}
@@ -656,15 +656,15 @@ CXFA_Event::CXFA_Event(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Event::GetActivity()
+int32_t CXFA_Event::GetActivity()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Activity);
}
-FX_INT32 CXFA_Event::GetEventType()
+int32_t CXFA_Event::GetEventType()
{
CXFA_Node* pChild = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChild) {
- FX_INT32 eType = pChild->GetClassID();
+ int32_t eType = pChild->GetClassID();
if (eType != XFA_ELEMENT_Extras) {
return eType;
}
@@ -676,12 +676,12 @@ void CXFA_Event::GetRef(CFX_WideStringC &wsRef) {
m_pNode->TryCData(XFA_ATTRIBUTE_Ref, wsRef);
}
-FX_INT32 CXFA_Event::GetExecuteRunAt()
+int32_t CXFA_Event::GetExecuteRunAt()
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute);
return pNode->GetEnum(XFA_ATTRIBUTE_RunAt);
}
-FX_INT32 CXFA_Event::GetExecuteType()
+int32_t CXFA_Event::GetExecuteType()
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute);
return pNode->GetEnum(XFA_ATTRIBUTE_ExecuteType);
@@ -701,7 +701,7 @@ CXFA_Submit CXFA_Event::GetSubmit() {
return m_pNode->GetChild(0, XFA_ELEMENT_Submit);
}
-FX_INT32 CXFA_Event::GetSignDataOperation()
+int32_t CXFA_Event::GetSignDataOperation()
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_SignData);
return pNode->GetEnum(XFA_ATTRIBUTE_Operation);
@@ -714,20 +714,20 @@ void CXFA_Event::GetSignDataTarget(CFX_WideString &wsTarget) wsTarget = wsCData;
}
}
-FX_BOOL CXFA_Event::SetActivity(FX_INT32 iActivity)
+FX_BOOL CXFA_Event::SetActivity(int32_t iActivity)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Activity, (XFA_ATTRIBUTEENUM)iActivity);
}
-FX_BOOL CXFA_Event::SetEventType(FX_INT32 iEventType)
+FX_BOOL CXFA_Event::SetEventType(int32_t iEventType)
{
return FALSE;
}
-FX_BOOL CXFA_Event::SetExecuteRunAt(FX_INT32 iExecuteRunAt)
+FX_BOOL CXFA_Event::SetExecuteRunAt(int32_t iExecuteRunAt)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute);
return pNode->SetEnum(XFA_ATTRIBUTE_RunAt, (XFA_ATTRIBUTEENUM)iExecuteRunAt);
}
-FX_BOOL CXFA_Event::SetExecuteType(FX_INT32 iExecuteType)
+FX_BOOL CXFA_Event::SetExecuteType(int32_t iExecuteType)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute);
return pNode->SetEnum(XFA_ATTRIBUTE_ExecuteType, (XFA_ATTRIBUTEENUM)iExecuteType);
@@ -737,7 +737,7 @@ FX_BOOL CXFA_Event::SetExecuteConnection(const CFX_WideString& wsConnection) CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute);
return pNode->SetCData(XFA_ATTRIBUTE_Connection, wsConnection);
}
-FX_BOOL CXFA_Event::SetSignDataOperation(FX_INT32 iOperation)
+FX_BOOL CXFA_Event::SetSignDataOperation(int32_t iOperation)
{
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_SignData);
return pNode->SetEnum(XFA_ATTRIBUTE_Operation, (XFA_ATTRIBUTEENUM)iOperation);
@@ -773,7 +773,7 @@ XFA_SCRIPTTYPE CXFA_Script::GetContentType() }
return XFA_SCRIPTTYPE_Formcalc;
}
-FX_INT32 CXFA_Script::GetRunAt()
+int32_t CXFA_Script::GetRunAt()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_RunAt);
}
@@ -800,7 +800,7 @@ FX_BOOL CXFA_Script::SetContentType(XFA_SCRIPTTYPE eType) }
return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsType);
}
-FX_BOOL CXFA_Script::SetRunAt(FX_INT32 iRunAt)
+FX_BOOL CXFA_Script::SetRunAt(int32_t iRunAt)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_RunAt, (XFA_ATTRIBUTEENUM)iRunAt);
}
@@ -816,7 +816,7 @@ FX_BOOL CXFA_Submit::IsSubmitEmbedPDF() {
return m_pNode->GetBoolean(XFA_ATTRIBUTE_EmbedPDF);
}
-FX_INT32 CXFA_Submit::GetSubmitFormat()
+int32_t CXFA_Submit::GetSubmitFormat()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Format);
}
@@ -860,7 +860,7 @@ void CXFA_Submit::GetSubmitXDPContent(CFX_WideStringC &wsContent) {
m_pNode->TryCData(XFA_ATTRIBUTE_XdpContent, wsContent);
}
-FX_BOOL CXFA_Submit::SetSubmitFormat(FX_INT32 iSubmitFormat)
+FX_BOOL CXFA_Submit::SetSubmitFormat(int32_t iSubmitFormat)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Format, (XFA_ATTRIBUTEENUM)iSubmitFormat);
}
@@ -977,7 +977,7 @@ FX_BOOL CXFA_Value::SetChildValueContent(const CFX_WideString& wsContent, FX_BOO }
return pNode->SetContent(wsContent, wsFormatContent, bNotify);
}
-FX_INT32 CXFA_Line::GetHand()
+int32_t CXFA_Line::GetHand()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand);
}
@@ -990,11 +990,11 @@ CXFA_Edge CXFA_Line::GetEdge() {
return CXFA_Edge(m_pNode->GetChild(0, XFA_ELEMENT_Edge));
}
-FX_BOOL CXFA_Line::SetHand(FX_INT32 iHand)
+FX_BOOL CXFA_Line::SetHand(int32_t iHand)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Hand, (XFA_ATTRIBUTEENUM)iHand);
}
-FX_BOOL CXFA_Line::SetSlop(FX_INT32 iSlop)
+FX_BOOL CXFA_Line::SetSlop(int32_t iSlop)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Slope, (XFA_ATTRIBUTEENUM)iSlop);
}
@@ -1006,7 +1006,7 @@ void CXFA_Text::GetName(CFX_WideStringC &wsName) {
m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName);
}
-FX_INT32 CXFA_Text::GetMaxChars()
+int32_t CXFA_Text::GetMaxChars()
{
return m_pNode->GetInteger(XFA_ATTRIBUTE_MaxChars);
}
@@ -1031,7 +1031,7 @@ FX_BOOL CXFA_Text::SetName(const CFX_WideString& wsName) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Name, wsName);
}
-FX_BOOL CXFA_Text::SetMaxChars(FX_INT32 iMaxChars)
+FX_BOOL CXFA_Text::SetMaxChars(int32_t iMaxChars)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_MaxChars, iMaxChars);
}
@@ -1051,7 +1051,7 @@ void CXFA_ExData::GetHref(CFX_WideStringC &wsHref) {
m_pNode->TryCData(XFA_ATTRIBUTE_Href, wsHref);
}
-FX_INT32 CXFA_ExData::GetMaxLength()
+int32_t CXFA_ExData::GetMaxLength()
{
return m_pNode->GetInteger(XFA_ATTRIBUTE_MaxLength);
}
@@ -1059,7 +1059,7 @@ void CXFA_ExData::GetRid(CFX_WideStringC &wsRid) {
m_pNode->TryCData(XFA_ATTRIBUTE_Rid, wsRid);
}
-FX_INT32 CXFA_ExData::GetTransferEncoding()
+int32_t CXFA_ExData::GetTransferEncoding()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_TransferEncoding);
}
@@ -1075,7 +1075,7 @@ FX_BOOL CXFA_ExData::SetHref(const CFX_WideString& wsHref) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Href, wsHref);
}
-FX_BOOL CXFA_ExData::SetMaxLength(FX_INT32 iMaxLength)
+FX_BOOL CXFA_ExData::SetMaxLength(int32_t iMaxLength)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_MaxLength, iMaxLength);
}
@@ -1083,7 +1083,7 @@ FX_BOOL CXFA_ExData::SetRid(const CFX_WideString& wsRid) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Rid, wsRid);
}
-FX_BOOL CXFA_ExData::SetTransferEncoding(FX_INT32 iTransferEncoding)
+FX_BOOL CXFA_ExData::SetTransferEncoding(int32_t iTransferEncoding)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding, (XFA_ATTRIBUTEENUM)iTransferEncoding);
}
@@ -1101,7 +1101,7 @@ CXFA_Image::CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue) , m_bDefValue(bDefValue)
{
}
-FX_INT32 CXFA_Image::GetAspect()
+int32_t CXFA_Image::GetAspect()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Aspect);
}
@@ -1116,7 +1116,7 @@ FX_BOOL CXFA_Image::GetHref(CFX_WideString &wsHref) }
return m_pNode->GetAttribute(FX_WSTRC(L"href"), wsHref);
}
-FX_INT32 CXFA_Image::GetTransferEncoding()
+int32_t CXFA_Image::GetTransferEncoding()
{
if (m_bDefValue) {
return m_pNode->GetEnum(XFA_ATTRIBUTE_TransferEncoding);
@@ -1127,7 +1127,7 @@ FX_BOOL CXFA_Image::GetContent(CFX_WideString &wsText) {
return m_pNode->TryContent(wsText);
}
-FX_BOOL CXFA_Image::SetAspect(FX_INT32 iAspect)
+FX_BOOL CXFA_Image::SetAspect(int32_t iAspect)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Aspect, (XFA_ATTRIBUTEENUM)iAspect);
}
@@ -1142,7 +1142,7 @@ FX_BOOL CXFA_Image::SetHref(const CFX_WideString& wsHref) }
return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref);
}
-FX_BOOL CXFA_Image::SetTransferEncoding(FX_INT32 iTransferEncoding)
+FX_BOOL CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding)
{
if (m_bDefValue) {
return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding, (XFA_ATTRIBUTEENUM)iTransferEncoding);
@@ -1162,7 +1162,7 @@ CXFA_Calculate::CXFA_Calculate(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Calculate::GetOverride()
+int32_t CXFA_Calculate::GetOverride()
{
XFA_ATTRIBUTEENUM eAtt = XFA_ATTRIBUTEENUM_Error;
m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, FALSE);
@@ -1181,7 +1181,7 @@ void CXFA_Calculate::GetMessageText(CFX_WideString &wsMessage) }
}
}
-FX_BOOL CXFA_Calculate::SetOverride(FX_INT32 iOverride)
+FX_BOOL CXFA_Calculate::SetOverride(int32_t iOverride)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Override, (XFA_ATTRIBUTEENUM)iOverride);
}
@@ -1197,11 +1197,11 @@ CXFA_Validate::CXFA_Validate(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Validate::GetFormatTest()
+int32_t CXFA_Validate::GetFormatTest()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest);
}
-FX_BOOL CXFA_Validate::SetTestValue(FX_INT32 iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName)
+FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName)
{
XFA_LPCATTRIBUTEENUMINFO pInfo = XFA_GetAttributeEnumByName(wsValue);
if (pInfo) {
@@ -1218,11 +1218,11 @@ FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) {
return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, XFA_ATTRIBUTEENUM_Disabled);
}
-FX_INT32 CXFA_Validate::GetNullTest()
+int32_t CXFA_Validate::GetNullTest()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_NullTest);
}
-FX_INT32 CXFA_Validate::GetScriptTest()
+int32_t CXFA_Validate::GetScriptTest()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_ScriptTest);
}
@@ -1302,11 +1302,11 @@ CXFA_Variables::CXFA_Variables(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Variables::CountScripts()
+int32_t CXFA_Variables::CountScripts()
{
return m_pNode->CountChildren(XFA_ELEMENT_Script);
}
-CXFA_Script CXFA_Variables::GetScript(FX_INT32 nIndex)
+CXFA_Script CXFA_Variables::GetScript(int32_t nIndex)
{
return m_pNode->GetChild(nIndex, XFA_ELEMENT_Script);
}
@@ -1314,7 +1314,7 @@ CXFA_Bind::CXFA_Bind(CXFA_Node* pNode) : CXFA_Data(pNode)
{
}
-FX_INT32 CXFA_Bind::GetMatch()
+int32_t CXFA_Bind::GetMatch()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Match);
}
@@ -1328,7 +1328,7 @@ void CXFA_Bind::GetPicture(CFX_WideString &wsPicture) pPicture->TryContent(wsPicture);
}
}
-FX_BOOL CXFA_Bind::SetMatch(FX_INT32 iMatch)
+FX_BOOL CXFA_Bind::SetMatch(int32_t iMatch)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Match, (XFA_ATTRIBUTEENUM)iMatch);
}
@@ -1399,49 +1399,49 @@ FX_BOOL CXFA_BindItems::SetRef(const CFX_WideString& wsRef) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Ref, wsRef);
}
-FX_INT32 CXFA_Box::GetBreak() const
+int32_t CXFA_Box::GetBreak() const
{
if (!m_pNode) {
return XFA_ATTRIBUTEENUM_Close;
}
return m_pNode->GetEnum(XFA_ATTRIBUTE_Break);
}
-FX_INT32 CXFA_Box::GetHand() const
+int32_t CXFA_Box::GetHand() const
{
if (!m_pNode) {
return XFA_ATTRIBUTEENUM_Even;
}
return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand);
}
-FX_INT32 CXFA_Box::GetPresence() const
+int32_t CXFA_Box::GetPresence() const
{
if (!m_pNode) {
return XFA_ATTRIBUTEENUM_Hidden;
}
return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence);
}
-FX_INT32 CXFA_Box::CountCorners() const
+int32_t CXFA_Box::CountCorners() const
{
if (!m_pNode) {
return 0;
}
return m_pNode->CountChildren(XFA_ELEMENT_Corner);
}
-CXFA_Corner CXFA_Box::GetCorner(FX_INT32 nIndex) const
+CXFA_Corner CXFA_Box::GetCorner(int32_t nIndex) const
{
if (!m_pNode) {
return NULL;
}
return CXFA_Corner(m_pNode->GetProperty(nIndex, XFA_ELEMENT_Corner, nIndex == 0));
}
-FX_INT32 CXFA_Box::CountEdges() const
+int32_t CXFA_Box::CountEdges() const
{
if (!m_pNode) {
return 0;
}
return m_pNode->CountChildren(XFA_ELEMENT_Edge);
}
-CXFA_Edge CXFA_Box::GetEdge(FX_INT32 nIndex) const
+CXFA_Edge CXFA_Box::GetEdge(int32_t nIndex) const
{
if (!m_pNode) {
return NULL;
@@ -1455,7 +1455,7 @@ static void XFA_BOX_GetStrokes(CXFA_Node *pNode, CXFA_StrokeArray &strokes, FX_B return;
}
strokes.SetSize(8);
- FX_INT32 i, j;
+ int32_t i, j;
for (i = 0, j = 0; i < 4; i ++) {
CXFA_Corner corner = CXFA_Corner(pNode->GetProperty(i, XFA_ELEMENT_Corner, i == 0));
if (corner.IsExistInXML() || i == 0) {
@@ -1539,12 +1539,12 @@ CXFA_Margin CXFA_Box::GetMargin() const }
static FX_BOOL XFA_BOX_SameStyles(const CXFA_StrokeArray &strokes)
{
- FX_INT32 iCount = strokes.GetSize();
+ int32_t iCount = strokes.GetSize();
if (iCount < 1) {
return TRUE;
}
CXFA_Stroke stroke1 = strokes[0];
- for (FX_INT32 i = 1; i < iCount; i ++) {
+ for (int32_t i = 1; i < iCount; i ++) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke2.IsExistInXML()) {
continue;
@@ -1566,14 +1566,14 @@ FX_BOOL CXFA_Box::SameStyles() const XFA_BOX_GetStrokes(m_pNode, strokes, TRUE);
return XFA_BOX_SameStyles(strokes);
}
-static FX_INT32 XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &stroke)
+static int32_t XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &stroke)
{
- FX_INT32 iCount = strokes.GetSize();
+ int32_t iCount = strokes.GetSize();
if (iCount < 1) {
return 0;
}
stroke = strokes[0];
- for (FX_INT32 i = 1; i < iCount; i ++) {
+ for (int32_t i = 1; i < iCount; i ++) {
CXFA_Stroke find = strokes[i];
if (!find.IsExistInXML()) {
continue;
@@ -1585,14 +1585,14 @@ static FX_INT32 XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &st break;
}
}
- FX_INT32 iType = stroke.GetStrokeType();
+ int32_t iType = stroke.GetStrokeType();
if (iType == XFA_ATTRIBUTEENUM_Lowered || iType == XFA_ATTRIBUTEENUM_Raised ||
iType == XFA_ATTRIBUTEENUM_Etched || iType == XFA_ATTRIBUTEENUM_Embossed) {
return iType;
}
return 0;
}
-FX_INT32 CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const
+int32_t CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const
{
if (IsArc()) {
return 0;
@@ -1600,25 +1600,25 @@ FX_INT32 CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const CXFA_StrokeArray strokes;
XFA_BOX_GetStrokes(m_pNode, strokes, TRUE);
CXFA_Stroke stroke(NULL);
- FX_INT32 iType = XFA_BOX_3DStyle(strokes, stroke);
+ int32_t iType = XFA_BOX_3DStyle(strokes, stroke);
if (iType) {
bVisible = stroke.IsVisible();
fThickness = stroke.GetThickness();
}
return iType;
}
-FX_INT32 CXFA_Stroke::GetPresence() const
+int32_t CXFA_Stroke::GetPresence() const
{
return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Presence) : XFA_ATTRIBUTEENUM_Invisible;
}
-FX_INT32 CXFA_Stroke::GetCapType() const
+int32_t CXFA_Stroke::GetCapType() const
{
if (!m_pNode) {
return XFA_ATTRIBUTEENUM_Square;
}
return m_pNode->GetEnum(XFA_ATTRIBUTE_Cap);
}
-FX_INT32 CXFA_Stroke::GetStrokeType() const
+int32_t CXFA_Stroke::GetStrokeType() const
{
return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Stroke) : XFA_ATTRIBUTEENUM_Solid;
}
@@ -1670,7 +1670,7 @@ void CXFA_Stroke::SetColor(FX_ARGB argb) wsColor.Format(L"%d,%d,%d", r, g, b);
pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor);
}
-FX_INT32 CXFA_Stroke::GetJoinType() const
+int32_t CXFA_Stroke::GetJoinType() const
{
return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Join) : XFA_ATTRIBUTEENUM_Square;
}
@@ -1704,7 +1704,7 @@ FX_BOOL CXFA_Stroke::SameStyles(CXFA_Stroke stroke, FX_DWORD dwFlags) const }
return TRUE;
}
-FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, FX_INT32 nIndex)
+FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, int32_t nIndex)
{
FX_FLOAT fThickness = 0;
{
@@ -1741,7 +1741,7 @@ CFX_WideString CXFA_WidgetData::GetRawValue() {
return m_pNode->GetContent();
}
-FX_INT32 CXFA_WidgetData::GetAccess(FX_BOOL bTemplate)
+int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate)
{
if (bTemplate) {
CXFA_Node* pNode = m_pNode->GetTemplateNode();
@@ -1752,7 +1752,7 @@ FX_INT32 CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) }
CXFA_Node* pNode = m_pNode;
while (pNode) {
- FX_INT32 iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Access);
+ int32_t iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Access);
if (iAcc != XFA_ATTRIBUTEENUM_Open) {
return iAcc;
}
@@ -1764,20 +1764,20 @@ FX_BOOL CXFA_WidgetData::GetAccessKey(CFX_WideStringC &wsAccessKey) {
return m_pNode->TryCData(XFA_ATTRIBUTE_AccessKey, wsAccessKey);
}
-FX_INT32 CXFA_WidgetData::GetAnchorType()
+int32_t CXFA_WidgetData::GetAnchorType()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_AnchorType);
}
-FX_INT32 CXFA_WidgetData::GetColSpan()
+int32_t CXFA_WidgetData::GetColSpan()
{
return m_pNode->GetInteger(XFA_ATTRIBUTE_ColSpan);
}
-FX_INT32 CXFA_WidgetData::GetPresence()
+int32_t CXFA_WidgetData::GetPresence()
{
return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence);
CXFA_Node* pNode = m_pNode;
while (pNode && pNode->GetObjectType() == XFA_OBJECTTYPE_ContainerNode) {
- FX_INT32 iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Presence);
+ int32_t iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Presence);
if ( iAcc != XFA_ATTRIBUTEENUM_Visible) {
return iAcc;
}
@@ -1785,13 +1785,13 @@ FX_INT32 CXFA_WidgetData::GetPresence() }
return XFA_ATTRIBUTEENUM_Visible;
}
-FX_INT32 CXFA_WidgetData::GetRotate()
+int32_t CXFA_WidgetData::GetRotate()
{
CXFA_Measurement ms;
if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, FALSE)) {
return 0;
}
- FX_INT32 iRotate = FXSYS_round(ms.GetValue());
+ int32_t iRotate = FXSYS_round(ms.GetValue());
iRotate = XFA_MapRotation(iRotate);
return iRotate / 90 * 90;
}
@@ -1823,12 +1823,12 @@ void CXFA_WidgetData::GetEventList(CXFA_NodeArray &events) {
m_pNode->GetNodeList(events, 0, XFA_ELEMENT_Event);
}
-FX_INT32 CXFA_WidgetData::GetEventByActivity(FX_INT32 iActivity, CXFA_NodeArray &events, FX_BOOL bIsFormReady)
+int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity, CXFA_NodeArray &events, FX_BOOL bIsFormReady)
{
CXFA_NodeArray allEvents;
GetEventList(allEvents);
- FX_INT32 iCount = allEvents.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
+ int32_t iCount = allEvents.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
CXFA_Event event(allEvents[i]);
if (event.GetActivity() == iActivity) {
if (iActivity == XFA_ATTRIBUTEENUM_Ready) {
@@ -1911,7 +1911,7 @@ CXFA_BindItems CXFA_WidgetData::GetBindItems() {
return m_pNode->GetChild(0, XFA_ELEMENT_BindItems);
}
-FX_BOOL CXFA_WidgetData::SetAccess(FX_INT32 iAccess, FX_BOOL bNotify)
+FX_BOOL CXFA_WidgetData::SetAccess(int32_t iAccess, FX_BOOL bNotify)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Access, (XFA_ATTRIBUTEENUM)iAccess, bNotify);
}
@@ -1919,19 +1919,19 @@ FX_BOOL CXFA_WidgetData::SetAccessKey(const CFX_WideString& wsAccessKey) {
return m_pNode->SetCData(XFA_ATTRIBUTE_AccessKey, wsAccessKey);
}
-FX_BOOL CXFA_WidgetData::SetAnchorType(FX_INT32 iType)
+FX_BOOL CXFA_WidgetData::SetAnchorType(int32_t iType)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_AnchorType, (XFA_ATTRIBUTEENUM)iType);
}
-FX_BOOL CXFA_WidgetData::SetColSpan(FX_INT32 iColSpan)
+FX_BOOL CXFA_WidgetData::SetColSpan(int32_t iColSpan)
{
return m_pNode->SetInteger(XFA_ATTRIBUTE_ColSpan, (XFA_ATTRIBUTEENUM)iColSpan);
}
-FX_BOOL CXFA_WidgetData::SetPresence(FX_INT32 iPresence)
+FX_BOOL CXFA_WidgetData::SetPresence(int32_t iPresence)
{
return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence);
}
-FX_BOOL CXFA_WidgetData::SetRotate(FX_INT32 iRotate)
+FX_BOOL CXFA_WidgetData::SetRotate(int32_t iRotate)
{
iRotate = XFA_MapRotation(iRotate);
CXFA_Measurement ms((FX_FLOAT)iRotate, XFA_UNIT_Angle);
@@ -1977,7 +1977,7 @@ FX_BOOL CXFA_WidgetData::SetName(const CFX_WideString& wsName) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Name, wsName);
}
-FX_BOOL CXFA_WidgetData::SetButtonHighlight(FX_INT32 iButtonHighlight)
+FX_BOOL CXFA_WidgetData::SetButtonHighlight(int32_t iButtonHighlight)
{
CXFA_Node* pUiChildNode = GetUIChild();
return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Highlight, (XFA_ATTRIBUTEENUM)iButtonHighlight);
@@ -1990,12 +1990,12 @@ FX_BOOL CXFA_WidgetData::SetButtonDown(const CFX_WideString& wsDown, FX_BOOL bRi {
return FALSE;
}
-FX_BOOL CXFA_WidgetData::SetCheckButtonShape(FX_INT32 iCheckButtonShape)
+FX_BOOL CXFA_WidgetData::SetCheckButtonShape(int32_t iCheckButtonShape)
{
CXFA_Node* pUiChildNode = GetUIChild();
return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Shape, (XFA_ATTRIBUTEENUM)iCheckButtonShape);
}
-FX_BOOL CXFA_WidgetData::SetCheckButtonMark(FX_INT32 iCheckButtonMark)
+FX_BOOL CXFA_WidgetData::SetCheckButtonMark(int32_t iCheckButtonMark)
{
CXFA_Node* pUiChildNode = GetUIChild();
return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Mark, (XFA_ATTRIBUTEENUM)iCheckButtonMark);
@@ -2058,7 +2058,7 @@ void CXFA_WidgetData::GetUIMargin(CFX_RectF &rtUIMargin) }
rtUIMargin.Set(fLeftInset, fTopInset, fRightInset, fBottomInset);
}
-FX_INT32 CXFA_WidgetData::GetButtonHighlight()
+int32_t CXFA_WidgetData::GetButtonHighlight()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2100,7 +2100,7 @@ FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString &wsDown, FX_BOOL &bRichTex }
return FALSE;
}
-FX_INT32 CXFA_WidgetData::GetCheckButtonShape()
+int32_t CXFA_WidgetData::GetCheckButtonShape()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2108,7 +2108,7 @@ FX_INT32 CXFA_WidgetData::GetCheckButtonShape() }
return XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT_CheckButton, XFA_ATTRIBUTE_Shape, XFA_XDPPACKET_Form);
}
-FX_INT32 CXFA_WidgetData::GetCheckButtonMark()
+int32_t CXFA_WidgetData::GetCheckButtonMark()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2147,7 +2147,7 @@ XFA_CHECKSTATE CXFA_WidgetData::GetCheckState() }
if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_ELEMENT_Items)) {
CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
- FX_INT32 i = 0;
+ int32_t i = 0;
while(pText) {
CFX_WideString wsContent;
if (pText->TryContent(wsContent) && (wsContent == wsValue)) {
@@ -2203,7 +2203,7 @@ void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState, FX_BOOL bNotify) if (!pItems) {
return;
}
- FX_INT32 i = -1;
+ int32_t i = -1;
CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
CFX_WideString wsContent;
while (pText) {
@@ -2316,7 +2316,7 @@ CXFA_Node* CXFA_WidgetData::GetExclGroupNextMember(CXFA_Node* pNode) }
return NULL;
}
-FX_INT32 CXFA_WidgetData::GetChoiceListCommitOn()
+int32_t CXFA_WidgetData::GetChoiceListCommitOn()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2332,7 +2332,7 @@ FX_BOOL CXFA_WidgetData::IsChoiceListAllowTextEntry() }
return XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT_ChoiceList, XFA_ATTRIBUTE_TextEntry, XFA_XDPPACKET_Form);
}
-FX_INT32 CXFA_WidgetData::GetChoiceListOpen()
+int32_t CXFA_WidgetData::GetChoiceListOpen()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2342,14 +2342,14 @@ FX_INT32 CXFA_WidgetData::GetChoiceListOpen() }
FX_BOOL CXFA_WidgetData::IsListBox()
{
- FX_INT32 iOpenMode = GetChoiceListOpen();
+ int32_t iOpenMode = GetChoiceListOpen();
return (iOpenMode == XFA_ATTRIBUTEENUM_Always || iOpenMode == XFA_ATTRIBUTEENUM_MultiSelect);
}
-FX_INT32 CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue)
+int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue)
{
CXFA_NodeArray pItems;
CXFA_Node* pItem = NULL;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() != XFA_ELEMENT_Items) {
@@ -2375,12 +2375,12 @@ FX_INT32 CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) pItems.RemoveAll();
return pItem->CountChildren(XFA_ELEMENT_UNKNOWN);
}
-FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString &wsText, FX_INT32 nIndex, FX_BOOL bSaveValue )
+FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString &wsText, int32_t nIndex, FX_BOOL bSaveValue )
{
wsText.Empty();
CXFA_NodeArray pItemsArray;
CXFA_Node* pItems = NULL;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() != XFA_ELEMENT_Items) {
@@ -2416,7 +2416,7 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray &wsTextArray, FX_BO {
CXFA_NodeArray pItems;
CXFA_Node* pItem = NULL;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetClassID() != XFA_ELEMENT_Items) {
@@ -2445,20 +2445,20 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray &wsTextArray, FX_BO pNode->TryContent(wsTextArray.Add());
}
}
-FX_INT32 CXFA_WidgetData::CountSelectedItems()
+int32_t CXFA_WidgetData::CountSelectedItems()
{
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
if (IsListBox() || !IsChoiceListAllowTextEntry()) {
return wsValueArray.GetSize();
}
- FX_INT32 iSelected = 0;
+ int32_t iSelected = 0;
CFX_WideStringArray wsSaveTextArray;
GetChoiceListItems(wsSaveTextArray, TRUE);
- FX_INT32 iValues = wsValueArray.GetSize();
- for (FX_INT32 i = 0; i < iValues; i++) {
- FX_INT32 iSaves = wsSaveTextArray.GetSize();
- for (FX_INT32 j = 0; j < iSaves; j++) {
+ int32_t iValues = wsValueArray.GetSize();
+ for (int32_t i = 0; i < iValues; i++) {
+ int32_t iSaves = wsSaveTextArray.GetSize();
+ for (int32_t j = 0; j < iSaves; j++) {
if (wsValueArray[i] == wsSaveTextArray[j]) {
iSelected++;
break;
@@ -2467,15 +2467,15 @@ FX_INT32 CXFA_WidgetData::CountSelectedItems() }
return iSelected;
}
-FX_INT32 CXFA_WidgetData::GetSelectedItem(FX_INT32 nIndex )
+int32_t CXFA_WidgetData::GetSelectedItem(int32_t nIndex )
{
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
- FX_INT32 iSelected = 0;
+ int32_t iSelected = 0;
CFX_WideStringArray wsSaveTextArray;
GetChoiceListItems(wsSaveTextArray, TRUE);
- FX_INT32 iSaves = wsSaveTextArray.GetSize();
- for (FX_INT32 j = 0; j < iSaves; j++) {
+ int32_t iSaves = wsSaveTextArray.GetSize();
+ for (int32_t j = 0; j < iSaves; j++) {
if (wsValueArray[nIndex] == wsSaveTextArray[j]) {
return j;
}
@@ -2486,15 +2486,15 @@ void CXFA_WidgetData::GetSelectedItems(CFX_Int32Array &iSelArray) {
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
- FX_INT32 iValues = wsValueArray.GetSize();
+ int32_t iValues = wsValueArray.GetSize();
if (iValues < 1) {
return;
}
CFX_WideStringArray wsSaveTextArray;
GetChoiceListItems(wsSaveTextArray, TRUE);
- FX_INT32 iSaves = wsSaveTextArray.GetSize();
- for (FX_INT32 i = 0; i < iValues; i++) {
- for (FX_INT32 j = 0; j < iSaves; j++) {
+ int32_t iSaves = wsSaveTextArray.GetSize();
+ for (int32_t i = 0; i < iValues; i++) {
+ for (int32_t j = 0; j < iSaves; j++) {
if (wsValueArray[i] == wsSaveTextArray[j]) {
iSelArray.Add(j);
break;
@@ -2507,9 +2507,9 @@ void CXFA_WidgetData::GetSelectedItemsValue(CFX_WideStringArray &wsSelTextArray) CFX_WideString wsValue = GetRawValue();
if (GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) {
if (!wsValue.IsEmpty()) {
- FX_INT32 iStart = 0;
- FX_INT32 iLength = wsValue.GetLength();
- FX_INT32 iEnd = wsValue.Find(L'\n', iStart);
+ int32_t iStart = 0;
+ int32_t iLength = wsValue.GetLength();
+ int32_t iEnd = wsValue.Find(L'\n', iStart);
iEnd = (iEnd == -1) ? iLength : iEnd;
while (iEnd >= iStart) {
wsSelTextArray.Add(wsValue.Mid(iStart, iEnd - iStart));
@@ -2527,7 +2527,7 @@ void CXFA_WidgetData::GetSelectedItemsValue(CFX_WideStringArray &wsSelTextArray) wsSelTextArray.Add(wsValue);
}
}
-FX_BOOL CXFA_WidgetData::GetItemState(FX_INT32 nIndex)
+FX_BOOL CXFA_WidgetData::GetItemState(int32_t nIndex)
{
if (nIndex < 0) {
return FALSE;
@@ -2539,15 +2539,15 @@ FX_BOOL CXFA_WidgetData::GetItemState(FX_INT32 nIndex) }
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
- FX_INT32 iValues = wsValueArray.GetSize();
- for (FX_INT32 j = 0; j < iValues; j++) {
+ int32_t iValues = wsValueArray.GetSize();
+ for (int32_t j = 0; j < iValues; j++) {
if (wsValueArray[j] == wsSaveTextArray[nIndex]) {
return TRUE;
}
}
return FALSE;
}
-void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData)
+void CXFA_WidgetData::SetItemState(int32_t nIndex, FX_BOOL bSelected, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData)
{
if (nIndex < 0) {
return;
@@ -2557,11 +2557,11 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b if (wsSaveTextArray.GetSize() <= nIndex) {
return;
}
- FX_INT32 iSel = -1;
+ int32_t iSel = -1;
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
- FX_INT32 iValues = wsValueArray.GetSize();
- for (FX_INT32 j = 0; j < iValues; j++) {
+ int32_t iValues = wsValueArray.GetSize();
+ for (int32_t j = 0; j < iValues; j++) {
if (wsValueArray[j] == wsSaveTextArray[nIndex]) {
iSel = j;
break;
@@ -2580,7 +2580,7 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b } else if (iSel >= 0) {
CFX_Int32Array iSelArray;
GetSelectedItems(iSelArray);
- for (FX_INT32 i = 0; i < iSelArray.GetSize(); i++) {
+ for (int32_t i = 0; i < iSelArray.GetSize(); i++) {
if (iSelArray[i] == nIndex) {
iSelArray.RemoveAt(i);
break;
@@ -2604,12 +2604,12 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b void CXFA_WidgetData::SetSelectdItems(CFX_Int32Array &iSelArray, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData)
{
CFX_WideString wsValue;
- FX_INT32 iSize = iSelArray.GetSize();
+ int32_t iSize = iSelArray.GetSize();
if (iSize >= 1) {
CFX_WideStringArray wsSaveTextArray;
GetChoiceListItems(wsSaveTextArray, TRUE);
CFX_WideString wsItemValue;
- for (FX_INT32 i = 0; i < iSize; i++) {
+ for (int32_t i = 0; i < iSize; i++) {
wsItemValue = (iSize == 1) ? wsSaveTextArray[iSelArray[i]] : wsSaveTextArray[iSelArray[i]] + FX_WSTRC(L"\n");
wsValue += wsItemValue;
}
@@ -2631,14 +2631,14 @@ void CXFA_WidgetData::ClearAllSelections() SyncValue(CFX_WideString(), FALSE);
}
}
-void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideString &wsValue, FX_INT32 nIndex , FX_BOOL bNotify )
+void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideString &wsValue, int32_t nIndex , FX_BOOL bNotify )
{
CFX_WideString wsNewValue(wsValue);
if (wsNewValue.IsEmpty()) {
wsNewValue = wsLabel;
}
CXFA_NodeArray listitems;
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_Node *pItemNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pItemNode; pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pItemNode->GetClassID() != XFA_ELEMENT_Items) {
@@ -2656,7 +2656,7 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE);
InsertListTextItem(pSaveItems, wsNewValue, nIndex);
} else if (iCount > 1) {
- for (FX_INT32 i = 0; i < 2; i++) {
+ for (int32_t i = 0; i < 2; i++) {
CXFA_Node* pNode = listitems[i];
FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save);
if (bHasSave) {
@@ -2675,7 +2675,7 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt pSaveItems->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Hidden);
listitems.RemoveAll();
CXFA_Node *pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
- FX_INT32 i = 0;
+ int32_t i = 0;
while(pListNode) {
CFX_WideString wsOldValue;
pListNode->TryContent(wsOldValue);
@@ -2689,11 +2689,11 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt if(!bNotify) {
return;
}
- m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemAdded, (FX_LPVOID)(FX_LPCWSTR)wsLabel, (FX_LPVOID)(FX_LPCWSTR)wsValue, (FX_LPVOID)(FX_UINTPTR)nIndex);
+ m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemAdded, (FX_LPVOID)(FX_LPCWSTR)wsLabel, (FX_LPVOID)(FX_LPCWSTR)wsValue, (FX_LPVOID)(uintptr_t)nIndex);
}
void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_NodeArray listitems;
CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -2716,7 +2716,7 @@ void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel) pSaveItems = listitems[1];
}
iCount = 0;
- FX_INT32 iSearch = -1;
+ int32_t iSearch = -1;
CFX_WideString wsContent;
CXFA_Node* pChildItem = pSaveItems->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pChildItem; pChildItem = pChildItem->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -2737,7 +2737,7 @@ void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel) }
void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue)
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CXFA_NodeArray listitems;
CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -2760,7 +2760,7 @@ void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue) pSaveItems = listitems[1];
}
iCount = 0;
- FX_INT32 iSearch = -1;
+ int32_t iSearch = -1;
CFX_WideString wsContent;
CXFA_Node* pChildItem = pLabelItems->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pChildItem; pChildItem = pChildItem->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -2779,7 +2779,7 @@ void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue) }
}
}
-FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData)
+FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData)
{
FX_BOOL bSetValue = FALSE;
CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -2796,7 +2796,7 @@ FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bS SetItemState(nIndex, FALSE, TRUE, bScriptModify, bSyncData);
bSetValue = TRUE;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pNode) {
if (i == nIndex) {
@@ -2811,10 +2811,10 @@ FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bS if(!bNotify) {
return TRUE;
}
- m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemRemoved, (FX_LPVOID)(FX_UINTPTR)nIndex);
+ m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemRemoved, (FX_LPVOID)(uintptr_t)nIndex);
return TRUE;
}
-FX_INT32 CXFA_WidgetData::GetHorizontalScrollPolicy()
+int32_t CXFA_WidgetData::GetHorizontalScrollPolicy()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -2822,7 +2822,7 @@ FX_INT32 CXFA_WidgetData::GetHorizontalScrollPolicy() }
return XFA_ATTRIBUTEENUM_Auto;
}
-FX_INT32 CXFA_WidgetData::GetNumberOfCells()
+int32_t CXFA_WidgetData::GetNumberOfCells()
{
CXFA_Node* pUIChild = GetUIChild();
if (!pUIChild) {
@@ -2842,7 +2842,7 @@ CFX_WideString CXFA_WidgetData::GetBarcodeType() CXFA_Node* pUIChild = GetUIChild();
return pUIChild ? pUIChild->GetCData(XFA_ATTRIBUTE_Type) : NULL;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsCharEncoding;
@@ -2857,7 +2857,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(FX_INT32& val) }
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eChecksum;
@@ -2881,7 +2881,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_INT32& val) }
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsDataLength;
@@ -2915,7 +2915,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) }
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsECLevel;
@@ -2925,22 +2925,22 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(FX_INT32& val) }
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleWidth, mModuleWidthHeight)) {
- val = (FX_INT32)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
+ val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
return TRUE;
}
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleHeight, mModuleWidthHeight)) {
- val = (FX_INT32)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
+ val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
return TRUE;
}
return FALSE;
@@ -2955,7 +2955,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(FX_BOOL& val) }
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(FX_INT32& val)
+FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val)
{
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eTextLocation;
@@ -3002,7 +3002,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) if(ptPos >= 0) {
fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio);
} else {
- FX_INT32 fA, fB;
+ int32_t fA, fB;
fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos));
fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1));
if(fB) {
@@ -3045,7 +3045,7 @@ FX_BOOL CXFA_WidgetData::IsMultiLine() }
return XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT_TextEdit, XFA_ATTRIBUTE_MultiLine, XFA_XDPPACKET_Form);
}
-FX_INT32 CXFA_WidgetData::GetVerticalScrollPolicy()
+int32_t CXFA_WidgetData::GetVerticalScrollPolicy()
{
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild) {
@@ -3053,7 +3053,7 @@ FX_INT32 CXFA_WidgetData::GetVerticalScrollPolicy() }
return XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT_TextEdit, XFA_ATTRIBUTE_VScrollPolicy, XFA_XDPPACKET_Form);
}
-FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType)
+int32_t CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType)
{
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_ELEMENT_Value)) {
if (CXFA_Node* pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild)) {
@@ -3063,7 +3063,7 @@ FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) return pChild->GetInteger(XFA_ATTRIBUTE_MaxChars);
case XFA_ELEMENT_ExData: {
eType = XFA_ELEMENT_ExData;
- FX_INT32 iMax = pChild->GetInteger(XFA_ATTRIBUTE_MaxLength);
+ int32_t iMax = pChild->GetInteger(XFA_ATTRIBUTE_MaxLength);
return iMax < 0 ? 0 : iMax;
}
default:
@@ -3073,7 +3073,7 @@ FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) }
return 0;
}
-FX_BOOL CXFA_WidgetData::GetFracDigits(FX_INT32 &iFracDigits)
+FX_BOOL CXFA_WidgetData::GetFracDigits(int32_t &iFracDigits)
{
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_ELEMENT_Value)) {
if (CXFA_Node* pChild = pNode->GetChild(0, XFA_ELEMENT_Decimal)) {
@@ -3083,7 +3083,7 @@ FX_BOOL CXFA_WidgetData::GetFracDigits(FX_INT32 &iFracDigits) iFracDigits = -1;
return FALSE;
}
-FX_BOOL CXFA_WidgetData::GetLeadDigits(FX_INT32 &iLeadDigits)
+FX_BOOL CXFA_WidgetData::GetLeadDigits(int32_t &iLeadDigits)
{
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_ELEMENT_Value)) {
if (CXFA_Node* pChild = pNode->GetChild(0, XFA_ELEMENT_Decimal)) {
@@ -3106,22 +3106,22 @@ static CFX_WideString XFA_NumericNormalize(const CFX_WideString &wsValue, IFX_Lo wsNewValue.TrimLeft(L" ");
wsNewValue.TrimLeft(L"0");
wsNewValue.TrimRight(L" ");
- FX_INT32 iCount = wsNewValue.GetLength();
+ int32_t iCount = wsNewValue.GetLength();
if (iCount == 0) {
return FX_WSTRC(L"0");
}
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
CFX_WideString wsRet;
FX_LPWSTR pRetBuffer = wsRet.GetBuffer(iCount);
- FX_INT32 iDestCount = 0;
- FX_INT32 i = 0;
+ int32_t iDestCount = 0;
+ int32_t i = 0;
if (wsNewValue[i] == L'-') {
pRetBuffer[iIndex++] = '-';
} else if (wsNewValue[i] == L'+') {
i++;
}
FX_BOOL bHasPoint = FALSE;
- FX_INT32 nCharStart = -1;
+ int32_t nCharStart = -1;
for ( ; i < iCount; i ++) {
FX_WCHAR wc = wsNewValue[i];
if (XFA_IsDigit(wc)) {
@@ -3152,18 +3152,18 @@ static CFX_WideString XFA_NumericNormalize(const CFX_WideString &wsValue, IFX_Lo wsRet.ReleaseBuffer(iCount);
return wsRet;
}
-CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, FX_INT32 iLead, FX_INT32 iTread)
+CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, int32_t iLead, int32_t iTread)
{
if ((iLead == - 1) && (iTread == -1)) {
return wsValue;
}
CFX_WideString wsRet;
- FX_INT32 iLead_ = 0, iTread_ = -1;
- FX_INT32 iCount = wsValue.GetLength();
+ int32_t iLead_ = 0, iTread_ = -1;
+ int32_t iCount = wsValue.GetLength();
if (iCount == 0) {
return wsValue;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
if (wsValue[i] == L'-') {
wsRet += L'-';
i++;
@@ -3222,8 +3222,8 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTUR widgetValue = CXFA_LocaleValue(widgetValue.GetType(), wsNewText, wsPicture, pLocale, pLocalMgr);
wsNewText = widgetValue.GetValue();
if (uiType == XFA_ELEMENT_NumericEdit) {
- FX_INT32 iLeadDigits = 0;
- FX_INT32 iFracDigits = 0;
+ int32_t iLeadDigits = 0;
+ int32_t iFracDigits = 0;
GetLeadDigits(iLeadDigits);
GetFracDigits(iFracDigits);
wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits);
@@ -3233,8 +3233,8 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTUR } else {
if (uiType == XFA_ELEMENT_NumericEdit) {
if (wsNewText != FX_WSTRC(L"0")) {
- FX_INT32 iLeadDigits = 0;
- FX_INT32 iFracDigits = 0;
+ int32_t iLeadDigits = 0;
+ int32_t iFracDigits = 0;
GetLeadDigits(iLeadDigits);
GetFracDigits(iFracDigits);
wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits);
@@ -3369,8 +3369,8 @@ static FX_BOOL XFA_SplitDateTime(const CFX_WideString& wsDateTime, CFX_WideStrin }
wsDate = wsDateTime.Left(nSplitIndex);
if (!wsDate.IsEmpty()) {
- FX_INT32 iCount = wsDate.GetLength();
- FX_INT32 i = 0;
+ int32_t iCount = wsDate.GetLength();
+ int32_t i = 0;
for (i = 0; i < iCount; i++) {
if (wsDate[i] >= '0' && wsDate[i] <= '9') {
break;
@@ -3382,8 +3382,8 @@ static FX_BOOL XFA_SplitDateTime(const CFX_WideString& wsDateTime, CFX_WideStrin }
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
if (!wsTime.IsEmpty()) {
- FX_INT32 iCount = wsTime.GetLength();
- FX_INT32 i = 0;
+ int32_t iCount = wsTime.GetLength();
+ int32_t i = 0;
for (i = 0; i < iCount; i++) {
if (wsTime[i] >= '0' && wsTime[i] <= '9') {
break;
@@ -3460,7 +3460,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString &wsValue, XFA_VALUEPICTURE eVal switch(uiType) {
case XFA_ELEMENT_ChoiceList: {
if (eValueType == XFA_VALUEPICTURE_Display) {
- FX_INT32 iSelItemIndex = GetSelectedItem(0);
+ int32_t iSelItemIndex = GetSelectedItem(0);
if (iSelItemIndex >= 0) {
GetChoiceListItem(wsValue, iSelItemIndex);
wsPicture.Empty();
@@ -3559,7 +3559,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(FX_WSTR wsValue, CFX_WideString &wsF if (!pValueChild) {
return FALSE;
}
- FX_INT32 iVTType = XFA_VT_NULL;
+ int32_t iVTType = XFA_VT_NULL;
XFA_ELEMENT eType = pValueChild->GetClassID();
switch (eType) {
case XFA_ELEMENT_Decimal:
@@ -3627,8 +3627,8 @@ void CXFA_WidgetData::NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideStr }
wsOutput = wsValue;
wsOutput.TrimLeft('0');
- FX_INT32 dot_index = wsOutput.Find('.');
- FX_INT32 iFracDigits = 0;
+ int32_t dot_index = wsOutput.Find('.');
+ int32_t iFracDigits = 0;
if (!wsOutput.IsEmpty() && dot_index >= 0 && (!GetFracDigits(iFracDigits) || iFracDigits != -1)) {
wsOutput.TrimRight(L"0");
wsOutput.TrimRight(L".");
@@ -3650,16 +3650,16 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue, IFX_Locale* pL bNeg = TRUE;
wsSrcNum.Delete(0, 1);
}
- FX_INT32 len = wsSrcNum.GetLength();
- FX_INT32 dot_index = wsSrcNum.Find('.');
+ int32_t len = wsSrcNum.GetLength();
+ int32_t dot_index = wsSrcNum.Find('.');
if (dot_index == -1) {
dot_index = len;
}
- FX_INT32 cc = dot_index - 1;
+ int32_t cc = dot_index - 1;
if (cc >= 0) {
int nPos = dot_index % 3;
wsOutput.Empty();
- for (FX_INT32 i = 0; i < dot_index; i++) {
+ for (int32_t i = 0; i < dot_index; i++) {
if (i % 3 == nPos && i != 0) {
wsOutput += wsGroupSymbol;
}
@@ -3690,7 +3690,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue, FX_BOOL bNotify) }
m_pNode->SetContent(wsValue, wsFormatValue, bNotify);
}
-void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, FX_INT32 nIndex )
+void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, int32_t nIndex )
{
CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_ELEMENT_Text);
pItems->InsertChild(nIndex, pText);
@@ -3712,9 +3712,9 @@ CXFA_Manifest CXFA_WidgetData::GetManifest(FX_BOOL bModified) }
CXFA_Occur::CXFA_Occur(CXFA_Node *pNode) : CXFA_Data(pNode)
{ }
-FX_INT32 CXFA_Occur::GetMax()
+int32_t CXFA_Occur::GetMax()
{
- FX_INT32 iMax = 1;
+ int32_t iMax = 1;
if (m_pNode) {
if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, TRUE)) {
iMax = GetMin();
@@ -3722,9 +3722,9 @@ FX_INT32 CXFA_Occur::GetMax() }
return iMax;
}
-FX_INT32 CXFA_Occur::GetMin()
+int32_t CXFA_Occur::GetMin()
{
- FX_INT32 iMin = 1;
+ int32_t iMin = 1;
if (m_pNode) {
if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, TRUE) || iMin < 0) {
iMin = 1;
@@ -3732,18 +3732,18 @@ FX_INT32 CXFA_Occur::GetMin() }
return iMin;
}
-FX_INT32 CXFA_Occur::GetInitial()
+int32_t CXFA_Occur::GetInitial()
{
- FX_INT32 iInit = 1;
+ int32_t iInit = 1;
if (m_pNode) {
- FX_INT32 iMin = GetMin();
+ int32_t iMin = GetMin();
if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, TRUE) || iInit < iMin) {
iInit = iMin;
}
}
return iInit;
}
-FX_BOOL CXFA_Occur::GetOccurInfo(FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit)
+FX_BOOL CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit)
{
if(!m_pNode) {
return FALSE;
@@ -3763,21 +3763,21 @@ FX_BOOL CXFA_Occur::GetOccurInfo(FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit }
return TRUE;
}
-void CXFA_Occur::SetMax(FX_INT32 iMax)
+void CXFA_Occur::SetMax(int32_t iMax)
{
iMax = (iMax != -1 && iMax < 1) ? 1 : iMax;
m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
- FX_INT32 iMin = GetMin();
+ int32_t iMin = GetMin();
if (iMax != -1 && iMax < iMin) {
iMin = iMax;
m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE);
}
}
-void CXFA_Occur::SetMin(FX_INT32 iMin)
+void CXFA_Occur::SetMin(int32_t iMin)
{
iMin = (iMin < 0) ? 1 : iMin;
m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE);
- FX_INT32 iMax = GetMax();
+ int32_t iMax = GetMax();
if (iMax > 0 && iMax < iMin) {
iMax = iMin;
m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
@@ -3933,9 +3933,9 @@ CFX_WideString CXFA_Filter::GetlockDocumentContent() }
return wsContent;
}
-FX_INT32 CXFA_Filter::GetMDPPermissions()
+int32_t CXFA_Filter::GetMDPPermissions()
{
- FX_INT32 iPermissions = 2;
+ int32_t iPermissions = 2;
if (m_pNode) {
CXFA_Node* pMDPNode = m_pNode->GetProperty(0, XFA_ELEMENT_Mdp);
if (!pMDPNode->TryInteger(XFA_ATTRIBUTE_Permissions, iPermissions, TRUE)) {
@@ -3993,11 +3993,11 @@ XFA_ATTRIBUTEENUM CXFA_WrapCertificate::GetType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_WrapCertificate::CountCertificates()
+int32_t CXFA_WrapCertificate::CountCertificates()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Certificate) : 0;
}
-CXFA_Certificate CXFA_WrapCertificate::GetCertificate(FX_INT32 nIndex)
+CXFA_Certificate CXFA_WrapCertificate::GetCertificate(int32_t nIndex)
{
return CXFA_Certificate((nIndex > -1 && m_pNode) ? m_pNode->GetChild(nIndex, XFA_ELEMENT_Certificate) : NULL);
}
@@ -4005,11 +4005,11 @@ XFA_ATTRIBUTEENUM CXFA_Oids::GetOidsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_Oids::CountOids()
+int32_t CXFA_Oids::CountOids()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Oid) : 0;
}
-CFX_WideString CXFA_Oids::GetOidContent(FX_INT32 nIndex)
+CFX_WideString CXFA_Oids::GetOidContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4026,11 +4026,11 @@ XFA_ATTRIBUTEENUM CXFA_SubjectDNs::GetSubjectDNsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_SubjectDNs::CountSubjectDNs()
+int32_t CXFA_SubjectDNs::CountSubjectDNs()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_SubjectDN) : 0;
}
-CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(FX_INT32 nIndex, XFA_ATTRIBUTE eAttribute)
+CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(int32_t nIndex, XFA_ATTRIBUTE eAttribute)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4043,7 +4043,7 @@ CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(FX_INT32 nIndex, XFA_ATTRIBUT pSubjectDNNode->GetAttribute(eAttribute, wsAttributeValue, FALSE);
return wsAttributeValue;
}
-CFX_WideString CXFA_SubjectDNs::GetSubjectDNContent(FX_INT32 nIndex)
+CFX_WideString CXFA_SubjectDNs::GetSubjectDNContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4060,11 +4060,11 @@ XFA_ATTRIBUTEENUM CXFA_DigestMethods::GetDigestMethodsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_DigestMethods::CountDigestMethods()
+int32_t CXFA_DigestMethods::CountDigestMethods()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_DigestMethod) : 0;
}
-CFX_WideString CXFA_DigestMethods::GetDigestMethodContent(FX_INT32 nIndex)
+CFX_WideString CXFA_DigestMethods::GetDigestMethodContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4081,11 +4081,11 @@ XFA_ATTRIBUTEENUM CXFA_Encodings::GetEncodingsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_Encodings::CountEncodings()
+int32_t CXFA_Encodings::CountEncodings()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Encoding) : 0;
}
-CFX_WideString CXFA_Encodings::GetEncodingContent(FX_INT32 nIndex)
+CFX_WideString CXFA_Encodings::GetEncodingContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4102,11 +4102,11 @@ XFA_ATTRIBUTEENUM CXFA_EncryptionMethods::GetEncryptionMethodsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_EncryptionMethods::CountEncryptionMethods()
+int32_t CXFA_EncryptionMethods::CountEncryptionMethods()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_EncryptionMethod) : 0;
}
-CFX_WideString CXFA_EncryptionMethods::GetEncryptionMethodContent(FX_INT32 nIndex)
+CFX_WideString CXFA_EncryptionMethods::GetEncryptionMethodContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4123,11 +4123,11 @@ XFA_ATTRIBUTEENUM CXFA_Reasons::GetReasonsType() {
return XFA_GetEnumTypeAttribute(m_pNode);
}
-FX_INT32 CXFA_Reasons::CountReasons()
+int32_t CXFA_Reasons::CountReasons()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Reason) : 0;
}
-CFX_WideString CXFA_Reasons::GetReasonContent(FX_INT32 nIndex)
+CFX_WideString CXFA_Reasons::GetReasonContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
@@ -4144,11 +4144,11 @@ XFA_ATTRIBUTEENUM CXFA_Manifest::GetAction() {
return XFA_GetEnumTypeAttribute(m_pNode, XFA_ATTRIBUTE_Action, XFA_ATTRIBUTEENUM_Include);
}
-FX_INT32 CXFA_Manifest::CountReives()
+int32_t CXFA_Manifest::CountReives()
{
return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Ref) : 0;
}
-CFX_WideString CXFA_Manifest::GetRefContent(FX_INT32 nIndex)
+CFX_WideString CXFA_Manifest::GetRefContent(int32_t nIndex)
{
if (nIndex <= -1 || !m_pNode) {
return FX_WSTRC(L"");
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp index a8e9772669..71ceebf764 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp @@ -60,7 +60,7 @@ static IFDE_XMLNode* XFA_FDEExtension_GetDocumentNode(IFDE_XMLDoc *pXMLDoc, FX_B }
return NULL;
}
-FX_INT32 CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID)
+int32_t CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID)
{
CloseParser();
m_pFileRead = pStream;
@@ -86,12 +86,12 @@ FX_INT32 CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePac m_ePacketID = ePacketID;
return XFA_PARSESTATUS_Ready;
}
-FX_INT32 CXFA_SimpleParser::DoParse(IFX_Pause *pPause)
+int32_t CXFA_SimpleParser::DoParse(IFX_Pause *pPause)
{
if (m_pXMLDoc == NULL || m_ePacketID == XFA_XDPPACKET_UNKNOWN) {
return XFA_PARSESTATUS_StatusErr;
}
- FX_INT32 iRet = m_pXMLDoc->DoLoad(pPause);
+ int32_t iRet = m_pXMLDoc->DoLoad(pPause);
if (iRet < 0) {
return XFA_PARSESTATUS_SyntaxErr;
}
@@ -109,7 +109,7 @@ FX_INT32 CXFA_SimpleParser::DoParse(IFX_Pause *pPause) }
return XFA_PARSESTATUS_Done;
}
-FX_INT32 CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause)
+int32_t CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause)
{
CloseParser();
pXMLNode = NULL;
@@ -132,7 +132,7 @@ FX_INT32 CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNo if (!m_pXMLDoc->LoadXML(pParser)) {
return XFA_PARSESTATUS_StatusErr;
}
- FX_INT32 iRet = m_pXMLDoc->DoLoad(pPause);
+ int32_t iRet = m_pXMLDoc->DoLoad(pPause);
if (iRet < 0 || iRet >= 100) {
m_pXMLDoc->CloseXML();
}
@@ -285,7 +285,7 @@ static FX_BOOL XFA_FDEExtension_FindAttributeWithNS(IFDE_XMLElement *pElement, F CFX_WideString wsAttrName;
CFX_WideString wsAttrValue;
CFX_WideString wsAttrNS;
- for(FX_INT32 iAttrCount = pElement->CountAttributes(), i = 0; i < iAttrCount; i ++) {
+ for(int32_t iAttrCount = pElement->CountAttributes(), i = 0; i < iAttrCount; i ++) {
pElement->GetAttribute(i, wsAttrName, wsAttrValue);
FX_STRSIZE iFind = wsAttrName.Find(L':', 0);
CFX_WideString wsNSPrefix;
@@ -354,8 +354,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(IFDE_XMLNode* pXMLDocumentNod pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"xfa"));
{
IFDE_XMLElement* pElement = (IFDE_XMLElement*)pXMLDocumentNode;
- FX_INT32 iAttributeCount = pElement->CountAttributes();
- for(FX_INT32 i = 0; i < iAttributeCount; i++) {
+ int32_t iAttributeCount = pElement->CountAttributes();
+ for(int32_t i = 0; i < iAttributeCount; i++) {
CFX_WideString wsAttriName, wsAttriValue;
pElement->GetAttribute(i, wsAttriName, wsAttriValue);
if(wsAttriName == FX_WSTRC(L"uuid")) {
@@ -706,7 +706,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, IFDE_XMLNode* pX pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName);
}
FX_BOOL IsNeedValue = TRUE;
- for(FX_INT32 i = 0, count = pXMLElement->CountAttributes(); i < count; i++) {
+ for(int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) {
CFX_WideString wsAttrQualifiedName;
CFX_WideString wsAttrName;
CFX_WideString wsAttrValue;
@@ -968,7 +968,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNo pXFAChild->SetCData(XFA_ATTRIBUTE_Name, wsNodeName);
FX_BOOL bNeedValue = TRUE;
if (1) {
- for(FX_INT32 i = 0, count = pXMLElement->CountAttributes(); i < count; i++) {
+ for(int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) {
CFX_WideString wsAttrQualifiedName;
CFX_WideString wsAttrValue;
CFX_WideString wsAttrName;
@@ -1158,7 +1158,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node *pXFANode, IFDE_XMLInstructio }
CFX_WideString wsTargetName;
pXMLInstruction->GetTargetName(wsTargetName);
- FX_INT32 iDataCount = pXMLInstruction->CountData();
+ int32_t iDataCount = pXMLInstruction->CountData();
if (wsTargetName == FX_WSTRC(L"originalXFAVersion")) {
CFX_WideString wsData;
if(pXMLInstruction->GetData(0, wsData) && (pXFANode->GetDocument()->RecognizeXFAVersionNumber(wsData) != XFA_VERSION_UNKNOWN)) {
@@ -1201,29 +1201,29 @@ CXFA_DocumentParser::~CXFA_DocumentParser() {
CloseParser();
}
-FX_INT32 CXFA_DocumentParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID )
+int32_t CXFA_DocumentParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID )
{
CloseParser();
- FX_INT32 nRetStatus = m_nodeParser.StartParse(pStream, ePacketID);
+ int32_t nRetStatus = m_nodeParser.StartParse(pStream, ePacketID);
if(nRetStatus == XFA_PARSESTATUS_Ready) {
m_pDocument = FX_NEW CXFA_Document(this);
m_nodeParser.SetFactory(m_pDocument);
}
return nRetStatus;
}
-FX_INT32 CXFA_DocumentParser::DoParse(IFX_Pause *pPause )
+int32_t CXFA_DocumentParser::DoParse(IFX_Pause *pPause )
{
- FX_INT32 nRetStatus = m_nodeParser.DoParse(pPause);
+ int32_t nRetStatus = m_nodeParser.DoParse(pPause);
if (nRetStatus >= XFA_PARSESTATUS_Done) {
FXSYS_assert(m_pDocument);
m_pDocument->SetRoot(m_nodeParser.GetRootNode());
}
return nRetStatus;
}
-FX_INT32 CXFA_DocumentParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause)
+int32_t CXFA_DocumentParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause)
{
CloseParser();
- FX_INT32 nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, NULL);
+ int32_t nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, NULL);
if(nRetStatus == XFA_PARSESTATUS_Done && pXMLNode) {
m_pDocument = FX_NEW CXFA_Document(this);
m_nodeParser.SetFactory(m_pDocument);
@@ -1279,7 +1279,7 @@ CXFA_XMLParser::~CXFA_XMLParser() m_ws1.Empty();
m_ws2.Empty();
}
-FX_INT32 CXFA_XMLParser::DoParser(IFX_Pause *pPause)
+int32_t CXFA_XMLParser::DoParser(IFX_Pause *pPause)
{
if (m_dwStatus == FDE_XMLSYNTAXSTATUS_Error) {
return -1;
@@ -1287,7 +1287,7 @@ FX_INT32 CXFA_XMLParser::DoParser(IFX_Pause *pPause) if (m_dwStatus == FDE_XMLSYNTAXSTATUS_EOS) {
return 100;
}
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (TRUE) {
m_dwStatus = m_pParser->DoSyntaxParse();
switch (m_dwStatus) {
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.h b/xfa/src/fxfa/src/parser/xfa_parser_imp.h index 626141a02c..cdfbe70917 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.h @@ -18,9 +18,9 @@ public: delete this;
}
- virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP);
- virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL);
- virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL);
+ virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP);
+ virtual int32_t DoParse(IFX_Pause *pPause = NULL);
+ virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL);
virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode);
virtual IXFA_ObjFactory* GetFactory() const
{
@@ -72,9 +72,9 @@ public: {
delete this;
}
- virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP);
- virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL);
- virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL);
+ virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP);
+ virtual int32_t DoParse(IFX_Pause *pPause = NULL);
+ virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL);
virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode);
virtual IXFA_ObjFactory* GetFactory() const
{
@@ -113,7 +113,7 @@ public: {
delete this;
}
- virtual FX_INT32 DoParser(IFX_Pause *pPause);
+ virtual int32_t DoParser(IFX_Pause *pPause);
protected:
IFDE_XMLNode *m_pRoot;
IFX_Stream *m_pStream;
diff --git a/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp index fb83349961..6e06a0fd8f 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp @@ -35,7 +35,7 @@ void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue, CFX_WideString& FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue));
}
}
-void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, FX_INT32& iValue, FX_BOOL bSetting)
+void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, int32_t& iValue, FX_BOOL bSetting)
{
if (bSetting) {
iValue = FXJSE_Value_ToInteger(hValue);
diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp index f4254f0bbc..5a1eff1a4a 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp @@ -84,7 +84,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage(FXJSE_HVALUE hV pNotify->GetDocProvider()->SetCurrentPage(hDoc, FXJSE_Value_ToInteger(hValue));
return;
}
- FX_INT32 iCurrentPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
+ int32_t iCurrentPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
FXJSE_Value_SetInteger(hValue, iCurrentPage);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Language(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute)
@@ -112,7 +112,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages(FXJSE_HVALUE hValu ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_NUMPAGES);
return;
}
- FX_INT32 iNumPages = pNotify->GetDocProvider()->CountPages(hDoc);
+ int32_t iNumPages = pNotify->GetDocProvider()->CountPages(hDoc);
FXJSE_Value_SetInteger(hValue, iNumPages);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Platform(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute)
@@ -241,7 +241,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(CFXJSE_Arguments* p if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"gotoURL");
return;
@@ -263,7 +263,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"openList");
return;
@@ -293,7 +293,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* }
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
FXJSE_Value_Release(hValue);
return;
@@ -315,7 +315,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* }
void CScript_HostPseudoModel::Script_HostPseudoModel_Response(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"response");
return;
@@ -356,21 +356,21 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch(CFXJSE_Argu if (!pNotify) {
return;
}
- FX_INT32 iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch();
+ int32_t iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch();
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iCur);
}
}
-static FX_INT32 XFA_FilterName(FX_WSTR wsExpression, FX_INT32 nStart, CFX_WideString &wsFilter)
+static int32_t XFA_FilterName(FX_WSTR wsExpression, int32_t nStart, CFX_WideString &wsFilter)
{
FXSYS_assert(nStart > -1);
- FX_INT32 iLength = wsExpression.GetLength();
+ int32_t iLength = wsExpression.GetLength();
if (nStart >= iLength) {
return iLength;
}
FX_LPWSTR pBuf = wsFilter.GetBuffer(iLength - nStart);
- FX_INT32 nCount = 0;
+ int32_t nCount = 0;
FX_LPCWSTR pSrc = wsExpression.GetPtr();
FX_WCHAR wCur;
while (nStart < iLength) {
@@ -387,7 +387,7 @@ static FX_INT32 XFA_FilterName(FX_WSTR wsExpression, FX_INT32 nStart, CFX_WideSt }
void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 0 || iLength > 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resetData");
return;
@@ -405,10 +405,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* pNotify->ResetData();
return;
}
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
CFX_WideString wsName;
CXFA_Node* pNode = NULL;
- FX_INT32 iExpLength = wsExpression.GetLength();
+ int32_t iExpLength = wsExpression.GetLength();
while (iStart < iExpLength) {
iStart = XFA_FilterName(wsExpression, iStart, wsName);
IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
@@ -421,7 +421,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* }
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsName, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(pObject, wsName, resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
continue;
}
@@ -437,7 +437,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Beep(CFXJSE_Arguments* pArg if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 0 || iLength > 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"beep");
return;
@@ -457,7 +457,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(CFXJSE_Arguments* if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setFocus");
return;
@@ -488,7 +488,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(CFXJSE_Arguments* }
FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
FXJSE_Value_Release(hValue);
return;
@@ -516,7 +516,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(CFXJSE_Arguments if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"messageBox");
return;
@@ -551,13 +551,13 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(CFXJSE_Arguments dwButtonType = XFA_MB_OK;
}
}
- FX_INT32 iValue = pNotify->GetAppProvider()->MsgBox(wsMessage, bsTitle, dwMessageType, dwButtonType);
+ int32_t iValue = pNotify->GetAppProvider()->MsgBox(wsMessage, bsTitle, dwMessageType, dwButtonType);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iValue);
}
}
-FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, FX_INT32 iArgIndex, CFX_WideString& wsValue)
+FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue)
{
if(pArguments == NULL || iArgIndex < 0) {
return FALSE;
@@ -588,7 +588,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentCountInBatch(CFXJSE if (!pNotify) {
return;
}
- FX_INT32 iValue = pNotify->GetAppProvider()->GetDocumentCountInBatch();
+ int32_t iValue = pNotify->GetAppProvider()->GetDocumentCountInBatch();
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iValue);
@@ -599,7 +599,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 8) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"print");
return;
@@ -617,11 +617,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr if(bShowDialog) {
dwOptions |= XFA_PRINTOPT_ShowDialog;
}
- FX_INT32 nStartPage = 0;
+ int32_t nStartPage = 0;
if (iLength >= 2) {
nStartPage = pArguments->GetInt32(1);
}
- FX_INT32 nEndPage = 0;
+ int32_t nEndPage = 0;
if (iLength >= 3) {
nEndPage = pArguments->GetInt32(2);
}
@@ -665,7 +665,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr }
void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 0 || iLength > 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"importData");
return;
@@ -684,7 +684,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(CFXJSE_Arguments }
void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 0 || iLength > 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"exportData");
return;
@@ -712,8 +712,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp(CFXJSE_Arguments* pA return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
- FX_INT32 nNewPage = 0;
+ int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
+ int32_t nNewPage = 0;
if (nCurPage <= 1) {
return;
}
@@ -727,12 +727,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageDown(CFXJSE_Arguments* return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
- FX_INT32 nPageCount = pNotify->GetDocProvider()->CountPages(hDoc);
+ int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
+ int32_t nPageCount = pNotify->GetDocProvider()->CountPages(hDoc);
if (!nPageCount || nCurPage == nPageCount) {
return;
}
- FX_INT32 nNewPage = 0;
+ int32_t nNewPage = 0;
if (nCurPage >= nPageCount) {
nNewPage = nPageCount - 1;
} else {
diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h index 118680e792..ef9d81d3ce 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h +++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h @@ -45,6 +45,6 @@ public: void Script_HostPseudoModel_CurrentDateTime(CFXJSE_Arguments* pArguments);
protected:
void Script_HostPseudoModel_LoadString(FXJSE_HVALUE hValue, IXFA_Notify* pNotify, FX_DWORD dwFlag);
- FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, FX_INT32 iArgIndex, CFX_WideString& wsValue);
+ FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue);
};
#endif
diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index cd196f585d..be10dff62a 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -53,7 +53,7 @@ CXFA_ScriptContext::~CXFA_ScriptContext() m_pResolveProcessor = NULL;
}
m_upObjectArray.RemoveAll();
- for (FX_INT32 i = 0; i < m_CacheListArray.GetSize(); i++) {
+ for (int32_t i = 0; i < m_CacheListArray.GetSize(); i++) {
delete ((CXFA_NodeList*)m_CacheListArray[i]);
}
m_CacheListArray.RemoveAll();
@@ -93,7 +93,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR ws }
CFX_WideTextBuf wsJavaScript;
CFX_WideString wsErrorInfo;
- FX_INT32 iFlags = XFA_FM2JS_Translate(wsScript, wsJavaScript, wsErrorInfo);
+ int32_t iFlags = XFA_FM2JS_Translate(wsScript, wsJavaScript, wsErrorInfo);
if(iFlags) {
FXJSE_Value_SetUndefined(hRetValue);
return FALSE;
@@ -162,7 +162,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szP FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, FX_WSTR propname, FXJSE_HVALUE hValue, FX_DWORD dwFlag, FX_BOOL bSetting)
{
XFA_RESOLVENODE_RS resolveRs;
- FX_INT32 iRet = ResolveObjects(refNode, propname, resolveRs, dwFlag);
+ int32_t iRet = ResolveObjects(refNode, propname, resolveRs, dwFlag);
FX_BOOL bResult = FALSE;
if (iRet > 0) {
bResult = TRUE;
@@ -190,7 +190,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, FX_BSTR szP XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue);
return;
}
- FX_UINT32 uHashCode = FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength());
+ uint32_t uHashCode = FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength());
if(uHashCode != XFA_HASHCODE_Layout) {
CXFA_Object * pObject = lpScriptContext->GetDocument()->GetXFANode(uHashCode);
if (pObject) {
@@ -299,7 +299,7 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szP }
}
}
-FX_INT32 CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn)
+int32_t CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn)
{
CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
if(pObject == NULL) {
@@ -317,7 +317,7 @@ FX_INT32 CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR }
return FXJSE_ClassPropType_Property;
}
-FX_INT32 CXFA_ScriptContext::GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn)
+int32_t CXFA_ScriptContext::GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn)
{
CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
if(pObject == NULL) {
@@ -524,7 +524,7 @@ void CXFA_ScriptContext::AddJSBuiltinObject(XFA_LPCJSBUILTININFO pBuitinObject) }
m_JSBuiltInObjects.SetAt(pBuitinObject->pName, (void*)pBuitinObject);
}
-FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles, CXFA_Node* bindNode)
+int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles, CXFA_Node* bindNode)
{
if (wsExpression.IsEmpty()) {
return 0;
@@ -542,9 +542,9 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr m_pResolveProcessor->GetNodeHelper()->m_pCreateParent = NULL;
m_pResolveProcessor->GetNodeHelper()->m_iCurAllStart = -1;
CXFA_ResolveNodesData rndFind;
- FX_INT32 nStart = 0;
- FX_INT32 nLevel = 0;
- FX_INT32 nRet = -1;
+ int32_t nStart = 0;
+ int32_t nLevel = 0;
+ int32_t nRet = -1;
rndFind.m_pSC = this;
CXFA_ObjArray findNodes;
if (refNode != NULL) {
@@ -552,10 +552,10 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr } else {
findNodes.Add(m_pDocument->GetRoot());
}
- FX_INT32 nNodes = 0;
+ int32_t nNodes = 0;
while (TRUE) {
nNodes = findNodes.GetSize();
- FX_INT32 i = 0;
+ int32_t i = 0;
rndFind.m_dwStyles = dwStyles;
m_pResolveProcessor->m_iCurStart = nStart;
nStart = m_pResolveProcessor->XFA_ResolveNodes_GetFilter(wsExpression, nStart, rndFind);
@@ -614,7 +614,7 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr rndFind.m_Nodes.SetAt(0, (CXFA_Object*)FXJSE_Value_ToObject(hValue, NULL));
FXJSE_Value_Release(hValue);
}
- FX_INT32 iSize = m_upObjectArray.GetSize();
+ int32_t iSize = m_upObjectArray.GetSize();
if (iSize) {
m_upObjectArray.RemoveAt(iSize - 1);
}
@@ -686,12 +686,12 @@ FXJSE_HVALUE CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) }
return (FXJSE_HVALUE)pValue;
}
-FX_INT32 CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode)
+int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode)
{
CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper();
return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, lpNodeHelper->XFA_NodeIsProperty(refNode), FALSE);
}
-FX_INT32 CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode)
+int32_t CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode)
{
CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper();
return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, lpNodeHelper->XFA_NodeIsProperty(refNode), TRUE);
@@ -731,10 +731,10 @@ static const XFA_JSBUILTININFO gs_JSBUILTINData[] = { {0x8108b9a9, "Number"},
{0xe07e3fbe, "Date"},
};
-const FX_INT32 g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO);
-XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode)
+const int32_t g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO);
+XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(uint32_t uHashCode)
{
- FX_INT32 iStart = 0, iEnd = g_iJSBuiltinCount - 1, iMid;
+ int32_t iStart = 0, iEnd = g_iJSBuiltinCount - 1, iMid;
do {
iMid = (iStart + iEnd) / 2;
XFA_LPCJSBUILTININFO pInfo = gs_JSBUILTINData + iMid;
diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.h b/xfa/src/fxfa/src/parser/xfa_script_imp.h index 9ffb8bcda0..fc43583e8d 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.h @@ -27,7 +27,7 @@ public: }
virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, CXFA_Object* pThisObject = NULL);
- virtual FX_INT32 ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL);
+ virtual int32_t ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL);
virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject);
virtual void CacheList(CXFA_NodeList* pList)
{
@@ -42,8 +42,8 @@ public: return m_hJsRuntime;
}
- virtual FX_INT32 GetIndexByName(CXFA_Node* refNode);
- virtual FX_INT32 GetIndexByClassName(CXFA_Node* refNode);
+ virtual int32_t GetIndexByName(CXFA_Node* refNode);
+ virtual int32_t GetIndexByClassName(CXFA_Node* refNode);
virtual void GetSomExpression(CXFA_Node* refNode, CFX_WideString &wsExpression);
virtual void SetNodesOfRunScript(CXFA_NodeArray *pArray);
@@ -68,8 +68,8 @@ public: static void NormalPropertyGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue);
static void NormalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue);
static void NormalMethodCall(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args);
- static FX_INT32 NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
- static FX_INT32 GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
+ static int32_t NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
+ static int32_t GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn);
FX_BOOL RunVariablesScript(CXFA_Node* pScriptNode);
CXFA_Object* GetVariablesThis(CXFA_Object* pObject, FX_BOOL bScriptNode = FALSE);
void ReleaseVariablesMap();
diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp index 25efee719d..e28b0b7658 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp @@ -38,12 +38,12 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready(FXJSE_HVALUE hVal ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_READY);
return;
}
- FX_INT32 iStatus = pNotify->GetLayoutStatus();
+ int32_t iStatus = pNotify->GetLayoutStatus();
FXJSE_Value_SetBoolean(hValue, iStatus >= 2);
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if ( iLength < 1 || iLength > 3) {
FX_LPCWSTR methodName = NULL;
switch (layoutModel) {
@@ -65,7 +65,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(CFXJSE_Arguments* }
CXFA_Node* pNode = NULL;
CFX_WideString wsUnit = FX_WSTRC(L"pt");
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
if (iLength >= 1) {
pNode = (CXFA_Node*)pArguments->GetObject(0);
}
@@ -144,10 +144,10 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_NumberedPageCount(CFXJS if (!pDocLayout) {
return;
}
- FX_INT32 iPageCount = 0;
- FX_INT32 iPageNum = pDocLayout->CountPages();
+ int32_t iPageCount = 0;
+ int32_t iPageNum = pDocLayout->CountPages();
if (bNumbered) {
- for (FX_INT32 i = 0; i < iPageNum; i++) {
+ for (int32_t i = 0; i < iPageNum; i++) {
IXFA_LayoutPage* pLayoutPage = pDocLayout->GetPage(i);
if (!pLayoutPage) {
continue;
@@ -171,7 +171,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageCount(CFXJSE_Argume }
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan");
return;
@@ -193,9 +193,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan(CFXJSE_Argumen FXJSE_Value_SetInteger(hValue, -1);
return;
}
- FX_INT32 iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex();
- FX_INT32 iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
- FX_INT32 iPageSpan = iLast - iFirst + 1;
+ int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex();
+ int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
+ int32_t iPageSpan = iLast - iFirst + 1;
if (hValue) {
FXJSE_Value_SetInteger(hValue, iPageSpan);
}
@@ -204,7 +204,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page(CFXJSE_Arguments* {
Script_LayoutPseudoModel_PageImp(pArguments, FALSE);
}
-void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, FX_INT32 iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray)
+void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, int32_t iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray)
{
CXFA_ContainerLayoutItemImpl* pLayoutPage = (CXFA_ContainerLayoutItemImpl*)pDocLayout->GetPage(iPageNo);
if (!pLayoutPage) {
@@ -327,12 +327,12 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLay }
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageContent(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 3) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageContent");
return;
}
- FX_INT32 iIndex = 0;
+ int32_t iIndex = 0;
CFX_WideString wsType;
FX_BOOL bOnPageArea = FALSE;
if (iLength >= 1) {
@@ -370,7 +370,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch(CFX return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc);
+ int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iPageCount);
@@ -383,7 +383,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch(CFXJS return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc);
+ int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iPageCount);
@@ -407,7 +407,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageSpan(CFXJSE_Argu }
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"absPageInBatch");
return;
@@ -432,7 +432,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget);
+ int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iPageCount);
@@ -440,7 +440,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A }
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch");
return;
@@ -465,7 +465,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arg return;
}
IXFA_Doc* hDoc = pNotify->GetHDOC();
- FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget);
+ int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iPageCount);
@@ -488,7 +488,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPage(CFXJSE_Argument }
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
FX_LPCWSTR methodName;
if (bAbsPage) {
@@ -503,7 +503,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(CFXJSE_Argument if (iLength >= 1) {
pNode = (CXFA_Node*)pArguments->GetObject(0);
}
- FX_INT32 iPage = 0;
+ int32_t iPage = 0;
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (!pNode && hValue) {
FXJSE_Value_SetInteger(hValue, iPage);
diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h index c94742aa3f..d5ee57f77f 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h +++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h @@ -42,7 +42,7 @@ public: void Script_LayoutPseudoModel_SheetCount(CFXJSE_Arguments* pArguments);
void Script_LayoutPseudoModel_AbsPage(CFXJSE_Arguments* pArguments);
protected:
- void Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, FX_INT32 iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray);
+ void Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, int32_t iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray);
void Script_LayoutPseudoModel_PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage);
};
#endif
diff --git a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp index fc757e689d..0c793b2692 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp @@ -33,14 +33,14 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetOneChild(CXFA_Node* parent, FX_ return NULL;
}
CXFA_NodeArray siblings;
- FX_UINT32 uNameHash = FX_HashCode_String_GetW(pwsName, FXSYS_wcslen(pwsName));
+ uint32_t uNameHash = FX_HashCode_String_GetW(pwsName, FXSYS_wcslen(pwsName));
XFA_NodeAcc_TraverseAnySiblings(parent, uNameHash, &siblings, bIsClassName);
if (siblings.GetSize() == 0) {
return NULL;
}
return siblings[0];
}
-FX_INT32 CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName)
+int32_t CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName)
{
CXFA_Node* parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent);
if(parent == NULL) {
@@ -59,16 +59,16 @@ FX_INT32 CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eL return XFA_NodeAcc_TraverseSiblings(parent, pNode->GetNameHash(), pSiblings, eLogicType, bIsClassName);
}
}
-FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName )
+int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName )
{
if(parent == NULL || pSiblings == NULL) {
return 0;
}
- FX_INT32 nCount = 0;
- FX_INT32 i = 0;
+ int32_t nCount = 0;
+ int32_t i = 0;
CXFA_NodeArray properties;
parent->GetNodeList(properties, XFA_NODEFILTER_Properties);
- FX_INT32 nProperties = properties.GetSize();
+ int32_t nProperties = properties.GetSize();
for (i = 0; i < nProperties; ++i) {
CXFA_Node* child = properties[i];
if(bIsClassName) {
@@ -89,7 +89,7 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_ }
CXFA_NodeArray children;
parent->GetNodeList(children, XFA_NODEFILTER_Children);
- FX_INT32 nChildren = children.GetSize();
+ int32_t nChildren = children.GetSize();
for (i = 0; i < nChildren; i ++) {
CXFA_Node* child = children[i];
if(bIsClassName) {
@@ -114,17 +114,17 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_ }
return nCount;
}
-FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName, FX_BOOL bIsFindProperty)
+int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName, FX_BOOL bIsFindProperty)
{
if (parent == NULL || pSiblings == NULL) {
return 0;
}
- FX_INT32 nCount = 0;
- FX_INT32 i = 0;
+ int32_t nCount = 0;
+ int32_t i = 0;
if(bIsFindProperty) {
CXFA_NodeArray properties;
parent->GetNodeList(properties, XFA_NODEFILTER_Properties);
- FX_INT32 nProperties = properties.GetSize();
+ int32_t nProperties = properties.GetSize();
for (i = 0; i < nProperties; ++i) {
CXFA_Node* child = properties[i];
if(bIsClassName) {
@@ -151,7 +151,7 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DW }
CXFA_NodeArray children;
parent->GetNodeList(children, XFA_NODEFILTER_Children);
- FX_INT32 nChildren = children.GetSize();
+ int32_t nChildren = children.GetSize();
for (i = 0; i < nChildren; i ++) {
CXFA_Node* child = children[i];
if(child->GetClassID() == XFA_ELEMENT_Variables) {
@@ -204,7 +204,7 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetParent(CXFA_Node* pNode, XFA_LO }
return parent;
}
-FX_INT32 CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsProperty , FX_BOOL bIsClassIndex )
+int32_t CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsProperty , FX_BOOL bIsClassIndex )
{
CXFA_Node* parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent);
if(parent == NULL) {
@@ -221,8 +221,8 @@ FX_INT32 CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicT dwHashName = pNode->GetClassHashCode();
}
CXFA_NodeArray siblings;
- FX_INT32 iSize = XFA_NodeAcc_TraverseSiblings(parent, dwHashName, &siblings, eLogicType, bIsClassIndex);
- for (FX_INT32 i = 0; i < iSize; ++i) {
+ int32_t iSize = XFA_NodeAcc_TraverseSiblings(parent, dwHashName, &siblings, eLogicType, bIsClassIndex);
+ for (int32_t i = 0; i < iSize; ++i) {
CXFA_Node* child = siblings[i];
if (child == pNode) {
return i;
@@ -274,7 +274,7 @@ FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) }
FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsCondition)
{
- FX_INT32 iLen = wsCondition.GetLength();
+ int32_t iLen = wsCondition.GetLength();
CFX_WideString wsIndex = FX_WSTRC(L"0");;
FX_BOOL bAll = FALSE;
if(iLen == 0) {
@@ -282,7 +282,7 @@ FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsConditio return FALSE;
}
if(wsCondition.GetAt(0) == '[') {
- FX_INT32 i = 1;
+ int32_t i = 1;
for (; i < iLen; ++i) {
FX_WCHAR ch = wsCondition[i];
if (ch == ' ') {
@@ -304,7 +304,7 @@ FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsConditio m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne;
wsIndex = wsCondition.Mid(i, iLen - 1 - i);
}
- FX_INT32 iIndex = wsIndex.GetInteger();
+ int32_t iIndex = wsIndex.GetInteger();
m_iCreateCount = iIndex;
return TRUE;
}
@@ -333,7 +333,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_ if(lpElement == NULL) {
return FALSE;
}
- for(FX_INT32 iIndex = 0; iIndex < m_iCreateCount; iIndex ++) {
+ for(int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex ++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(lpElement->eName);
if(pNewNode) {
m_pCreateParent->InsertChild(pNewNode);
@@ -348,7 +348,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_ if(bLastNode) {
eClassType = m_eLastCreateType;
}
- for(FX_INT32 iIndex = 0; iIndex < m_iCreateCount; iIndex ++) {
+ for(int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex ++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eClassType);
if(pNewNode) {
pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, wsName);
diff --git a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h index 2c3faea324..ea3e180385 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h +++ b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h @@ -19,10 +19,10 @@ public: CXFA_Node* XFA_ResolveNodes_GetOneChild(CXFA_Node* parent, FX_LPCWSTR pwsName, FX_BOOL bIsClassName = FALSE);
CXFA_Node* XFA_ResolveNodes_GetParent(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent);
- FX_INT32 XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName = FALSE, FX_BOOL bIsFindProperty = TRUE);
- FX_INT32 XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName = FALSE);
- FX_INT32 XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName = FALSE);
- FX_INT32 XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent, FX_BOOL bIsProperty = FALSE, FX_BOOL bIsClassIndex = FALSE);
+ int32_t XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName = FALSE, FX_BOOL bIsFindProperty = TRUE);
+ int32_t XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName = FALSE);
+ int32_t XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName = FALSE);
+ int32_t XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent, FX_BOOL bIsProperty = FALSE, FX_BOOL bIsClassIndex = FALSE);
void XFA_GetNameExpression(CXFA_Node* refNode, CFX_WideString &wsName, FX_BOOL bIsAllPath, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent);
FX_BOOL XFA_NodeIsTransparent(CXFA_Node* refNode);
FX_BOOL XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_WideString wsCondition, FX_BOOL bLastNode, CXFA_ScriptContext* pScriptContext);
@@ -32,9 +32,9 @@ public: public:
XFA_ELEMENT m_eLastCreateType;
CXFA_Node* m_pCreateParent;
- FX_INT32 m_iCreateCount;
+ int32_t m_iCreateCount;
XFA_RESOVENODE_RSTYPE m_iCreateFlag;
- FX_INT32 m_iCurAllStart;
+ int32_t m_iCurAllStart;
CXFA_Node* m_pAllStartParent;
};
diff --git a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp index c133f6b6f1..a79a8bf9ca 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp @@ -31,7 +31,7 @@ CXFA_ResolveProcessor::~CXFA_ResolveProcessor(void) m_pNodeHelper = NULL;
}
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd)
{
if (rnd.m_CurNode == NULL) {
return -1;
@@ -77,13 +77,13 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd) }
return rnd.m_Nodes.GetSize();
}
- FX_INT32 nRet = XFA_ResolveNodes_Normal(rnd);
+ int32_t nRet = XFA_ResolveNodes_Normal(rnd);
if (nRet < 1 && rnd.m_uHashName == XFA_HASHCODE_Xfa) {
rnd.m_Nodes.Add(rnd.m_pSC->GetDocument()->GetRoot());
}
return rnd.m_Nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd)
{
CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1);
CFX_WideString wsCondition = rnd.m_wsCondition;
@@ -106,12 +106,12 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData XFA_ResolveNode_FilterCondition(rnd, wsCondition);
return rnd.m_Nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd)
{
CXFA_ObjArray &nodes = rnd.m_Nodes;
CFX_WideString wsName = rnd.m_wsName;
CFX_WideString wsCondition = rnd.m_wsCondition;
- FX_INT32 iNameLen = wsName.GetLength();
+ int32_t iNameLen = wsName.GetLength();
if (iNameLen == 1) {
nodes.Add(rnd.m_CurNode);
return 1;
@@ -133,7 +133,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &r }
return rnd.m_Nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd)
{
if (rnd.m_nLevel > 0) {
return 0;
@@ -157,7 +157,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesDa }
return rnd.m_Nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd)
{
FX_DWORD dwStyles = rnd.m_dwStyles;
CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1);
@@ -187,7 +187,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesDat }
return rnd.m_Nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr)
{
XFA_LPCSCRIPTATTRIBUTEINFO lpScriptAttribute = XFA_GetScriptAttributeByName(curNode->GetClassID(), strAttr);
if(lpScriptAttribute) {
@@ -198,7 +198,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* cur }
return 0;
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd)
{
if (rnd.m_nLevel > 32) {
return 0;
@@ -208,10 +208,10 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r }
CXFA_Node* curNode = (CXFA_Node*)rnd.m_CurNode;
CXFA_ObjArray &nodes = rnd.m_Nodes;
- FX_INT32 nNum = nodes.GetSize();
+ int32_t nNum = nodes.GetSize();
FX_DWORD dwStyles = rnd.m_dwStyles;
CFX_WideString &wsName = rnd.m_wsName;
- FX_UINT32 uNameHash = rnd.m_uHashName;
+ uint32_t uNameHash = rnd.m_uHashName;
CFX_WideString &wsCondition = rnd.m_wsCondition;
CXFA_ResolveNodesData rndFind;
rndFind.m_wsName = rnd.m_wsName;
@@ -244,7 +244,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling);
}
if((dwStyles & XFA_RESOLVENODE_Properties) && pVariablesNode) {
- FX_UINT32 uPropHash = pVariablesNode->GetClassHashCode();
+ uint32_t uPropHash = pVariablesNode->GetClassHashCode();
if (uPropHash == uNameHash) {
nodes.Add(pVariablesNode);
} else {
@@ -272,7 +272,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r if(pPageSetNode && (dwStyles & XFA_RESOLVENODE_Properties)) {
children.Add(pPageSetNode);
}
- for(FX_INT32 i = 0; i < children.GetSize(); i++) {
+ for(int32_t i = 0; i < children.GetSize(); i++) {
CXFA_Node* child = children[i];
if (dwStyles & XFA_RESOLVENODE_TagName) {
if (child->GetClassHashCode() == uNameHash) {
@@ -324,10 +324,10 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r }
if (dwStyles & XFA_RESOLVENODE_Properties) {
FX_BOOL bSetFlag = FALSE;
- for(FX_INT32 i = 0; i < properties.GetSize(); i++) {
+ for(int32_t i = 0; i < properties.GetSize(); i++) {
CXFA_Node* childProperty = properties[i];
if(childProperty->IsUnnamed()) {
- FX_UINT32 uPropHash = childProperty->GetClassHashCode();
+ uint32_t uPropHash = childProperty->GetClassHashCode();
XFA_ELEMENT eName = childProperty->GetClassID();
if (uPropHash == uNameHash) {
nodes.Add(childProperty);
@@ -362,7 +362,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r }
}
CXFA_Node* parentNode = m_pNodeHelper->XFA_ResolveNodes_GetParent((CXFA_Node *)curNode, XFA_LOGIC_NoTransparent);
- FX_UINT32 uCurClassHash = curNode->GetClassHashCode();
+ uint32_t uCurClassHash = curNode->GetClassHashCode();
if (parentNode == NULL) {
if(uCurClassHash == uNameHash) {
nodes.Add((CXFA_Node*)curNode);
@@ -477,7 +477,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r }
return 0;
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd)
{
CXFA_Node* curNode = (CXFA_Node*)rnd.m_CurNode;
CXFA_ObjArray &nodes = rnd.m_Nodes;
@@ -486,20 +486,20 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData nodes.Append((CXFA_ObjArray &)array);
return nodes.GetSize();
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_PopStack(CFX_Int32Array &stack)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_PopStack(CFX_Int32Array &stack)
{
- FX_INT32 nType = -1;
- FX_INT32 iSize = stack.GetSize() - 1;
+ int32_t nType = -1;
+ int32_t iSize = stack.GetSize() - 1;
if (iSize > -1) {
nType = stack[iSize];
stack.RemoveAt(iSize, 1);
}
return nType;
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, FX_INT32 nStart, CXFA_ResolveNodesData &rnd)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, int32_t nStart, CXFA_ResolveNodesData &rnd)
{
FXSYS_assert(nStart > -1);
- FX_INT32 iLength = wsExpression.GetLength();
+ int32_t iLength = wsExpression.GetLength();
if (nStart >= iLength) {
return 0;
}
@@ -507,11 +507,11 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, CFX_WideString& wsCondition = rnd.m_wsCondition;
FX_LPWSTR pNameBuf = wsName.GetBuffer(iLength - nStart);
FX_LPWSTR pConditionBuf = wsCondition.GetBuffer(iLength - nStart);
- FX_INT32 nCount = 0;
- FX_INT32 nNameCount = 0;
- FX_INT32 nConditionCount = 0;
+ int32_t nCount = 0;
+ int32_t nNameCount = 0;
+ int32_t nConditionCount = 0;
CFX_Int32Array stack;
- FX_INT32 nType = -1;
+ int32_t nType = -1;
FX_LPCWSTR pSrc = wsExpression.GetPtr();
FX_WCHAR wPrev = 0, wCur;
FX_BOOL bIsCondition = FALSE;
@@ -594,13 +594,13 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, rnd.m_uHashName = FX_HashCode_String_GetW(wsName, wsName.GetLength());
return nStart;
}
-void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd)
+void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd)
{
CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
- FX_INT32 iLen = wsCondition.GetLength();
+ int32_t iLen = wsCondition.GetLength();
FX_BOOL bRelative = FALSE;
FX_BOOL bAll = FALSE;
- FX_INT32 i = 1;
+ int32_t i = 1;
for (; i < iLen; ++i) {
FX_WCHAR ch = wsCondition[i];
if (ch == ' ') {
@@ -642,7 +642,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, C }
CFX_WideString wsIndex;
wsIndex = wsCondition.Mid(i, iLen - 1 - i);
- FX_INT32 iIndex = wsIndex.GetInteger();
+ int32_t iIndex = wsIndex.GetInteger();
if (bRelative) {
iIndex += iCurIndex;
}
@@ -658,7 +658,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, C findNodes.Add(ret);
}
}
-void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd)
+void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd)
{
CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
FXSYS_assert(iFoundCount == findNodes.GetSize());
@@ -674,7 +674,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex }
pContext = rnd.m_pSC;
wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3);
- for(FX_INT32 i = iFoundCount - 1; i >= 0; i--) {
+ for(int32_t i = iFoundCount - 1; i >= 0; i--) {
CXFA_Object* node = findNodes[i];
FX_BOOL bRet = FALSE;
FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime());
@@ -689,9 +689,9 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesData &rnd, CFX_WideString wsCondition)
{
CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
- FX_INT32 iCurrIndex = 0;
+ int32_t iCurrIndex = 0;
const CXFA_NodeArray &array = rnd.m_pSC->GetUpObjectArray();
- FX_INT32 iSize = array.GetSize();
+ int32_t iSize = array.GetSize();
if (iSize) {
CXFA_Node* curNode = array[iSize - 1];
FX_BOOL bIsProperty = m_pNodeHelper->XFA_NodeIsProperty(curNode);
@@ -701,10 +701,10 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesDat iCurrIndex = m_pNodeHelper->XFA_GetIndex(curNode, XFA_LOGIC_Transparent, bIsProperty, FALSE);
}
}
- FX_INT32 iFoundCount = findNodes.GetSize();
+ int32_t iFoundCount = findNodes.GetSize();
wsCondition.TrimLeft();
wsCondition.TrimRight();
- FX_INT32 iLen = wsCondition.GetLength();
+ int32_t iLen = wsCondition.GetLength();
if (!iLen) {
if (rnd.m_dwStyles & XFA_RESOLVENODE_ALL) {
return;
@@ -755,7 +755,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNodes_SetStylesForChild(FX_DWORD dwParent dwSubStyles |= XFA_RESOLVENODE_ALL;
rnd.m_dwStyles = dwSubStyles;
}
-FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition)
+int32_t CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition)
{
if(m_pNodeHelper->m_pCreateParent) {
resolveNodeRS.nodes.Add(m_pNodeHelper->m_pCreateParent);
@@ -770,7 +770,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVEN }
return resolveNodeRS.nodes.GetSize();
}
-void CXFA_ResolveProcessor::XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, FX_INT32 &iIndex, FX_INT32 iCount)
+void CXFA_ResolveProcessor::XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, int32_t &iIndex, int32_t iCount)
{
if(m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) {
if(m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) {
diff --git a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h index 3555b0a470..39153ecfcc 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h +++ b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h @@ -31,9 +31,9 @@ public: CXFA_ScriptContext* m_pSC;
CXFA_Object* m_CurNode;
CFX_WideString m_wsName;
- FX_UINT32 m_uHashName;
+ uint32_t m_uHashName;
CFX_WideString m_wsCondition;
- FX_INT32 m_nLevel;
+ int32_t m_nLevel;
CXFA_ObjArray m_Nodes;
FX_DWORD m_dwStyles;
XFA_LPCSCRIPTATTRIBUTEINFO m_pScriptAttribute;
@@ -44,22 +44,22 @@ class CXFA_ResolveProcessor public:
CXFA_ResolveProcessor(void);
~CXFA_ResolveProcessor(void);
- FX_INT32 XFA_ResolveNodes(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr);
- void XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd);
- void XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, FX_INT32 nStart, CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr);
+ void XFA_ResolveNode_ConditionArray(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd);
+ void XFA_ResolveNode_DoPredicateFilter(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd);
+ int32_t XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, int32_t nStart, CXFA_ResolveNodesData &rnd);
void XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesData &rnd, CFX_WideString wsCondition);
- FX_INT32 XFA_ResolveNodes_PopStack(CFX_Int32Array &stack);
+ int32_t XFA_ResolveNodes_PopStack(CFX_Int32Array &stack);
void XFA_ResolveNodes_SetStylesForChild(FX_DWORD dwParentStyles, CXFA_ResolveNodesData &rnd);
- FX_INT32 XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition);
- void XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, FX_INT32 &iIndex, FX_INT32 iCount);
+ int32_t XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition);
+ void XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, int32_t &iIndex, int32_t iCount);
CXFA_NodeHelper* GetNodeHelper()
{
return m_pNodeHelper;
@@ -67,6 +67,6 @@ public: private:
CXFA_NodeHelper* m_pNodeHelper;
public:
- FX_INT32 m_iCurStart;
+ int32_t m_iCurStart;
};
#endif
diff --git a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp index 6e94791f40..3173d14ed4 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp @@ -27,7 +27,7 @@ CScript_SignaturePseudoModel::~CScript_SignaturePseudoModel() }
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify");
return;
@@ -41,7 +41,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arg if (iLength >= 1) {
pNode = (CXFA_Node*)pArguments->GetObject(0);
}
- FX_INT32 bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode);
+ int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, bVerify);
@@ -49,7 +49,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arg }
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 3 || iLength > 7) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sign");
return;
@@ -81,7 +81,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(CFXJSE_Argum }
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength != 0) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate");
return;
@@ -96,7 +96,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(CFXJSE_ }
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear(CFXJSE_Arguments* pArguments)
{
- FX_INT32 iLength = pArguments->GetLength();
+ int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 2) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clear");
return;
diff --git a/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp b/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp index e4f7545f98..a15690cdcd 100644 --- a/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp @@ -146,7 +146,7 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData) if (!pValueChild) {
return CXFA_LocaleValue();
}
- FX_INT32 iVTType = XFA_VT_NULL;
+ int32_t iVTType = XFA_VT_NULL;
XFA_ELEMENT eType = pValueChild->GetClassID();
switch (eType) {
case XFA_ELEMENT_Decimal:
@@ -189,7 +189,7 @@ void XFA_GetPlainTextFromRichText(IFDE_XMLNode *pXMLNode, CFX_WideString &wsPlai IFDE_XMLElement *pXMLElement = (IFDE_XMLElement*)pXMLNode;
CFX_WideString wsTag;
pXMLElement->GetLocalTagName(wsTag);
- FX_UINT32 uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE);
+ uint32_t uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE);
if (uTag == 0x0001f714) {
wsPlainText += L"\n";
} else if (uTag == 0x00000070) {
@@ -301,20 +301,20 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal) wsValue.TrimLeft();
wsValue.TrimRight();
FX_BOOL bValid = TRUE;
- FX_INT64 nIntegral = 0;
+ int64_t nIntegral = 0;
FX_DWORD dwFractional = 0;
- FX_INT32 nExponent = 0;
- FX_INT32 cc = 0;
+ int32_t nExponent = 0;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)wsValue;
- FX_INT32 len = wsValue.GetLength();
+ int32_t len = wsValue.GetLength();
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.' || str[cc] == 'E' || str[cc] == 'e' || nIntegralLen > 17) {
break;
@@ -327,7 +327,7 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal) nIntegralLen++;
}
nIntegral = bNegative ? -nIntegral : nIntegral;
- FX_INT32 scale = 0;
+ int32_t scale = 0;
FX_DOUBLE fraction = 0.0;
if (cc < len && str[cc] == '.') {
cc ++;
@@ -382,7 +382,7 @@ FX_DOUBLE XFA_ByteStringToDouble(FX_BSTR szStringVal) return XFA_WideStringToDouble(wsValue);
}
-FX_INT32 XFA_MapRotation(FX_INT32 nRotation) {
+int32_t XFA_MapRotation(int32_t nRotation) {
nRotation = nRotation % 360;
nRotation = nRotation < 0 ? nRotation + 360 : nRotation;
return nRotation;
diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp index 56f6cee026..ee746b7fce 100644 --- a/xfa/src/fxgraphics/src/fx_graphics.cpp +++ b/xfa/src/fxgraphics/src/fx_graphics.cpp @@ -11,8 +11,8 @@ class CAGG_Graphics public:
CAGG_Graphics();
FX_ERR Create(CFX_Graphics * owner,
- FX_INT32 width,
- FX_INT32 height,
+ int32_t width,
+ int32_t height,
FXDIB_Format format);
virtual ~CAGG_Graphics();
private:
@@ -50,8 +50,8 @@ FX_ERR CFX_Graphics::Create(CFX_RenderDevice * renderDevice, }
return FX_ERR_Indefinite;
}
-FX_ERR CFX_Graphics::Create(FX_INT32 width,
- FX_INT32 height,
+FX_ERR CFX_Graphics::Create(int32_t width,
+ int32_t height,
FXDIB_Format format,
FX_BOOL isNative ,
FX_BOOL isAntialiasing )
@@ -76,7 +76,7 @@ CFX_Graphics::~CFX_Graphics() _info._graphState.SetDashCount(0);
_type = FX_CONTEXT_None;
}
-FX_ERR CFX_Graphics::GetDeviceCap(const FX_INT32 capID, FX_DeviceCap & capVal)
+FX_ERR CFX_Graphics::GetDeviceCap(const int32_t capID, FX_DeviceCap & capVal)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -94,7 +94,7 @@ FX_ERR CFX_Graphics::IsPrinterDevice(FX_BOOL & isPrinter) switch (_type) {
case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
- FX_INT32 deviceClass = _renderDevice->GetDeviceClass();
+ int32_t deviceClass = _renderDevice->GetDeviceClass();
if (deviceClass == FXDC_PRINTER) {
isPrinter = TRUE;
} else {
@@ -152,11 +152,11 @@ FX_ERR CFX_Graphics::RestoreGraphState() case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
_renderDevice->RestoreState();
- FX_INT32 size = _infoStack.GetSize();
+ int32_t size = _infoStack.GetSize();
if (size <= 0) {
return FX_ERR_Intermediate_Value_Invalid;
}
- FX_INT32 topIndex = size - 1;
+ int32_t topIndex = size - 1;
TInfo * info = (TInfo *) _infoStack.GetAt(topIndex);
_FX_RETURN_VALUE_IF_FAIL(info, FX_ERR_Intermediate_Value_Invalid);
_info._graphState.Copy(info->_graphState);
@@ -206,7 +206,7 @@ FX_ERR CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) }
}
}
-FX_ERR CFX_Graphics::GetDashCount(FX_INT32 & dashCount)
+FX_ERR CFX_Graphics::GetDashCount(int32_t & dashCount)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -238,7 +238,7 @@ FX_ERR CFX_Graphics::GetLineDash(FX_FLOAT & dashPhase, FX_FLOAT * dashArray) }
FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
FX_FLOAT * dashArray,
- FX_INT32 dashCount)
+ int32_t dashCount)
{
if (dashCount > 0 && !dashArray) {
return FX_ERR_Parameter_Invalid;
@@ -253,7 +253,7 @@ FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, }
_info._graphState.m_DashPhase = dashPhase;
_info._graphState.SetDashCount(dashCount);
- for (FX_INT32 i = 0; i < dashCount; i++) {
+ for (int32_t i = 0; i < dashCount; i++) {
_info._graphState.m_DashArray[i] = dashArray[i] * scale;
}
return FX_ERR_Succeeded;
@@ -616,7 +616,7 @@ FX_ERR CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing) }
}
}
-FX_ERR CFX_Graphics::SetTextDrawingMode(const FX_INT32 mode)
+FX_ERR CFX_Graphics::SetTextDrawingMode(const int32_t mode)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -650,7 +650,7 @@ FX_ERR CFX_Graphics::CalcTextRect(CFX_RectF & rect, switch (_type) {
case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length);
FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS,
length * sizeof (FXTEXT_CHARPOS));
@@ -709,17 +709,17 @@ FX_ERR CFX_Graphics::Transfer(CFX_Graphics * graphics, CFX_DIBitmap * bitmap = graphics->_renderDevice->GetBitmap();
FX_BOOL result = FX_ERR_Indefinite;
CFX_DIBitmap bmp;
- result = bmp.Create((FX_INT32) dstRect.width,
- (FX_INT32) dstRect.height,
+ result = bmp.Create((int32_t) dstRect.width,
+ (int32_t) dstRect.height,
bitmap->GetFormat());
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Intermediate_Value_Invalid);
result = graphics->_renderDevice->GetDIBits(&bmp,
- (FX_INT32) srcLeft,
- (FX_INT32) srcTop);
+ (int32_t) srcLeft,
+ (int32_t) srcTop);
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported);
result = _renderDevice->SetDIBits(&bmp,
- (FX_INT32) dstRect.left,
- (FX_INT32) dstRect.top);
+ (int32_t) dstRect.left,
+ (int32_t) dstRect.top);
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported);
return FX_ERR_Succeeded;
}
@@ -746,12 +746,12 @@ FX_ERR CFX_Graphics::InverseRect(const CFX_RectF & rect) if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + FX_INT32(r.top) * bitmap->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pLine = pBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + int32_t(r.top) * bitmap->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pLine = pBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pLine;
*pLine ++ = (c & 0xFF000000) | (0xFFFFFF - (c & 0x00FFFFFF));
}
@@ -772,14 +772,14 @@ FX_ERR CFX_Graphics::XorDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch());
- FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left;
- FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch());
+ FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left;
+ FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pDstLine;
*pDstLine ++ = ArgbEncode(FXARGB_A(c), (c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF));
pSrcLine ++;
@@ -802,14 +802,14 @@ FX_ERR CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch());
- FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left;
- FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch());
+ FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left;
+ FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pDstLine;
*pDstLine ++ = ArgbEncode(FXARGB_A(c), ~((c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF)));
pSrcLine ++;
@@ -934,7 +934,7 @@ FX_ERR CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource * source, point.x,
point.y);
m2.Concat(m1);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m2, left, top);
CFX_RectF r;
@@ -974,12 +974,12 @@ FX_ERR CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource * source, if (matrix) {
m1.Concat(*matrix);
}
- CFX_DIBitmap * bmp1 = source->StretchTo((FX_INT32) rect.Width(),
- (FX_INT32) rect.Height());
+ CFX_DIBitmap * bmp1 = source->StretchTo((int32_t) rect.Width(),
+ (int32_t) rect.Height());
CFX_Matrix m2;
m2.Set(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top);
m2.Concat(m1);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp2 = bmp1->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp3 = bmp2->TransformTo((CFX_AffineMatrix *) &m2, left, top);
CFX_RectF r;
@@ -1014,7 +1014,7 @@ FX_ERR CFX_Graphics::RenderDeviceShowText(const CFX_PointF & point, const CFX_WideString & text,
CFX_Matrix * matrix)
{
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length);
FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS,
length * sizeof (FXTEXT_CHARPOS));
@@ -1054,19 +1054,19 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path, {
CFX_Pattern * pattern = _info._fillColor->_pattern;
CFX_DIBitmap * bitmap = _renderDevice->GetBitmap();
- FX_INT32 width = bitmap->GetWidth();
- FX_INT32 height = bitmap->GetHeight();
+ int32_t width = bitmap->GetWidth();
+ int32_t height = bitmap->GetHeight();
CFX_DIBitmap bmp;
bmp.Create(width, height, FXDIB_Argb);
_renderDevice->GetDIBits(&bmp, 0, 0);
switch (pattern->_type) {
case FX_PATTERN_Bitmap: {
- FX_INT32 xStep = FXSYS_round(pattern->_x1Step);
- FX_INT32 yStep = FXSYS_round(pattern->_y1Step);
- FX_INT32 xCount = width / xStep + 1;
- FX_INT32 yCount = height / yStep + 1;
- for (FX_INT32 i = 0; i <= yCount; i++) {
- for (FX_INT32 j = 0; j <= xCount; j++) {
+ int32_t xStep = FXSYS_round(pattern->_x1Step);
+ int32_t yStep = FXSYS_round(pattern->_y1Step);
+ int32_t xCount = width / xStep + 1;
+ int32_t yCount = height / yStep + 1;
+ for (int32_t i = 0; i <= yCount; i++) {
+ for (int32_t j = 0; j <= xCount; j++) {
bmp.TransferBitmap(j * xStep,
i * yStep,
xStep,
@@ -1098,8 +1098,8 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path, CFX_FxgeDevice device;
device.Attach(&bmp);
device.FillRect(&rect, _info._fillColor->_pattern->_backArgb);
- for (FX_INT32 j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
- for (FX_INT32 i = rect.left; i < rect.right; i += mask.GetWidth()) {
+ for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
+ for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) {
device.SetBitMask(&mask, i, j, _info._fillColor->_pattern->_foreArgb);
}
}
@@ -1119,8 +1119,8 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, CFX_Matrix * matrix)
{
CFX_DIBitmap * bitmap = _renderDevice->GetBitmap();
- FX_INT32 width = bitmap->GetWidth();
- FX_INT32 height = bitmap->GetHeight();
+ int32_t width = bitmap->GetWidth();
+ int32_t height = bitmap->GetHeight();
FX_FLOAT start_x = _info._fillColor->_shading->_beginPoint.x;
FX_FLOAT start_y = _info._fillColor->_shading->_beginPoint.y;
FX_FLOAT end_x = _info._fillColor->_shading->_endPoint.x;
@@ -1128,16 +1128,16 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, CFX_DIBitmap bmp;
bmp.Create(width, height, FXDIB_Argb);
_renderDevice->GetDIBits(&bmp, 0, 0);
- FX_INT32 pitch = bmp.GetPitch();
+ int32_t pitch = bmp.GetPitch();
FX_BOOL result = FALSE;
switch (_info._fillColor->_shading->_type) {
case FX_SHADING_Axial: {
FX_FLOAT x_span = end_x - start_x;
FX_FLOAT y_span = end_y - start_y;
FX_FLOAT axis_len_square = FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span);
- for (FX_INT32 row = 0; row < height; row++) {
+ for (int32_t row = 0; row < height; row++) {
FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch);
- for (FX_INT32 column = 0; column < width; column++) {
+ for (int32_t column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)(column);
FX_FLOAT y = (FX_FLOAT)(row);
FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span),
@@ -1153,7 +1153,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, }
scale = 1.0f;
}
- FX_INT32 index = (FX_INT32)(scale * (FX_SHADING_Steps - 1));
+ int32_t index = (int32_t)(scale * (FX_SHADING_Steps - 1));
dib_buf[column] = _info._fillColor->_shading->_argbArray[index];
}
}
@@ -1164,9 +1164,9 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, FX_FLOAT start_r = _info._fillColor->_shading->_beginRadius;
FX_FLOAT end_r = _info._fillColor->_shading->_endRadius;
FX_FLOAT a = FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y) - FXSYS_Mul(start_r - end_r, start_r - end_r);
- for (FX_INT32 row = 0; row < height; row++) {
+ for (int32_t row = 0; row < height; row++) {
FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch);
- for (FX_INT32 column = 0; column < width; column++) {
+ for (int32_t column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)(column);
FX_FLOAT y = (FX_FLOAT)(row);
FX_FLOAT b = -2 * (FXSYS_Mul(x - start_x, end_x - start_x) + FXSYS_Mul(y - start_y, end_y - start_y) +
@@ -1211,7 +1211,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, }
s = 1.0f;
}
- int index = (FX_INT32)(s * (FX_SHADING_Steps - 1));
+ int index = (int32_t)(s * (FX_SHADING_Steps - 1));
dib_buf[column] = _info._fillColor->_shading->_argbArray[index];
}
}
@@ -1240,7 +1240,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma CFX_Matrix m;
m.Set((FX_FLOAT)source->GetWidth(), 0, 0, (FX_FLOAT)source->GetHeight(), 0, 0);
m.Concat(*matrix);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m, left, top);
_renderDevice->SetDIBits(bmp2, left, top);
@@ -1258,7 +1258,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCodes, FXTEXT_CHARPOS * charPos, CFX_RectF & rect)
{
IFX_FontEncoding * encoding = FXGE_CreateUnicodeEncoding(_info._font);
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_FLOAT penX = (FX_FLOAT) rect.left;
FX_FLOAT penY = (FX_FLOAT) rect.top;
FX_FLOAT left = (FX_FLOAT)(0);
@@ -1274,7 +1274,7 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCo charPos[0].m_AdjustMatrix[2] = 0;
charPos[0].m_AdjustMatrix[3] = 1;
penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * _info._fontSize / 1000 + _info._fontSpacing;
- for (FX_INT32 i = 1; i < length; i++) {
+ for (int32_t i = 1; i < length; i++) {
charCodes[i] = text.GetAt(i);
charPos[i].m_OriginX = penX + left;
charPos[i].m_OriginY = penY + top;
@@ -1298,8 +1298,8 @@ CAGG_Graphics::CAGG_Graphics() _owner = NULL;
}
FX_ERR CAGG_Graphics::Create(CFX_Graphics * owner,
- FX_INT32 width,
- FX_INT32 height,
+ int32_t width,
+ int32_t height,
FXDIB_Format format)
{
if (owner->_renderDevice) {
@@ -1638,21 +1638,21 @@ CFX_Shading::~CFX_Shading() }
FX_ERR CFX_Shading::InitArgbArray()
{
- FX_INT32 a1, r1, g1, b1;
+ int32_t a1, r1, g1, b1;
ArgbDecode(_beginArgb, a1, r1, g1, b1);
- FX_INT32 a2, r2, g2, b2;
+ int32_t a2, r2, g2, b2;
ArgbDecode(_endArgb, a2, r2, g2, b2);
FX_FLOAT f = (FX_FLOAT) (FX_SHADING_Steps - 1);
FX_FLOAT aScale = (FX_FLOAT) (1.0 * (a2 - a1) / f);
FX_FLOAT rScale = (FX_FLOAT) (1.0 * (r2 - r1) / f);
FX_FLOAT gScale = (FX_FLOAT) (1.0 * (g2 - g1) / f);
FX_FLOAT bScale = (FX_FLOAT) (1.0 * (b2 - b1) / f);
- FX_INT32 a3, r3, g3, b3;
- for (FX_INT32 i = 0; i < FX_SHADING_Steps; i++) {
- a3 = (FX_INT32) (i * aScale);
- r3 = (FX_INT32) (i * rScale);
- g3 = (FX_INT32) (i * gScale);
- b3 = (FX_INT32) (i * bScale);
+ int32_t a3, r3, g3, b3;
+ for (int32_t i = 0; i < FX_SHADING_Steps; i++) {
+ a3 = (int32_t) (i * aScale);
+ r3 = (int32_t) (i * rScale);
+ g3 = (int32_t) (i * gScale);
+ b3 = (int32_t) (i * bScale);
_argbArray[i] = FXARGB_TODIB(FXARGB_MAKE((a1 + a3),
(r1 + r3),
(g1 + g3),
diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp index 388fbc5ad5..99d3519dc8 100644 --- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp +++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp @@ -21,7 +21,7 @@ FX_BOOL CFX_MetafileInterpreter::SetCurrentElement(CXML_Element * element) _element = element;
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(int32_t & lineCap)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineCapElement = _element->GetElement(0);
@@ -30,8 +30,8 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap) return TRUE;
}
FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase,
- FX_INT32 & dashArray,
- FX_INT32 & dashCount)
+ int32_t & dashArray,
+ int32_t & dashCount)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * dashPhaseElement = _element->GetElement(0);
@@ -42,10 +42,10 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase, dashArray = dashArrayElement->GetAttrInteger("FX_FLOAT *");
CXML_Element * dashCountElement = _element->GetElement(2);
_FX_RETURN_VALUE_IF_FAIL(dashCountElement, FALSE);
- dashCount = dashCountElement->GetAttrInteger("FX_INT32");
+ dashCount = dashCountElement->GetAttrInteger("int32_t");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(int32_t & dashStyle)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * dashStyleElement = _element->GetElement(0);
@@ -53,7 +53,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle) dashStyle = dashStyleElement->GetAttrInteger("FX_DashStyle");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(FX_INT32 & lineJoin)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(int32_t & lineJoin)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineJoinElement = _element->GetElement(0);
@@ -70,7 +70,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetMiterLimit(FX_FLOAT & miterLimit) return TRUE;
}
FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth,
- FX_INT32 & isActOnDash)
+ int32_t & isActOnDash)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineWidthElement = _element->GetElement(0);
@@ -81,7 +81,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth, isActOnDash = isActOnDashElement->GetAttrInteger("FX_BOOL");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(int32_t & color)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * colorElement = _element->GetElement(0);
@@ -89,7 +89,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color) color = colorElement->GetAttrInteger("CFX_Color *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(int32_t & color)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * colorElement = _element->GetElement(0);
@@ -97,7 +97,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color) color = colorElement->GetAttrInteger("CFX_Color *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(int32_t & path, int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -108,9 +108,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path,
- FX_INT32 & fillMode,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(int32_t & path,
+ int32_t & fillMode,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -124,9 +124,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path, matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path,
- FX_INT32 & fillMode,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(int32_t & path,
+ int32_t & fillMode,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -140,9 +140,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path, matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source,
- FX_INT32 & point,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(int32_t & source,
+ int32_t & point,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * sourceElement = _element->GetElement(0);
@@ -156,9 +156,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source, matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source,
- FX_INT32 & rect,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(int32_t & source,
+ int32_t & rect,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * sourceElement = _element->GetElement(0);
@@ -172,7 +172,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source, matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * matrixElement = _element->GetElement(0);
@@ -180,7 +180,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix) matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(int32_t & rect)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * rectElement = _element->GetElement(0);
@@ -188,7 +188,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect) rect = rectElement->GetAttrInteger("CFX_RectF *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(FX_INT32 & font)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(int32_t & font)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * fontElement = _element->GetElement(0);
@@ -220,17 +220,17 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetCharSpacing(FX_FLOAT & spacing) spacing = spacingElement->GetAttrFloat("FX_FLOAT");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(FX_INT32 & mode)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(int32_t & mode)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * modeElement = _element->GetElement(0);
_FX_RETURN_VALUE_IF_FAIL(modeElement, FALSE);
- mode = modeElement->GetAttrInteger("FX_INT32");
+ mode = modeElement->GetAttrInteger("int32_t");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point,
- FX_INT32 & text,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(int32_t & point,
+ int32_t & text,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pointElement = _element->GetElement(0);
@@ -244,7 +244,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point, matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics, int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * graphicsElement = _element->GetElement(0);
@@ -255,11 +255,11 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics,
+FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics,
FX_FLOAT & srcLeft,
FX_FLOAT & srcTop,
- FX_INT32 & dstRect,
- FX_INT32 & matrix)
+ int32_t & dstRect,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * graphicsElement = _element->GetElement(0);
diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h index 64b63852ac..f28aa66a34 100644 --- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h +++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h @@ -14,39 +14,39 @@ public: FX_BOOL SetCurrentElement(CXML_Element * element);
- FX_BOOL ParamOf_SetLineCap(FX_INT32 & lineCap);
+ FX_BOOL ParamOf_SetLineCap(int32_t & lineCap);
FX_BOOL ParamOf_SetLineDash(FX_FLOAT & dashPhase,
- FX_INT32 & dashArray,
- FX_INT32 & dashCount);
- FX_BOOL ParamOf_SetLineDash(FX_INT32 & dashStyle);
- FX_BOOL ParamOf_SetLineJoin(FX_INT32 & lineJoin);
+ int32_t & dashArray,
+ int32_t & dashCount);
+ FX_BOOL ParamOf_SetLineDash(int32_t & dashStyle);
+ FX_BOOL ParamOf_SetLineJoin(int32_t & lineJoin);
FX_BOOL ParamOf_SetMiterLimit(FX_FLOAT & miterLimit);
- FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, FX_INT32 & isActOnDash);
+ FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, int32_t & isActOnDash);
- FX_BOOL ParamOf_SetStrokeColor(FX_INT32 & color);
- FX_BOOL ParamOf_SetFillColor(FX_INT32 & color);
+ FX_BOOL ParamOf_SetStrokeColor(int32_t & color);
+ FX_BOOL ParamOf_SetFillColor(int32_t & color);
- FX_BOOL ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix);
- FX_BOOL ParamOf_FillPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix);
- FX_BOOL ParamOf_ClipPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix);
+ FX_BOOL ParamOf_StrokePath(int32_t & path, int32_t & matrix);
+ FX_BOOL ParamOf_FillPath(int32_t & path, int32_t & fillMode, int32_t & matrix);
+ FX_BOOL ParamOf_ClipPath(int32_t & path, int32_t & fillMode, int32_t & matrix);
- FX_BOOL ParamOf_DrawImage(FX_INT32 & source, FX_INT32 & point, FX_INT32 & matrix);
- FX_BOOL ParamOf_StretchImage(FX_INT32 & source, FX_INT32 & rect, FX_INT32 & matrix);
+ FX_BOOL ParamOf_DrawImage(int32_t & source, int32_t & point, int32_t & matrix);
+ FX_BOOL ParamOf_StretchImage(int32_t & source, int32_t & rect, int32_t & matrix);
- FX_BOOL ParamOf_ConcatMatrix(FX_INT32 & matrix);
- FX_BOOL ParamOf_SetClipRect(FX_INT32 & rect);
- FX_BOOL ParamOf_SetFont(FX_INT32 & font);
+ FX_BOOL ParamOf_ConcatMatrix(int32_t & matrix);
+ FX_BOOL ParamOf_SetClipRect(int32_t & rect);
+ FX_BOOL ParamOf_SetFont(int32_t & font);
FX_BOOL ParamOf_SetFontSize(FX_FLOAT & size);
FX_BOOL ParamOf_SetFontHScale(FX_FLOAT & scale);
FX_BOOL ParamOf_SetCharSpacing(FX_FLOAT & spacing);
- FX_BOOL ParamOf_SetTextDrawingMode(FX_INT32 & mode);
- FX_BOOL ParamOf_SetText(FX_INT32 & point, FX_INT32 & text, FX_INT32 & matrix);
- FX_BOOL ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix);
- FX_BOOL ParamOf_Transfer(FX_INT32 & graphics,
+ FX_BOOL ParamOf_SetTextDrawingMode(int32_t & mode);
+ FX_BOOL ParamOf_SetText(int32_t & point, int32_t & text, int32_t & matrix);
+ FX_BOOL ParamOf_Transfer(int32_t & graphics, int32_t & matrix);
+ FX_BOOL ParamOf_Transfer(int32_t & graphics,
FX_FLOAT & srcLeft,
FX_FLOAT & srcTop,
- FX_INT32 & dstRect,
- FX_INT32 & matrix);
+ int32_t & dstRect,
+ int32_t & matrix);
private:
CXML_Element * _element;
diff --git a/xfa/src/fxgraphics/src/pre.h b/xfa/src/fxgraphics/src/pre.h index ab0df3d9ac..701a48d85d 100644 --- a/xfa/src/fxgraphics/src/pre.h +++ b/xfa/src/fxgraphics/src/pre.h @@ -33,9 +33,9 @@ enum { };
#define FX_HATCHSTYLE_Total 53
struct FX_HATCHDATA {
- FX_INT32 width;
- FX_INT32 height;
- FX_BYTE maskBits[64];
+ int32_t width;
+ int32_t height;
+ uint8_t maskBits[64];
};
typedef FX_HATCHDATA const * FX_LPCHATCHDATA;
static const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = {
diff --git a/xfa/src/fxjse/src/class.cpp b/xfa/src/fxjse/src/class.cpp index e29d4ce306..735a77f1f1 100644 --- a/xfa/src/fxjse/src/class.cpp +++ b/xfa/src/fxjse/src/class.cpp @@ -22,7 +22,7 @@ void FXJSE_DefineFunctions(FXJSE_HCONTEXT hContext, const FXJSE_FUNCTION* lpFunc CFXJSE_ScopeUtil_IsolateHandleContext scope(lpContext);
v8::Isolate *pIsolate = lpContext->GetRuntime();
v8::Local<v8::Object> hGlobalObject = FXJSE_GetGlobalObjectFromContext(scope.GetLocalContext());
- for(FX_INT32 i = 0; i < nNum; i++) {
+ for(int32_t i = 0; i < nNum; i++) {
hGlobalObject->ForceSet(v8::String::NewFromUtf8(pIsolate, lpFunctions[i].name),
v8::Function::New(pIsolate, FXJSE_V8FunctionCallback_Wrapper, v8::External::New(pIsolate, const_cast<FXJSE_FUNCTION*>(lpFunctions + i))),
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
@@ -133,12 +133,12 @@ FXJSE_HRUNTIME CFXJSE_Arguments::GetRuntime() const const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
return reinterpret_cast<FXJSE_HRUNTIME>(lpArguments->m_pRetValue->GetIsolate());
}
-FX_INT32 CFXJSE_Arguments::GetLength() const
+int32_t CFXJSE_Arguments::GetLength() const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
return lpArguments->m_pInfo->Length();
}
-FXJSE_HVALUE CFXJSE_Arguments::GetValue(FX_INT32 index) const
+FXJSE_HVALUE CFXJSE_Arguments::GetValue(int32_t index) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
CFXJSE_Value* lpArgValue = CFXJSE_Value::Create(v8::Isolate::GetCurrent());
@@ -146,29 +146,29 @@ FXJSE_HVALUE CFXJSE_Arguments::GetValue(FX_INT32 index) const lpArgValue->ForceSetValue((*lpArguments->m_pInfo)[index]);
return reinterpret_cast<FXJSE_HVALUE>(lpArgValue);
}
-FX_BOOL CFXJSE_Arguments::GetBoolean(FX_INT32 index) const
+FX_BOOL CFXJSE_Arguments::GetBoolean(int32_t index) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
return (*lpArguments->m_pInfo)[index]->BooleanValue() ? TRUE : FALSE;
}
-FX_INT32 CFXJSE_Arguments::GetInt32(FX_INT32 index) const
+int32_t CFXJSE_Arguments::GetInt32(int32_t index) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
- return static_cast<FX_INT32>((*lpArguments->m_pInfo)[index]->NumberValue());
+ return static_cast<int32_t>((*lpArguments->m_pInfo)[index]->NumberValue());
}
-FX_FLOAT CFXJSE_Arguments::GetFloat(FX_INT32 index) const
+FX_FLOAT CFXJSE_Arguments::GetFloat(int32_t index) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
return static_cast<FX_FLOAT>((*lpArguments->m_pInfo)[index]->NumberValue());
}
-CFX_ByteString CFXJSE_Arguments::GetUTF8String(FX_INT32 index) const
+CFX_ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
v8::Local<v8::String> hString = (*lpArguments->m_pInfo)[index]->ToString();
v8::String::Utf8Value szStringVal(hString);
return CFX_ByteString(*szStringVal);
}
-FX_LPVOID CFXJSE_Arguments::GetObject(FX_INT32 index, FXJSE_HCLASS hClass ) const
+FX_LPVOID CFXJSE_Arguments::GetObject(int32_t index, FXJSE_HCLASS hClass ) const
{
const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
v8::Local<v8::Value> hValue = (*lpArguments->m_pInfo)[index];
@@ -220,7 +220,7 @@ CFXJSE_Class* CFXJSE_Class::Create(CFXJSE_Context* lpContext, const FXJSE_CLASS* SetUpNamedPropHandler(pIsolate, hObjectTemplate, lpClassDefinition);
}
if(lpClassDefinition->propNum) {
- for(FX_INT32 i = 0; i < lpClassDefinition->propNum; i++) {
+ for(int32_t i = 0; i < lpClassDefinition->propNum; i++) {
hObjectTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(pIsolate, lpClassDefinition->properties[i].name),
lpClassDefinition->properties[i].getProc ? FXJSE_V8GetterCallback_Wrapper : NULL,
lpClassDefinition->properties[i].setProc ? FXJSE_V8SetterCallback_Wrapper : NULL,
@@ -229,7 +229,7 @@ CFXJSE_Class* CFXJSE_Class::Create(CFXJSE_Context* lpContext, const FXJSE_CLASS* }
}
if(lpClassDefinition->methNum) {
- for(FX_INT32 i = 0; i < lpClassDefinition->methNum; i++) {
+ for(int32_t i = 0; i < lpClassDefinition->methNum; i++) {
hObjectTemplate->Set(v8::String::NewFromUtf8(pIsolate, lpClassDefinition->methods[i].name),
v8::FunctionTemplate::New(pIsolate, FXJSE_V8FunctionCallback_Wrapper,
v8::External::New(pIsolate, const_cast<FXJSE_FUNCTION*>(lpClassDefinition->methods + i))),
diff --git a/xfa/src/fxjse/src/context.cpp b/xfa/src/fxjse/src/context.cpp index d78729fc35..d2b10db38d 100644 --- a/xfa/src/fxjse/src/context.cpp +++ b/xfa/src/fxjse/src/context.cpp @@ -51,7 +51,7 @@ static FX_LPCSTR szCompatibleModeScripts[] = { };
void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, FX_DWORD dwCompatibleFlags)
{
- for (FX_UINT32 i = 0; i < (FX_UINT32)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) {
+ for (uint32_t i = 0; i < (uint32_t)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) {
if (dwCompatibleFlags & (1 << i)) {
FXJSE_ExecuteScript(hContext, szCompatibleModeScripts[i], NULL, NULL);
}
@@ -113,7 +113,7 @@ FX_BOOL FXJSE_ReturnValue_GetMessage(FXJSE_HVALUE hRetValue, CFX_ByteString& utf utf8Message = *hStringVal1;
return TRUE;
}
-FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, FX_INT32& nLine, FX_INT32& nCol)
+FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, int32_t& nLine, int32_t& nCol)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hRetValue);
if(!lpValue) {
@@ -163,7 +163,7 @@ CFXJSE_Context* CFXJSE_Context::Create(v8::Isolate* pIsolate, const FXJSE_CLASS* }
CFXJSE_Context::~CFXJSE_Context()
{
- for(FX_INT32 i = 0, count = m_rgClasses.GetSize(); i < count; i++) {
+ for(int32_t i = 0, count = m_rgClasses.GetSize(); i < count; i++) {
CFXJSE_Class* pClass = m_rgClasses[i];
if(pClass) {
delete pClass;
diff --git a/xfa/src/fxjse/src/dynprop.cpp b/xfa/src/fxjse/src/dynprop.cpp index 3fc6c494eb..7c78f6f90a 100644 --- a/xfa/src/fxjse/src/dynprop.cpp +++ b/xfa/src/fxjse/src/dynprop.cpp @@ -32,7 +32,7 @@ static void FXJSE_DynPropGetterAdapter_MethodCallback (const v8::FunctionCallbac static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue)
{
ASSERT(lpClass);
- FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
if(nPropType == FXJSE_ClassPropType_Property) {
if(lpClass->dynPropGetter) {
lpClass->dynPropGetter(hObject, szPropName, hValue);
@@ -54,7 +54,7 @@ static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue)
{
ASSERT(lpClass);
- FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
if(nPropType != FXJSE_ClassPropType_Method) {
if(lpClass->dynPropSetter) {
lpClass->dynPropSetter(hObject, szPropName, hValue);
@@ -64,13 +64,13 @@ static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO static FX_BOOL FXJSE_DynPropQueryAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName)
{
ASSERT(lpClass);
- FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE);
+ int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE);
return nPropType != FXJSE_ClassPropType_None;
}
static FX_BOOL FXJSE_DynPropDeleterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName)
{
ASSERT(lpClass);
- FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
if(nPropType != FXJSE_ClassPropType_Method) {
if(lpClass->dynPropDeleter) {
return lpClass->dynPropDeleter(hObject, szPropName);
@@ -230,7 +230,7 @@ static void FXJSE_V8_NamedPropertyQueryCallback(v8::Local<v8::String> property, if(FXJSE_DynPropQueryAdapter(lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName)) {
info.GetReturnValue().Set(v8::DontDelete);
} else {
- const FX_INT32 iV8Absent = 64;
+ const int32_t iV8Absent = 64;
info.GetReturnValue().Set(iV8Absent);
}
delete lpThisValue;
diff --git a/xfa/src/fxjse/src/runtime.cpp b/xfa/src/fxjse/src/runtime.cpp index d880606551..6f0dbf7601 100644 --- a/xfa/src/fxjse/src/runtime.cpp +++ b/xfa/src/fxjse/src/runtime.cpp @@ -111,7 +111,7 @@ void CFXJSE_RuntimeList::AppendRuntime(v8::Isolate* pIsolate) }
void CFXJSE_RuntimeList::RemoveRuntime(v8::Isolate* pIsolate, CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback)
{
- FX_INT32 iIdx = m_RuntimeList.Find(pIsolate, 0);
+ int32_t iIdx = m_RuntimeList.Find(pIsolate, 0);
if(iIdx >= 0) {
m_RuntimeList.RemoveAt(iIdx, 1);
}
@@ -121,9 +121,9 @@ void CFXJSE_RuntimeList::RemoveRuntime(v8::Isolate* pIsolate, CFXJSE_RuntimeList }
void CFXJSE_RuntimeList::RemoveAllRuntimes(CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback)
{
- FX_INT32 iSize = m_RuntimeList.GetSize();
+ int32_t iSize = m_RuntimeList.GetSize();
if(lpfnDisposeCallback) {
- for(FX_INT32 iIdx = 0; iIdx < iSize; iIdx++) {
+ for(int32_t iIdx = 0; iIdx < iSize; iIdx++) {
lpfnDisposeCallback(m_RuntimeList[iIdx]);
}
}
diff --git a/xfa/src/fxjse/src/value.cpp b/xfa/src/fxjse/src/value.cpp index 21939e8747..783961657a 100644 --- a/xfa/src/fxjse/src/value.cpp +++ b/xfa/src/fxjse/src/value.cpp @@ -84,7 +84,7 @@ void FXJSE_Value_ToUTF8String (FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput ASSERT(lpValue);
return lpValue->ToString(szStrOutput);
}
-FX_INT32 FXJSE_Value_ToInteger (FXJSE_HVALUE hValue)
+int32_t FXJSE_Value_ToInteger (FXJSE_HVALUE hValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
@@ -121,7 +121,7 @@ void FXJSE_Value_SetUTF8String (FXJSE_HVALUE hValue, FX_BSTR szString) ASSERT(lpValue);
return lpValue->SetString(szString);
}
-void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, FX_INT32 nInteger)
+void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, int32_t nInteger)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
@@ -150,7 +150,7 @@ void FXJSE_Value_SetObject (FXJSE_HVALUE hValue, FX_LPVOID lpObject, FXJSE_HCL lpValue->SetHostObject(lpObject, lpClass);
}
}
-void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, FX_UINT32 uValueCount, FXJSE_HVALUE* rgValues)
+void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, uint32_t uValueCount, FXJSE_HVALUE* rgValues)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
return lpValue->SetArray(uValueCount, reinterpret_cast<CFXJSE_Value**>(rgValues));
@@ -181,14 +181,14 @@ FX_BOOL FXJSE_Value_SetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FX ASSERT(lpValue && lpPropValue);
return lpValue->SetObjectProperty(szPropName, lpPropValue);
}
-FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue)
+FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
ASSERT(lpValue && lpPropValue);
return lpValue->GetObjectProperty(uPropIdx, lpPropValue);
}
-FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue)
+FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
@@ -222,7 +222,7 @@ FX_BOOL FXJSE_Value_SetFunctionBind (FXJSE_HVALUE hValue, FXJSE_HVALUE hOldFunc ASSERT(lpValue && lpOldFunction && lpNewThis);
return lpValue->SetFunctionBind(lpOldFunction, lpNewThis);
}
-FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs)
+FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs)
{
CFXJSE_Value* lpFunction = reinterpret_cast<CFXJSE_Value*>(hFunction);
CFXJSE_Value* lpThis = reinterpret_cast<CFXJSE_Value*>(hThis);
@@ -293,25 +293,25 @@ V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) ASSERT(FALSE);
return fNumber;
}
- FX_UINT32 nFloatBits = (FX_UINT32&)fNumber;
- FX_UINT8 nExponent = (FX_UINT8)(nFloatBits >> 16 >> 7 );
+ uint32_t nFloatBits = (uint32_t&)fNumber;
+ uint8_t nExponent = (uint8_t)(nFloatBits >> 16 >> 7 );
if(nExponent == 0 || nExponent == 255) {
return fNumber;
}
- FX_INT8 nErrExp = nExponent - 127 - 23;
+ int8_t nErrExp = nExponent - 127 - 23;
if(nErrExp >= 0) {
return fNumber;
}
double dwError = pow(2.0, nErrExp), dwErrorHalf = dwError / 2;
double dNumber = fNumber, dNumberAbs = fabs(fNumber);
double dNumberAbsMin = dNumberAbs - dwErrorHalf, dNumberAbsMax = dNumberAbs + dwErrorHalf;
- FX_INT32 iErrPos = 0;
+ int32_t iErrPos = 0;
if(floor(dNumberAbsMin) == floor(dNumberAbsMax)) {
dNumberAbsMin = fmod(dNumberAbsMin, 1.0);
dNumberAbsMax = fmod(dNumberAbsMax, 1.0);
- FX_INT32 iErrPosMin = 1, iErrPosMax = 38;
+ int32_t iErrPosMin = 1, iErrPosMax = 38;
do {
- FX_INT32 iMid = (iErrPosMin + iErrPosMax) / 2;
+ int32_t iMid = (iErrPosMin + iErrPosMax) / 2;
double dPow = pow(10.0, iMid);
if(floor(dNumberAbsMin * dPow) == floor(dNumberAbsMax * dPow)) {
iErrPosMin = iMid + 1;
@@ -339,12 +339,12 @@ void CFXJSE_Value::SetHostObject(FX_LPVOID lpObject, CFXJSE_Class* lpClass) FXJSE_UpdateObjectBinding(hObject, lpObject);
m_hValue.Reset(m_pIsolate, hObject);
}
-void CFXJSE_Value::SetArray(FX_UINT32 uValueCount, CFXJSE_Value** rgValues)
+void CFXJSE_Value::SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Array> hArrayObject = v8::Array::New(m_pIsolate, uValueCount);
if (rgValues) {
- for(FX_UINT32 i = 0; i < uValueCount; i++) {
+ for(uint32_t i = 0; i < uValueCount; i++) {
if(rgValues[i]) {
hArrayObject->Set(i, v8::Local<v8::Value>::New(m_pIsolate, rgValues[i]->DirectGetValue()));
}
@@ -379,7 +379,7 @@ FX_BOOL CFXJSE_Value::GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpProp lpPropValue->ForceSetValue(hPropValue);
return TRUE;
}
-FX_BOOL CFXJSE_Value::SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue)
+FX_BOOL CFXJSE_Value::SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -389,7 +389,7 @@ FX_BOOL CFXJSE_Value::SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpProp v8::Local<v8::Value> hPropValue = v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->DirectGetValue());
return (FX_BOOL)hObject.As<v8::Object>()->Set(uPropIdx, hPropValue);
}
-FX_BOOL CFXJSE_Value::GetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue)
+FX_BOOL CFXJSE_Value::GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -453,8 +453,8 @@ FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* m_hValue.Reset(m_pIsolate, hBoundFunction);
return TRUE;
}
-#define FXJSE_INVALID_PTR ((FX_LPVOID)(FX_INTPTR)-1)
-FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs)
+#define FXJSE_INVALID_PTR ((FX_LPVOID)(intptr_t)-1)
+FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hFunctionValue = v8::Local<v8::Value>::New(m_pIsolate, DirectGetValue());
@@ -473,7 +473,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, F if (!lpLocalArgs) {
return FALSE;
}
- for (FX_UINT32 i = 0; i < nArgCount; i++) {
+ for (uint32_t i = 0; i < nArgCount; i++) {
new (lpLocalArgs + i) v8::Local<v8::Value>;
CFXJSE_Value* lpArg = (CFXJSE_Value*)lpArgs[i];
if(lpArg) {
@@ -505,7 +505,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, F lpRetValue->ForceSetValue(hReturnValue);
}
if(lpLocalArgs) {
- for (FX_UINT32 i = 0; i < nArgCount; i++) {
+ for (uint32_t i = 0; i < nArgCount; i++) {
lpLocalArgs[i].~Local();
}
FX_Free(lpLocalArgs);
diff --git a/xfa/src/fxjse/src/value.h b/xfa/src/fxjse/src/value.h index 547ae9251f..482015811b 100644 --- a/xfa/src/fxjse/src/value.h +++ b/xfa/src/fxjse/src/value.h @@ -128,12 +128,12 @@ public: v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return static_cast<FXJSE_DOUBLE>(hValue->NumberValue());
}
- V8_INLINE FX_INT32 ToInteger() const
+ V8_INLINE int32_t ToInteger() const
{
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
- return static_cast<FX_INT32>(hValue->NumberValue());
+ return static_cast<int32_t>(hValue->NumberValue());
}
V8_INLINE void ToString(CFX_ByteString& szStrOutput) const
{
@@ -164,7 +164,7 @@ public: v8::Local<v8::Value> hValue = v8::Boolean::New(m_pIsolate, bBoolean != FALSE);
m_hValue.Reset(m_pIsolate, hValue);
}
- V8_INLINE void SetInteger(FX_INT32 nInteger)
+ V8_INLINE void SetInteger(int32_t nInteger)
{
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Integer::New(m_pIsolate, nInteger);
@@ -192,18 +192,18 @@ public: m_hValue.Reset(m_pIsolate, hValue);
}
void SetHostObject(FX_LPVOID lpObject, CFXJSE_Class* lpClass);
- void SetArray(FX_UINT32 uValueCount, CFXJSE_Value** rgValues);
+ void SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues);
void SetDate(FXJSE_DOUBLE dDouble);
public:
FX_BOOL GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
FX_BOOL SetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
- FX_BOOL GetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue);
- FX_BOOL SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue);
+ FX_BOOL GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
+ FX_BOOL SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
FX_BOOL DeleteObjectProperty(FX_BSTR szPropName);
FX_BOOL HasObjectOwnProperty(FX_BSTR szPropName, FX_BOOL bUseTypeGetter);
FX_BOOL SetObjectOwnProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
FX_BOOL SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* lpNewThis);
- FX_BOOL Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs);
+ FX_BOOL Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs);
public:
V8_INLINE v8::Isolate* GetIsolate() const
{
|