From 736f28ab2434e2da1de66ff91b64741483ff9cba Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 25 Mar 2016 14:19:51 -0700 Subject: Remove FX_DWORD from XFA. Review URL: https://codereview.chromium.org/1830323006 --- xfa/fgas/crt/fgas_algorithm.cpp | 28 ++++---- xfa/fgas/crt/fgas_encode.cpp | 4 +- xfa/fgas/crt/fgas_stream.cpp | 84 ++++++++++++------------ xfa/fgas/crt/fgas_system.cpp | 2 +- xfa/fgas/font/fgas_fontutils.cpp | 8 +-- xfa/fgas/font/fgas_gefont.cpp | 16 ++--- xfa/fgas/font/fgas_stdfontmgr.cpp | 104 ++++++++++++++--------------- xfa/fgas/layout/fgas_linebreak.cpp | 4 +- xfa/fgas/layout/fgas_rtfbreak.cpp | 100 ++++++++++++++-------------- xfa/fgas/layout/fgas_textbreak.cpp | 108 +++++++++++++++---------------- xfa/fgas/localization/fgas_locale.cpp | 46 ++++++------- xfa/fgas/localization/fgas_localemgr.cpp | 2 +- xfa/fgas/xml/fgas_sax_imp.cpp | 20 +++--- 13 files changed, 263 insertions(+), 263 deletions(-) (limited to 'xfa/fgas') diff --git a/xfa/fgas/crt/fgas_algorithm.cpp b/xfa/fgas/crt/fgas_algorithm.cpp index 8f13cb3045..ce8dda646a 100644 --- a/xfa/fgas/crt/fgas_algorithm.cpp +++ b/xfa/fgas/crt/fgas_algorithm.cpp @@ -21,20 +21,20 @@ static const FX_CHAR g_FXBase64EncoderMap[64] = { }; struct FX_BASE64DATA { - FX_DWORD data1 : 2; - FX_DWORD data2 : 6; - FX_DWORD data3 : 4; - FX_DWORD data4 : 4; - FX_DWORD data5 : 6; - FX_DWORD data6 : 2; - FX_DWORD data7 : 8; + uint32_t data1 : 2; + uint32_t data2 : 6; + uint32_t data3 : 4; + uint32_t data4 : 4; + uint32_t data5 : 6; + uint32_t data6 : 2; + uint32_t data7 : 8; }; 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; + uint32_t b = src.data1 << 4; if (iBytes > 1) { b |= src.data4; } @@ -76,7 +76,7 @@ int32_t FX_Base64EncodeA(const uint8_t* pSrc, int32_t iSrcLen, FX_CHAR* pDst) { ((uint8_t*)&srcData)[2] = *pSrc++; iSrcLen -= 3; } else { - *((FX_DWORD*)&srcData) = 0; + *((uint32_t*)&srcData) = 0; ((uint8_t*)&srcData)[0] = *pSrc++; if (iSrcLen > 1) { ((uint8_t*)&srcData)[1] = *pSrc++; @@ -172,12 +172,12 @@ int32_t FX_Base64DecodeA(const FX_CHAR* pSrc, int32_t iSrcLen, uint8_t* pDst) { uint8_t* pDstEnd = pDst; while (iSrcLen > 0) { if (iSrcLen > 3) { - *((FX_DWORD*)srcData) = *((FX_DWORD*)pSrc); + *((uint32_t*)srcData) = *((uint32_t*)pSrc); pSrc += 4; iSrcLen -= 4; } else { - *((FX_DWORD*)&dstData) = 0; - *((FX_DWORD*)srcData) = 0; + *((uint32_t*)&dstData) = 0; + *((uint32_t*)srcData) = 0; srcData[0] = *pSrc++; if (iSrcLen > 1) { srcData[1] = *pSrc++; @@ -234,8 +234,8 @@ int32_t FX_Base64DecodeW(const FX_WCHAR* pSrc, int32_t iSrcLen, uint8_t* pDst) { srcData[3] = (FX_CHAR)*pSrc++; iSrcLen -= 4; } else { - *((FX_DWORD*)&dstData) = 0; - *((FX_DWORD*)srcData) = 0; + *((uint32_t*)&dstData) = 0; + *((uint32_t*)srcData) = 0; srcData[0] = (FX_CHAR)*pSrc++; if (iSrcLen > 1) { srcData[1] = (FX_CHAR)*pSrc++; diff --git a/xfa/fgas/crt/fgas_encode.cpp b/xfa/fgas/crt/fgas_encode.cpp index 7d04e58131..84a1ef40ed 100644 --- a/xfa/fgas/crt/fgas_encode.cpp +++ b/xfa/fgas/crt/fgas_encode.cpp @@ -96,7 +96,7 @@ void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, } } } -inline FX_DWORD FX_DWordFromBytes(const uint8_t* pStr) { +inline uint32_t FX_DWordFromBytes(const uint8_t* pStr) { return FXBSTR_ID(pStr[3], pStr[2], pStr[1], pStr[0]); } inline uint16_t FX_WordFromBytes(const uint8_t* pStr) { @@ -127,7 +127,7 @@ int32_t FX_UTF8Decode(const FX_CHAR* pSrc, } int32_t iDstLen = *pDstLen; FX_BOOL bValidDst = (pDst != NULL && iDstLen > 0); - FX_DWORD dwCode = 0; + uint32_t dwCode = 0; int32_t iPending = 0; int32_t iSrcNum = 0, iDstNum = 0; int32_t k = 0; diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp index 4dc3737d75..8ab2f9fd37 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/fgas_stream.cpp @@ -16,7 +16,7 @@ namespace { class CFX_StreamImp { public: virtual void Release() { delete this; } - virtual FX_DWORD GetAccessModes() const { return m_dwAccess; } + virtual uint32_t GetAccessModes() const { return m_dwAccess; } virtual int32_t GetLength() const = 0; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; virtual int32_t GetPosition() = 0; @@ -33,14 +33,14 @@ class CFX_StreamImp { protected: CFX_StreamImp(); virtual ~CFX_StreamImp() {} - FX_DWORD m_dwAccess; + uint32_t m_dwAccess; }; class CFX_FileStreamImp : public CFX_StreamImp { public: CFX_FileStreamImp(); virtual ~CFX_FileStreamImp(); - FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess); + FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition(); @@ -61,7 +61,7 @@ class CFX_BufferStreamImp : public CFX_StreamImp { public: CFX_BufferStreamImp(); virtual ~CFX_BufferStreamImp() {} - FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, FX_DWORD dwAccess); + FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition(); @@ -84,7 +84,7 @@ class CFX_FileReadStreamImp : public CFX_StreamImp { public: CFX_FileReadStreamImp(); virtual ~CFX_FileReadStreamImp() {} - FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess); + FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, uint32_t dwAccess); virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition() { return m_iPosition; } @@ -113,7 +113,7 @@ class CFX_BufferReadStreamImp : public CFX_StreamImp { ~CFX_BufferReadStreamImp(); FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead, int32_t iFileSize, - FX_DWORD dwAccess, + uint32_t dwAccess, FX_BOOL bReleaseBufferRead); virtual int32_t GetLength() const; @@ -143,7 +143,7 @@ class CFX_FileWriteStreamImp : public CFX_StreamImp { public: CFX_FileWriteStreamImp(); virtual ~CFX_FileWriteStreamImp() {} - FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, FX_DWORD dwAccess); + FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, uint32_t dwAccess); virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition() { return m_iPosition; } @@ -176,17 +176,17 @@ class CFX_Stream : public IFX_Stream { public: CFX_Stream(); ~CFX_Stream(); - FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess); - FX_BOOL LoadBuffer(uint8_t* 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 LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); + FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); + FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, uint32_t dwAccess); + FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, uint32_t dwAccess); FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead, int32_t iFileSize, - FX_DWORD dwAccess, + uint32_t dwAccess, FX_BOOL bReleaseBufferRead); virtual void Release(); virtual IFX_Stream* Retain(); - virtual FX_DWORD GetAccessModes() const { return m_dwAccess; } + virtual uint32_t GetAccessModes() const { return m_dwAccess; } virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition(); @@ -203,14 +203,14 @@ class CFX_Stream : public IFX_Stream { virtual int32_t GetBOM(uint8_t bom[4]) const; virtual uint16_t GetCodePage() const; virtual uint16_t SetCodePage(uint16_t wCodePage); - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, + virtual IFX_Stream* CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength); protected: FX_STREAMTYPE m_eStreamType; CFX_StreamImp* m_pStreamImp; - FX_DWORD m_dwAccess; + uint32_t m_dwAccess; int32_t m_iTotalSize; int32_t m_iPosition; int32_t m_iStart; @@ -225,7 +225,7 @@ class CFX_TextStream : public IFX_Stream { virtual void Release(); virtual IFX_Stream* Retain(); - virtual FX_DWORD GetAccessModes() const; + virtual uint32_t GetAccessModes() const; virtual int32_t GetLength() const; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); virtual int32_t GetPosition(); @@ -245,14 +245,14 @@ class CFX_TextStream : public IFX_Stream { virtual uint16_t GetCodePage() const; virtual uint16_t SetCodePage(uint16_t wCodePage); - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, + virtual IFX_Stream* CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength); protected: uint16_t m_wCodePage; int32_t m_wBOMLength; - FX_DWORD m_dwBOM; + uint32_t m_dwBOM; uint8_t* m_pBuf; int32_t m_iBufSize; FX_BOOL m_bDelStream; @@ -310,7 +310,7 @@ class CFGAS_FileWrite : public IFX_FileWrite { } // namespace IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead* pBufferRead, - FX_DWORD dwAccess, + uint32_t dwAccess, int32_t iFileSize, FX_BOOL bReleaseBufferRead) { CFX_Stream* pSR = new CFX_Stream; @@ -325,7 +325,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead* pBufferRead, return pSR; } IFX_Stream* IFX_Stream::CreateStream(IFX_FileRead* pFileRead, - FX_DWORD dwAccess) { + uint32_t dwAccess) { CFX_Stream* pSR = new CFX_Stream; if (!pSR->LoadFileRead(pFileRead, dwAccess)) { pSR->Release(); @@ -337,7 +337,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_FileRead* pFileRead, return pSR; } IFX_Stream* IFX_Stream::CreateStream(IFX_FileWrite* pFileWrite, - FX_DWORD dwAccess) { + uint32_t dwAccess) { CFX_Stream* pSR = new CFX_Stream; if (!pSR->LoadFileWrite(pFileWrite, dwAccess)) { pSR->Release(); @@ -349,7 +349,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_FileWrite* pFileWrite, return pSR; } IFX_Stream* IFX_Stream::CreateStream(const FX_WCHAR* pszFileName, - FX_DWORD dwAccess) { + uint32_t dwAccess) { CFX_Stream* pSR = new CFX_Stream; if (!pSR->LoadFile(pszFileName, dwAccess)) { pSR->Release(); @@ -362,7 +362,7 @@ IFX_Stream* IFX_Stream::CreateStream(const FX_WCHAR* pszFileName, } IFX_Stream* IFX_Stream::CreateStream(uint8_t* pData, int32_t length, - FX_DWORD dwAccess) { + uint32_t dwAccess) { CFX_Stream* pSR = new CFX_Stream; if (!pSR->LoadBuffer(pData, length, dwAccess)) { pSR->Release(); @@ -383,7 +383,7 @@ CFX_FileStreamImp::~CFX_FileStreamImp() { } } FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, - FX_DWORD dwAccess) { + uint32_t dwAccess) { FXSYS_assert(m_hFile == NULL); FXSYS_assert(pszSrcFileName != NULL && FXSYS_wcslen(pszSrcFileName) > 0); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ @@ -547,7 +547,7 @@ FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength) { CFX_FileReadStreamImp::CFX_FileReadStreamImp() : m_pFileRead(NULL), m_iPosition(0), m_iLength(0) {} FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_FileRead* pFileRead, - FX_DWORD dwAccess) { + uint32_t dwAccess) { FXSYS_assert(m_pFileRead == NULL && pFileRead != NULL); if (dwAccess & FX_STREAMACCESS_Write) { return FALSE; @@ -621,7 +621,7 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() { } FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead, int32_t iFileSize, - FX_DWORD dwAccess, + uint32_t dwAccess, FX_BOOL bReleaseBufferRead) { FXSYS_assert(m_pBufferRead == NULL && pBufferRead != NULL); if (dwAccess & FX_STREAMACCESS_Write) { @@ -680,8 +680,8 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, if (iBufferSize > iLength - m_iPosition) { iBufferSize = iLength - m_iPosition; } - FX_DWORD dwBlockOffset = m_pBufferRead->GetBlockOffset(); - FX_DWORD dwBlockSize = m_pBufferRead->GetBlockSize(); + uint32_t dwBlockOffset = m_pBufferRead->GetBlockOffset(); + uint32_t dwBlockSize = m_pBufferRead->GetBlockSize(); if (m_iPosition < (int32_t)dwBlockOffset) { if (!m_pBufferRead->ReadNextBlock(TRUE)) { return 0; @@ -702,8 +702,8 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, return 0; } const uint8_t* pBufferTmp = m_pBufferRead->GetBlockBuffer(); - FX_DWORD dwOffsetTmp = m_iPosition - dwBlockOffset; - FX_DWORD dwCopySize = + uint32_t dwOffsetTmp = m_iPosition - dwBlockOffset; + uint32_t dwCopySize = std::min(iBufferSize, (int32_t)(dwBlockSize - dwOffsetTmp)); FXSYS_memcpy(pBuffer, pBufferTmp + dwOffsetTmp, dwCopySize); dwOffsetTmp = dwCopySize; @@ -715,7 +715,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, dwBlockOffset = m_pBufferRead->GetBlockOffset(); dwBlockSize = m_pBufferRead->GetBlockSize(); pBufferTmp = m_pBufferRead->GetBlockBuffer(); - dwCopySize = std::min((FX_DWORD)iBufferSize, dwBlockSize); + dwCopySize = std::min((uint32_t)iBufferSize, dwBlockSize); FXSYS_memcpy(pBuffer + dwOffsetTmp, pBufferTmp, dwCopySize); dwOffsetTmp += dwCopySize; iBufferSize -= dwCopySize; @@ -742,7 +742,7 @@ int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr, CFX_FileWriteStreamImp::CFX_FileWriteStreamImp() : m_pFileWrite(NULL), m_iPosition(0) {} FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(IFX_FileWrite* pFileWrite, - FX_DWORD dwAccess) { + uint32_t dwAccess) { FXSYS_assert(m_pFileWrite == NULL && pFileWrite != NULL); if (dwAccess & FX_STREAMACCESS_Read) { return FALSE; @@ -809,7 +809,7 @@ CFX_BufferStreamImp::CFX_BufferStreamImp() m_iLength(0) {} FX_BOOL CFX_BufferStreamImp::LoadBuffer(uint8_t* pData, int32_t iTotalSize, - FX_DWORD dwAccess) { + uint32_t dwAccess) { FXSYS_assert(m_pData == NULL); FXSYS_assert(pData != NULL && iTotalSize > 0); m_dwAccess = dwAccess; @@ -988,7 +988,7 @@ IFX_Stream* CFX_TextStream::Retain() { m_iRefCount++; return this; } -FX_DWORD CFX_TextStream::GetAccessModes() const { +uint32_t CFX_TextStream::GetAccessModes() const { return m_pStreamImp->GetAccessModes() | FX_STREAMACCESS_Text; } int32_t CFX_TextStream::GetLength() const { @@ -1018,7 +1018,7 @@ FX_BOOL CFX_TextStream::SetLength(int32_t iLength) { uint16_t CFX_TextStream::GetCodePage() const { return m_wCodePage; } -IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, +IFX_Stream* CFX_TextStream::CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength) { IFX_Stream* pSR = @@ -1035,7 +1035,7 @@ int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const { if (m_wBOMLength < 1) { return 0; } - *(FX_DWORD*)bom = m_dwBOM; + *(uint32_t*)bom = m_dwBOM; return m_wBOMLength; } uint16_t CFX_TextStream::SetCodePage(uint16_t wCodePage) { @@ -1131,7 +1131,7 @@ CFX_Stream::~CFX_Stream() { } } FX_BOOL CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, - FX_DWORD dwAccess) { + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; } @@ -1151,7 +1151,7 @@ FX_BOOL CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, } return bRet; } -FX_BOOL CFX_Stream::LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess) { +FX_BOOL CFX_Stream::LoadFileRead(IFX_FileRead* pFileRead, uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; } @@ -1172,7 +1172,7 @@ FX_BOOL CFX_Stream::LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess) { return bRet; } FX_BOOL CFX_Stream::LoadFileWrite(IFX_FileWrite* pFileWrite, - FX_DWORD dwAccess) { + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; } @@ -1194,7 +1194,7 @@ FX_BOOL CFX_Stream::LoadFileWrite(IFX_FileWrite* pFileWrite, } FX_BOOL CFX_Stream::LoadBuffer(uint8_t* pData, int32_t iTotalSize, - FX_DWORD dwAccess) { + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; } @@ -1216,7 +1216,7 @@ FX_BOOL CFX_Stream::LoadBuffer(uint8_t* pData, } FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead* pBufferRead, int32_t iFileSize, - FX_DWORD dwAccess, + uint32_t dwAccess, FX_BOOL bReleaseBufferRead) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; @@ -1435,7 +1435,7 @@ uint16_t CFX_Stream::SetCodePage(uint16_t wCodePage) { return FX_CODEPAGE_UTF16BE; #endif } -IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, +IFX_Stream* CFX_Stream::CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength) { FXSYS_assert(iLength > 0); diff --git a/xfa/fgas/crt/fgas_system.cpp b/xfa/fgas/crt/fgas_system.cpp index e6d89a50af..df1a9d044a 100644 --- a/xfa/fgas/crt/fgas_system.cpp +++ b/xfa/fgas/crt/fgas_system.cpp @@ -61,7 +61,7 @@ FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size) { return _chsize(_fileno(file), size) == 0; #elif _FX_OS_ == _FX_WIN32_MOBILE_ HANDLE hFile = _fileno(file); - FX_DWORD dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); + uint32_t dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); ::SetFilePointer(hFile, size, 0, FILE_BEGIN); FX_BOOL bRet = ::SetEndOfFile(hFile); ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN); diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index a0767d74f5..2e550f7c08 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -9,8 +9,8 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fgas/font/fgas_font.h" -FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles) { - FX_DWORD dwHash = wCodePage; +uint32_t FGAS_GetFontHashCode(uint16_t wCodePage, uint32_t dwFontStyles) { + uint32_t dwHash = wCodePage; if (dwFontStyles & FX_FONTSTYLE_FixedPitch) { dwHash |= 0x00010000; } @@ -31,8 +31,8 @@ FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles) { } return dwHash; } -FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, - FX_DWORD dwFontStyles, +uint32_t FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, + uint32_t dwFontStyles, uint16_t wCodePage) { CFX_WideString wsFont(pszFontFamily); if (dwFontStyles & FX_FONTSTYLE_Bold) { diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index 75ed0b2a1f..3d740ba43a 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -10,7 +10,7 @@ #include "xfa/fgas/font/fgas_fontutils.h" IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, uint16_t wCodePage, IFX_FontMgr* pFontMgr) { #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ @@ -109,7 +109,7 @@ CFX_GEFont::CFX_GEFont(IFX_FontMgr* pFontMgr) m_FontMapper(16) { } -CFX_GEFont::CFX_GEFont(const CFX_GEFont& src, FX_DWORD dwFontStyles) +CFX_GEFont::CFX_GEFont(const CFX_GEFont& src, uint32_t dwFontStyles) : #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ m_bUseLogFontStyle(FALSE), @@ -188,7 +188,7 @@ IFX_Font* CFX_GEFont::Retain() { return this; } FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, uint16_t wCodePage) { if (m_pFont) { return FALSE; @@ -197,7 +197,7 @@ FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, if (pszFontFamily != NULL) { csFontFamily = CFX_ByteString::FromUnicode(pszFontFamily); } - FX_DWORD dwFlags = 0; + uint32_t dwFlags = 0; if (dwFontStyles & FX_FONTSTYLE_FixedPitch) { dwFlags |= FXFONT_FIXED_PITCH; } @@ -329,7 +329,7 @@ FX_BOOL CFX_GEFont::InitFont() { } return TRUE; } -IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, uint16_t wCodePage) { +IFX_Font* CFX_GEFont::Derive(uint32_t dwFontStyles, uint16_t wCodePage) { if (GetFontStyles() == dwFontStyles) { return Retain(); } @@ -355,14 +355,14 @@ void CFX_GEFont::GetFamilyName(CFX_WideString& wsFamily) const { void CFX_GEFont::GetPsName(CFX_WideString& wsName) const { wsName = m_pFont->GetPsName(); } -FX_DWORD CFX_GEFont::GetFontStyles() const { +uint32_t CFX_GEFont::GetFontStyles() const { FXSYS_assert(m_pFont != NULL); #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (m_bUseLogFontStyle) { return m_dwLogFontStyle; } #endif - FX_DWORD dwStyles = 0; + uint32_t dwStyles = 0; if (!m_pFont->GetSubstFont()) { if (m_pFont->IsBold()) { dwStyles |= FX_FONTSTYLE_Bold; @@ -566,7 +566,7 @@ void CFX_GEFont::Reset() { } } IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { - iGlyphIndex = ((FX_DWORD)iGlyphIndex) >> 24; + iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; return iGlyphIndex == 0 ? (IFX_Font*)this : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; } diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index a2eae837da..3733852388 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -58,9 +58,9 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() { } IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage( uint16_t wCodePage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { - FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); + uint32_t dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); IFX_Font* pFont = NULL; if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL; @@ -85,7 +85,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage( } IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset( uint8_t nCharset, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetDefFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily); @@ -93,13 +93,13 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset( IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( FX_WCHAR wUnicode, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { const FGAS_FONTUSB* pRet = FGAS_GetUnicodeBitField(wUnicode); if (pRet->wBitField == 999) return nullptr; - FX_DWORD dwHash = + uint32_t dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, pRet->wBitField); IFX_Font* pFont = nullptr; if (m_UnicodeFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) @@ -132,15 +132,15 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage( uint16_t wLanguage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetDefFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, pszFontFamily); } IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, uint16_t wCodePage) { - FX_DWORD dwHash = + uint32_t dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage); IFX_Font* pFont = NULL; if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { @@ -185,7 +185,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const uint8_t* pBuffer, int32_t iLength) { } IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFileName) { FXSYS_assert(pszFileName != NULL); - FX_DWORD dwHash = FX_HashCode_String_GetW(pszFileName, -1); + uint32_t dwHash = FX_HashCode_String_GetW(pszFileName, -1); IFX_Font* pFont = NULL; if (m_FileFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { if (pFont != NULL) { @@ -202,7 +202,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFileName) { } IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, uint16_t wCodePage, FX_BOOL bSaveStream) { FXSYS_assert(pFontStream != NULL && pFontStream->GetLength() > 0); @@ -210,7 +210,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, if (m_StreamFonts.Lookup((void*)pFontStream, (void*&)pFont)) { if (pFont != NULL) { if (pszFontAlias != NULL) { - FX_DWORD dwHash = + uint32_t dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage); m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); } @@ -222,7 +222,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, m_Fonts.Add(pFont); m_StreamFonts.SetAt((void*)pFontStream, (void*)pFont); if (pszFontAlias != NULL) { - FX_DWORD dwHash = + uint32_t dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage); m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); } @@ -231,7 +231,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, return NULL; } IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, uint16_t wCodePage) { FXSYS_assert(pSrcFont != NULL); if (pSrcFont->GetFontStyles() == dwFontStyles) { @@ -239,7 +239,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont, } void* buffer[3] = {pSrcFont, (void*)(uintptr_t)dwFontStyles, (void*)(uintptr_t)wCodePage}; - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetA((const FX_CHAR*)buffer, 3 * sizeof(void*)); IFX_Font* pFont = NULL; if (m_DeriveFonts.GetCount() > 0) { @@ -297,10 +297,10 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font* pFont) { } } FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily, - FX_DWORD dwFontStyles, - FX_DWORD dwMatchFlags, + uint32_t dwFontStyles, + uint32_t dwMatchFlags, uint16_t wCodePage, - FX_DWORD dwUSB, + uint32_t dwUSB, FX_WCHAR wUnicode) { if (m_pMatcher == NULL) { return NULL; @@ -367,8 +367,8 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, } } else { if (pParams->dwUSB < 128) { - FX_DWORD dwByte = pParams->dwUSB / 32; - FX_DWORD dwUSB = 1 << (pParams->dwUSB % 32); + uint32_t dwByte = pParams->dwUSB / 32; + uint32_t dwUSB = 1 << (pParams->dwUSB % 32); if ((pFont->FontSignature.fsUsb[dwByte] & dwUSB) == 0) { continue; } @@ -394,7 +394,7 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, } return iBestSimilar < 1 ? NULL : pBestFont; } -int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles) { +int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, uint32_t dwFontStyles) { int32_t iValue = 0; if ((dwFontStyles & FX_FONTSTYLE_Symbolic) == (pFont->dwFontStyles & FX_FONTSTYLE_Symbolic)) { @@ -417,8 +417,8 @@ int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles) { FX_LPMatchFont FX_GetDefFontMatchor() { return FX_DefFontMatcher; } -FX_DWORD FX_GetGdiFontStyles(const LOGFONTW& lf) { - FX_DWORD dwStyles = 0; +uint32_t FX_GetGdiFontStyles(const LOGFONTW& lf) { + uint32_t dwStyles = 0; if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH) { dwStyles |= FX_FONTSTYLE_FixedPitch; } @@ -644,7 +644,7 @@ void CFX_FontMgrImp::Release() { } FX_POSITION pos = m_Hash2CandidateList.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; CFX_FontDescriptorInfos* pDescs; m_Hash2CandidateList.GetNextAssoc(pos, dwHash, pDescs); if (NULL != pDescs) { @@ -653,7 +653,7 @@ void CFX_FontMgrImp::Release() { } pos = m_Hash2Fonts.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; CFX_ArrayTemplate* pFonts; m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts); if (NULL != pFonts) { @@ -663,7 +663,7 @@ void CFX_FontMgrImp::Release() { m_Hash2Fonts.RemoveAll(); pos = m_Hash2FileAccess.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; IFX_FileAccess* pFileAccess; m_Hash2FileAccess.GetNextAssoc(pos, dwHash, pFileAccess); if (NULL != pFileAccess) { @@ -672,7 +672,7 @@ void CFX_FontMgrImp::Release() { } pos = m_FileAccess2IFXFont.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; IFX_Font* pFont; m_FileAccess2IFXFont.GetNextAssoc(pos, dwHash, pFont); if (NULL != pFont) { @@ -689,40 +689,40 @@ void CFX_FontMgrImp::Release() { delete this; } IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(uint16_t wCodePage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage( this, wCodePage, dwFontStyles, pszFontFamily); } IFX_Font* CFX_FontMgrImp::GetDefFontByCharset(uint8_t nCharset, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCharset( this, nCharset, dwFontStyles, pszFontFamily); } IFX_Font* CFX_FontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByUnicode( this, wUnicode, dwFontStyles, pszFontFamily); } IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(uint16_t wLanguage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByLanguage( this, wLanguage, dwFontStyles, pszFontFamily); } IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { CFX_ByteString bsHash; bsHash.Format("%d, %d", wCodePage, dwFontStyles); bsHash += CFX_WideString(pszFontFamily).UTF8Encode(); - FX_DWORD dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength()); + uint32_t dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength()); CFX_ArrayTemplate* pFonts = NULL; IFX_Font* pFont = NULL; if (m_Hash2Fonts.Lookup(dwHash, pFonts)) { @@ -758,13 +758,13 @@ IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage, return pFont; } IFX_Font* CFX_FontMgrImp::GetFontByCharset(uint8_t nCharset, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily); } IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { IFX_Font* pFont = nullptr; if (m_FailedUnicodes2NULL.Lookup(wUnicode, pFont)) @@ -778,7 +778,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode, else bsHash.Format("%d, %d", wCodePage, dwFontStyles); bsHash += CFX_WideString(pszFontFamily).UTF8Encode(); - FX_DWORD dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength()); + uint32_t dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength()); CFX_ArrayTemplate* pFonts = nullptr; if (m_Hash2Fonts.Lookup(dwHash, pFonts)) { if (!pFonts) @@ -852,7 +852,7 @@ FX_BOOL CFX_FontMgrImp::VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode) { return TRUE; } IFX_Font* CFX_FontMgrImp::GetFontByLanguage(uint16_t wLanguage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, pszFontFamily); @@ -862,7 +862,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont(const uint8_t* pBuffer, int32_t iFaceIndex, int32_t* pFaceCount) { void* Hash[2] = {(void*)(uintptr_t)pBuffer, (void*)(uintptr_t)iLength}; - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetA((const FX_CHAR*)Hash, 2 * sizeof(void*)); IFX_FileAccess* pFontAccess = NULL; if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) { @@ -878,7 +878,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont(const FX_WCHAR* pszFileName, int32_t* pFaceCount) { CFX_ByteString bsHash; bsHash += CFX_WideString(pszFileName).UTF8Encode(); - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetA((const FX_CHAR*)bsHash, bsHash.GetLength()); IFX_FileAccess* pFontAccess = NULL; if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) { @@ -896,7 +896,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont(IFX_Stream* pFontStream, int32_t* pFaceCount, FX_BOOL bSaveStream) { void* Hash[1] = {(void*)(uintptr_t)pFontStream}; - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetA((const FX_CHAR*)Hash, 1 * sizeof(void*)); IFX_FileAccess* pFontAccess = NULL; if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) { @@ -911,7 +911,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont(IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache) { - FX_DWORD dwHash = 0; + uint32_t dwHash = 0; IFX_Font* pFont = NULL; if (bWantCache) { CFX_ByteString bsHash; @@ -1041,13 +1041,13 @@ FXFT_Face CFX_FontMgrImp::LoadFace(IFX_FileRead* pFontStream, IFX_FileRead* CFX_FontMgrImp::CreateFontStream( CFX_FontMapper* pFontMapper, IFX_SystemFontInfo* pSystemFontInfo, - FX_DWORD index) { + uint32_t index) { int iExact = 0; void* hFont = pSystemFontInfo->MapFont( 0, 0, FXFONT_DEFAULT_CHARSET, 0, pFontMapper->GetFaceName(index), iExact); if (!hFont) return nullptr; - FX_DWORD dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, nullptr, 0); + uint32_t dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, nullptr, 0); if (dwFileSize == 0) return nullptr; uint8_t* pBuffer = FX_Alloc(uint8_t, dwFileSize + 1); @@ -1073,7 +1073,7 @@ IFX_FileRead* CFX_FontMgrImp::CreateFontStream( } int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, uint16_t wCodePage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { MatchedFonts.RemoveAll(); @@ -1136,7 +1136,7 @@ uint16_t FX_GetUnicodeBit(FX_WCHAR wcUnicode) { int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, uint16_t wCodePage, - FX_DWORD dwFontStyles, + uint32_t dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { int32_t nPenalty = 30000; @@ -1173,7 +1173,7 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, nPenalty -= 27000; } } - FX_DWORD dwStyleMask = pInstalled->m_dwFontStyles ^ dwFontStyles; + uint32_t dwStyleMask = pInstalled->m_dwFontStyles ^ dwFontStyles; if (dwStyleMask & FX_FONTSTYLE_Bold) { nPenalty += 4500; } @@ -1219,7 +1219,7 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, void CFX_FontMgrImp::ClearFontCache() { FX_POSITION pos = m_Hash2CandidateList.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; CFX_FontDescriptorInfos* pDescs; m_Hash2CandidateList.GetNextAssoc(pos, dwHash, pDescs); if (NULL != pDescs) { @@ -1228,7 +1228,7 @@ void CFX_FontMgrImp::ClearFontCache() { } pos = m_FileAccess2IFXFont.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; IFX_Font* pFont; m_FileAccess2IFXFont.GetNextAssoc(pos, dwHash, pFont); if (NULL != pFont) { @@ -1255,7 +1255,7 @@ void CFX_FontMgrImp::RemoveFont(IFX_Font* pEFont) { FX_POSITION pos; pos = m_FileAccess2IFXFont.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; IFX_Font* pCFont; m_FileAccess2IFXFont.GetNextAssoc(pos, dwHash, pCFont); if (pCFont == pEFont) { @@ -1265,7 +1265,7 @@ void CFX_FontMgrImp::RemoveFont(IFX_Font* pEFont) { } pos = m_Hash2Fonts.GetStartPosition(); while (pos) { - FX_DWORD dwHash; + uint32_t dwHash; CFX_ArrayTemplate* pFonts; m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts); if (NULL != pFonts) { @@ -1341,8 +1341,8 @@ void CFX_FontMgrImp::RegisterFaces(IFX_FileRead* pFontStream, FXFT_Done_Face(pFace); } while (index < num_faces); } -FX_DWORD CFX_FontMgrImp::GetFlags(FXFT_Face pFace) { - FX_DWORD flag = 0; +uint32_t CFX_FontMgrImp::GetFlags(FXFT_Face pFace) { + uint32_t flag = 0; if (FT_IS_FIXED_WIDTH(pFace)) { flag |= FX_FONTSTYLE_FixedPitch; } @@ -1488,7 +1488,7 @@ void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, } } #undef CODEPAGERANGE_IMPLEMENT -void CFX_FontMgrImp::GetUSBCSB(FXFT_Face pFace, FX_DWORD* USB, FX_DWORD* CSB) { +void CFX_FontMgrImp::GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB) { TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2); if (NULL != pOS2) { USB[0] = pOS2->ulUnicodeRange1; diff --git a/xfa/fgas/layout/fgas_linebreak.cpp b/xfa/fgas/layout/fgas_linebreak.cpp index 295b5b6b86..72f5d70323 100644 --- a/xfa/fgas/layout/fgas_linebreak.cpp +++ b/xfa/fgas/layout/fgas_linebreak.cpp @@ -273,7 +273,7 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, if (iLength < 2) { return; } - FX_DWORD dwCur, dwNext; + uint32_t dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; @@ -298,7 +298,7 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, return; } FX_LINEBREAKTYPE eType; - FX_DWORD dwCur, dwNext; + uint32_t dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp index c856b27b70..38a2d212af 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.cpp +++ b/xfa/fgas/layout/fgas_rtfbreak.cpp @@ -68,13 +68,13 @@ class CFX_RTFLine { class CFX_RTFBreak : public IFX_RTFBreak { public: - CFX_RTFBreak(FX_DWORD dwPolicies); + CFX_RTFBreak(uint32_t dwPolicies); ~CFX_RTFBreak(); void Release() override { delete this; } void SetLineBoundary(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) override; void SetLineStartPos(FX_FLOAT fLinePos) override; - FX_DWORD GetLayoutStyles() const override { return m_dwLayoutStyles; } - void SetLayoutStyles(FX_DWORD dwLayoutStyles) override; + uint32_t GetLayoutStyles() const override { return m_dwLayoutStyles; } + void SetLayoutStyles(uint32_t dwLayoutStyles) override; void SetFont(IFX_Font* pFont) override; void SetFontSize(FX_FLOAT fFontSize) override; void SetTabWidth(FX_FLOAT fTabWidth) override; @@ -92,8 +92,8 @@ class CFX_RTFBreak : public IFX_RTFBreak { void SetReadingOrder(FX_BOOL bRTL = FALSE) override; void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) override; void SetUserData(IFX_Unknown* pUserData) override; - FX_DWORD AppendChar(FX_WCHAR wch) override; - FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) override; + uint32_t AppendChar(FX_WCHAR wch) override; + uint32_t EndBreak(uint32_t dwStatus = FX_RTFBREAK_PieceBreak) override; int32_t CountBreakPieces() const override; const CFX_RTFPiece* GetBreakPiece(int32_t index) const override; void GetLineRect(CFX_RectF& rect) const override; @@ -108,19 +108,19 @@ class CFX_RTFBreak : public IFX_RTFBreak { int32_t GetCharRects(const FX_RTFTEXTOBJ* pText, CFX_RectFArray& rtArray, FX_BOOL bCharBBox = FALSE) const override; - FX_DWORD AppendChar_CharCode(FX_WCHAR wch); - 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); + uint32_t AppendChar_CharCode(FX_WCHAR wch); + uint32_t AppendChar_Combination(CFX_RTFChar* pCurChar, int32_t iRotation); + uint32_t AppendChar_Tab(CFX_RTFChar* pCurChar, int32_t iRotation); + uint32_t AppendChar_Control(CFX_RTFChar* pCurChar, int32_t iRotation); + uint32_t AppendChar_Arabic(CFX_RTFChar* pCurChar, int32_t iRotation); + uint32_t AppendChar_Others(CFX_RTFChar* pCurChar, int32_t iRotation); protected: - FX_DWORD m_dwPolicies; + uint32_t m_dwPolicies; IFX_ArabicChar* m_pArabicChar; int32_t m_iBoundaryStart; int32_t m_iBoundaryEnd; - FX_DWORD m_dwLayoutStyles; + uint32_t m_dwLayoutStyles; FX_BOOL m_bPagination; FX_BOOL m_bVertical; FX_BOOL m_bSingleLine; @@ -145,19 +145,19 @@ class CFX_RTFBreak : public IFX_RTFBreak { FX_BOOL m_bRTL; int32_t m_iAlignment; IFX_Unknown* m_pUserData; - FX_DWORD m_dwCharType; - FX_DWORD m_dwIdentity; + uint32_t m_dwCharType; + uint32_t m_dwIdentity; CFX_RTFLine m_RTFLine1; CFX_RTFLine m_RTFLine2; CFX_RTFLine* m_pCurLine; int32_t m_iReady; int32_t m_iTolerance; - int32_t GetLineRotation(FX_DWORD dwStyles) const; + int32_t GetLineRotation(uint32_t dwStyles) const; void SetBreakStatus(); 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; + uint32_t GetUnifiedCharType(uint32_t dwType) const; int32_t GetLastPositionedTab() const; FX_BOOL GetPositionedTab(int32_t& iTabPos) const; int32_t GetBreakPos(CFX_RTFCharArray& tca, @@ -169,19 +169,19 @@ class CFX_RTFBreak : public IFX_RTFBreak { 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); + uint32_t dwStatus); + void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus); void EndBreak_Alignment(CFX_TPOArray& tpos, FX_BOOL bAllChars, - FX_DWORD dwStatus); + uint32_t dwStatus); }; } // namespace -IFX_RTFBreak* IFX_RTFBreak::Create(FX_DWORD dwPolicies) { +IFX_RTFBreak* IFX_RTFBreak::Create(uint32_t dwPolicies) { return new CFX_RTFBreak(dwPolicies); } -CFX_RTFBreak::CFX_RTFBreak(FX_DWORD dwPolicies) +CFX_RTFBreak::CFX_RTFBreak(uint32_t dwPolicies) : m_dwPolicies(dwPolicies), m_pArabicChar(NULL), m_iBoundaryStart(0), @@ -243,7 +243,7 @@ void CFX_RTFBreak::SetLineStartPos(FX_FLOAT fLinePos) { iLinePos = std::max(iLinePos, m_iBoundaryStart); m_pCurLine->m_iStart = iLinePos; } -void CFX_RTFBreak::SetLayoutStyles(FX_DWORD dwLayoutStyles) { +void CFX_RTFBreak::SetLayoutStyles(uint32_t dwLayoutStyles) { if (m_dwLayoutStyles == dwLayoutStyles) { return; } @@ -424,7 +424,7 @@ void CFX_RTFBreak::SetUserData(IFX_Unknown* pUserData) { } } 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 { +int32_t CFX_RTFBreak::GetLineRotation(uint32_t dwStyles) const { return gs_FX_RTFLineRotations[(dwStyles & 0x0E) >> 1]; } void CFX_RTFBreak::SetBreakStatus() { @@ -477,7 +477,7 @@ CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces(FX_BOOL bReady) const { } return &pRTFLine->m_LinePieces; } -inline FX_DWORD CFX_RTFBreak::GetUnifiedCharType(FX_DWORD dwType) const { +inline uint32_t CFX_RTFBreak::GetUnifiedCharType(uint32_t dwType) const { return dwType >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : dwType; } int32_t CFX_RTFBreak::GetLastPositionedTab() const { @@ -497,7 +497,7 @@ FX_BOOL CFX_RTFBreak::GetPositionedTab(int32_t& iTabPos) const { } return FALSE; } -typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)( +typedef uint32_t (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)( CFX_RTFChar* pCurChar, int32_t iRotation); static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = { @@ -510,13 +510,13 @@ static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = { &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others, }; -FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { +uint32_t CFX_RTFBreak::AppendChar(FX_WCHAR wch) { FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL); if (m_bCharCode) { return AppendChar_CharCode(wch); } - FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; - FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); + uint32_t dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; + uint32_t dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; CFX_RTFChar* pCurChar = tca.AddSpace(); pCurChar->m_dwStatus = 0; @@ -535,7 +535,7 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { m_pUserData->AddRef(); } pCurChar->m_pUserData = m_pUserData; - FX_DWORD dwRet1 = FX_RTFBREAK_None; + uint32_t dwRet1 = FX_RTFBREAK_None; if (dwType != FX_CHARTYPE_Combination && GetUnifiedCharType(m_dwCharType) != GetUnifiedCharType(dwType)) { if (!m_bSingleLine && !m_bOrphanLine && m_dwCharType > 0 && @@ -553,13 +553,13 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { if (m_bVertical && (dwProps & 0x8000) != 0) { iRotation = (iRotation + 1) % 4; } - FX_DWORD dwRet2 = + uint32_t dwRet2 = (this->*g_FX_RTFBreak_lpfAppendChar[dwType >> FX_CHARTYPEBITS])( pCurChar, iRotation); m_dwCharType = dwType; return std::max(dwRet1, dwRet2); } -FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) { +uint32_t CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) { FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL); FXSYS_assert(m_bCharCode); m_pCurLine->m_iMBCSChars++; @@ -601,7 +601,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) { } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar* pCurChar, +uint32_t CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar* pCurChar, int32_t iRotation) { int32_t iCharWidth = 0; if (m_bVertical != FX_IsOdd(iRotation)) { @@ -626,7 +626,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar* pCurChar, } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar* pCurChar, +uint32_t CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar* pCurChar, int32_t iRotation) { if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ExpandTab) { FX_BOOL bBreak = FALSE; @@ -648,9 +648,9 @@ FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar* pCurChar, } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar* pCurChar, +uint32_t CFX_RTFBreak::AppendChar_Control(CFX_RTFChar* pCurChar, int32_t iRotation) { - FX_DWORD dwRet2 = FX_RTFBREAK_None; + uint32_t dwRet2 = FX_RTFBREAK_None; if (!m_bSingleLine) { switch (pCurChar->m_wCharCode) { case L'\v': @@ -675,7 +675,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar* pCurChar, } return dwRet2; } -FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar, +uint32_t CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar, int32_t iRotation) { CFX_RTFChar* pLastChar = NULL; int32_t& iLineWidth = m_pCurLine->m_iWidth; @@ -733,9 +733,9 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar, } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar* pCurChar, +uint32_t CFX_RTFBreak::AppendChar_Others(CFX_RTFChar* pCurChar, int32_t iRotation) { - FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); + uint32_t dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); FX_WCHAR wForm; if (dwType == FX_CHARTYPE_Numeric) { if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) { @@ -773,7 +773,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar* pCurChar, } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::EndBreak(FX_DWORD dwStatus) { +uint32_t CFX_RTFBreak::EndBreak(uint32_t dwStatus) { FXSYS_assert(dwStatus >= FX_RTFBREAK_PieceBreak && dwStatus <= FX_RTFBREAK_PageBreak); m_dwIdentity++; @@ -836,7 +836,7 @@ EndBreak_Ret: } FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine, FX_BOOL bAllChars, - FX_DWORD dwStatus) { + uint32_t dwStatus) { FX_BOOL bDone = FALSE; if (!m_bSingleLine && !m_bOrphanLine && m_pCurLine->GetLineEnd() > m_iBoundaryEnd + m_iTolerance) { @@ -869,7 +869,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine, CFX_RTFPiece tp; tp.m_pChars = &m_pCurLine->m_LineChars; FX_BOOL bNew = TRUE; - FX_DWORD dwIdentity = (FX_DWORD)-1; + uint32_t dwIdentity = (uint32_t)-1; int32_t iLast = m_pCurLine->CountChars() - 1, j = 0; for (int32_t i = 0; i <= iLast;) { pTC = pCurChars + i; @@ -913,7 +913,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine, } return FALSE; } -void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus) { +void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) { FX_TPO tpo; CFX_RTFPiece tp; CFX_RTFChar* pTC; @@ -948,7 +948,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus) { tp.m_pChars = &chars; CFX_RTFPieceArray* pCurPieces = &m_pCurLine->m_LinePieces; int32_t iBidiLevel = -1, iCharWidth; - FX_DWORD dwIdentity = (FX_DWORD)-1; + uint32_t dwIdentity = (uint32_t)-1; i = j = 0; while (i < iCount) { pTC = chars.GetDataPtr(i); @@ -1011,12 +1011,12 @@ 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) { + uint32_t dwStatus) { CFX_RTFPieceArray* pCurPieces = &m_pCurLine->m_LinePieces; int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; int32_t iCount = pCurPieces->GetSize(); FX_BOOL bFind = FALSE; - FX_DWORD dwCharType; + uint32_t dwCharType; int32_t i, j; FX_TPO tpo; for (i = iCount - 1; i > -1; i--) { @@ -1137,7 +1137,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca, FX_BOOL bNumberBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_NumberBreak) != 0; FX_BOOL bInfixBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_InfixBreak) != 0; FX_LINEBREAKTYPE eType; - FX_DWORD nCodeProp, nCur, nNext; + uint32_t nCodeProp, nCur, nNext; CFX_RTFChar* pCur = pCharArray + iLength--; if (bAllChars) { pCur->m_nBreakType = FX_LBT_UNKNOWN; @@ -1355,7 +1355,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, int32_t* pWidths = pText->pWidths; int32_t iLength = pText->iLength - 1; IFX_Font* pFont = pText->pFont; - FX_DWORD dwStyles = pText->dwLayoutStyles; + uint32_t dwStyles = pText->dwLayoutStyles; CFX_RectF rtText(*pText->pRect); FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel); FX_FLOAT fFontSize = pText->fFontSize; @@ -1378,7 +1378,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, int32_t iHorScale = pText->iHorizontalScale; int32_t iVerScale = pText->iVerticalScale; FX_BOOL bEmptyChar; - FX_DWORD dwProps, dwCharType; + uint32_t dwProps, dwCharType; fX = rtText.left; fY = rtText.top; if (bVerticalDoc) { @@ -1613,7 +1613,7 @@ int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText, FX_FLOAT fHeight = FXSYS_fabs(bbox.height * fScale); rtArray.RemoveAll(); rtArray.SetSize(iLength); - FX_DWORD dwStyles = pText->dwLayoutStyles; + uint32_t dwStyles = pText->dwLayoutStyles; FX_BOOL bVertical = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalLayout) != 0; FX_BOOL bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0; FX_BOOL bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0; diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 990656b1d1..d33d02c6f2 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -62,13 +62,13 @@ class CFX_TxtLine { class CFX_TxtBreak : public IFX_TxtBreak { public: - CFX_TxtBreak(FX_DWORD dwPolicies); + CFX_TxtBreak(uint32_t dwPolicies); ~CFX_TxtBreak(); virtual void Release() { delete this; } virtual void SetLineWidth(FX_FLOAT fLineWidth); virtual void SetLinePos(FX_FLOAT fLinePos); - virtual FX_DWORD GetLayoutStyles() const { return m_dwLayoutStyles; } - virtual void SetLayoutStyles(FX_DWORD dwLayoutStyles); + virtual uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; } + virtual void SetLayoutStyles(uint32_t dwLayoutStyles); virtual void SetFont(IFX_Font* pFont); virtual void SetFontSize(FX_FLOAT fFontSize); virtual void SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); @@ -80,12 +80,12 @@ class CFX_TxtBreak : public IFX_TxtBreak { virtual void SetCharRotation(int32_t iCharRotation); virtual void SetCharSpace(FX_FLOAT fCharSpace); virtual void SetAlignment(int32_t iAlignment); - virtual FX_DWORD GetContextCharStyles() const; - virtual void SetContextCharStyles(FX_DWORD dwCharStyles); + virtual uint32_t GetContextCharStyles() const; + virtual void SetContextCharStyles(uint32_t dwCharStyles); virtual void SetCombWidth(FX_FLOAT fCombWidth); virtual void SetUserData(void* pUserData); - virtual FX_DWORD AppendChar(FX_WCHAR wch); - virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak); + virtual uint32_t AppendChar(FX_WCHAR wch); + virtual uint32_t EndBreak(uint32_t dwStatus = FX_TXTBREAK_PieceBreak); virtual int32_t CountBreakChars() const; virtual int32_t CountBreakPieces() const; virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const; @@ -100,19 +100,19 @@ class CFX_TxtBreak : public IFX_TxtBreak { virtual int32_t GetCharRects(const FX_TXTRUN* 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, 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); + void AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps); + uint32_t AppendChar_Combination(CFX_Char* pCurChar, int32_t iRotation); + uint32_t AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation); + uint32_t AppendChar_Control(CFX_Char* pCurChar, int32_t iRotation); + uint32_t AppendChar_Arabic(CFX_Char* pCurChar, int32_t iRotation); + uint32_t AppendChar_Others(CFX_Char* pCurChar, int32_t iRotation); protected: - FX_DWORD m_dwPolicies; + uint32_t m_dwPolicies; FX_BOOL m_bPagination; IFX_ArabicChar* m_pArabicChar; int32_t m_iLineWidth; - FX_DWORD m_dwLayoutStyles; + uint32_t m_dwLayoutStyles; FX_BOOL m_bVertical; FX_BOOL m_bArabicContext; FX_BOOL m_bArabicShapes; @@ -132,10 +132,10 @@ class CFX_TxtBreak : public IFX_TxtBreak { int32_t m_iCharRotation; int32_t m_iRotation; int32_t m_iAlignment; - FX_DWORD m_dwContextCharStyles; + uint32_t m_dwContextCharStyles; int32_t m_iCombWidth; void* m_pUserData; - FX_DWORD m_dwCharType; + uint32_t m_dwCharType; FX_BOOL m_bCurRTL; int32_t m_iCurAlignment; FX_BOOL m_bArabicNumber; @@ -149,21 +149,21 @@ class CFX_TxtBreak : public IFX_TxtBreak { int32_t m_iVerScale; int32_t m_iCharSpace; void SetBreakStatus(); - int32_t GetLineRotation(FX_DWORD dwStyles) const; + int32_t GetLineRotation(uint32_t 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; + uint32_t GetUnifiedCharType(uint32_t dwType) const; void ResetArabicContext(); void ResetContextCharStyles(); void EndBreak_UpdateArabicShapes(); FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine, FX_BOOL bAllChars, - FX_DWORD dwStatus); - void EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus); + uint32_t dwStatus); + void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus); void EndBreak_Alignment(CFX_TPOArray& tpos, FX_BOOL bAllChars, - FX_DWORD dwStatus); + uint32_t dwStatus); int32_t GetBreakPos(CFX_TxtCharArray& ca, int32_t& iEndPos, FX_BOOL bAllChars = FALSE, @@ -176,10 +176,10 @@ class CFX_TxtBreak : public IFX_TxtBreak { } // namespace extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32]; -IFX_TxtBreak* IFX_TxtBreak::Create(FX_DWORD dwPolicies) { +IFX_TxtBreak* IFX_TxtBreak::Create(uint32_t dwPolicies) { return new CFX_TxtBreak(dwPolicies); } -CFX_TxtBreak::CFX_TxtBreak(FX_DWORD dwPolicies) +CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies) : m_dwPolicies(dwPolicies), m_pArabicChar(NULL), m_iLineWidth(2000000), @@ -248,7 +248,7 @@ void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos) { m_pCurLine->m_iStart = iLinePos; m_pCurLine->m_iWidth += iLinePos; } -void CFX_TxtBreak::SetLayoutStyles(FX_DWORD dwLayoutStyles) { +void CFX_TxtBreak::SetLayoutStyles(uint32_t dwLayoutStyles) { m_dwLayoutStyles = dwLayoutStyles; m_bVertical = (m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0; m_bArabicContext = (m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ArabicContext) != 0; @@ -350,10 +350,10 @@ void CFX_TxtBreak::ResetContextCharStyles() { } m_dwContextCharStyles |= (m_iArabicContext << 8); } -FX_DWORD CFX_TxtBreak::GetContextCharStyles() const { +uint32_t CFX_TxtBreak::GetContextCharStyles() const { return m_dwContextCharStyles; } -void CFX_TxtBreak::SetContextCharStyles(FX_DWORD dwCharStyles) { +void CFX_TxtBreak::SetContextCharStyles(uint32_t dwCharStyles) { m_iCurAlignment = dwCharStyles & 0x0F; m_bArabicNumber = (dwCharStyles & FX_TXTCHARSTYLE_ArabicNumber) != 0; m_bArabicComma = (dwCharStyles & FX_TXTCHARSTYLE_ArabicComma) != 0; @@ -408,7 +408,7 @@ void CFX_TxtBreak::SetCharSpace(FX_FLOAT fCharSpace) { m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f); } 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 { +int32_t CFX_TxtBreak::GetLineRotation(uint32_t dwStyles) const { return gs_FX_TxtLineRotations[(dwStyles & 0x0E) >> 1]; } CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const { @@ -449,7 +449,7 @@ CFX_TxtPieceArray* CFX_TxtBreak::GetTxtPieces(FX_BOOL bReady) const { } return pTxtLine->m_pLinePieces; } -inline FX_DWORD CFX_TxtBreak::GetUnifiedCharType(FX_DWORD dwType) const { +inline uint32_t CFX_TxtBreak::GetUnifiedCharType(uint32_t dwType) const { return dwType >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : dwType; } void CFX_TxtBreak::ResetArabicContext() { @@ -477,7 +477,7 @@ void CFX_TxtBreak::ResetArabicContext() { m_bArabicComma = m_bArabicNumber; ResetContextCharStyles(); } -void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char* pCurChar, FX_DWORD dwProps) { +void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps) { if (!m_bPagination) { ((CFX_TxtChar*)pCurChar)->m_dwStatus = 0; ((CFX_TxtChar*)pCurChar)->m_pUserData = m_pUserData; @@ -505,7 +505,7 @@ 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, +uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar, int32_t iRotation) { FXSYS_assert(pCurChar != NULL); FX_WCHAR wch = pCurChar->m_wCharCode; @@ -557,7 +557,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar, pCurChar->m_iCharWidth = -iCharWidth; return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation) { +uint32_t 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; @@ -584,10 +584,10 @@ FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation) { } return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar, +uint32_t CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar, int32_t iRotation) { m_dwCharType = FX_CHARTYPE_Control; - FX_DWORD dwRet = FX_TXTBREAK_None; + uint32_t dwRet = FX_TXTBREAK_None; if (!m_bSingleLine) { FX_WCHAR wch = pCurChar->m_wCharCode; switch (wch) { @@ -613,9 +613,9 @@ FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar, } return dwRet; } -FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar, +uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar, int32_t iRotation) { - FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); + uint32_t dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); int32_t& iLineWidth = m_pCurLine->m_iWidth; FX_WCHAR wForm; int32_t iCharWidth = 0; @@ -676,10 +676,10 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar, } return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar, +uint32_t CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar, int32_t iRotation) { - FX_DWORD dwProps = pCurChar->m_dwCharProps; - FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); + uint32_t dwProps = pCurChar->m_dwCharProps; + uint32_t dwType = (dwProps & FX_CHARTYPEBITSMASK); int32_t& iLineWidth = m_pCurLine->m_iWidth; int32_t iCharWidth = 0; m_dwCharType = dwType; @@ -719,7 +719,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar, } return FX_TXTBREAK_None; } -typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char* pCurChar, +typedef uint32_t (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, @@ -731,9 +731,9 @@ static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = { &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others, }; -FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) { - FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; - FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); +uint32_t CFX_TxtBreak::AppendChar(FX_WCHAR wch) { + uint32_t dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; + uint32_t dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_TxtChar* pCurChar = m_pCurLine->m_pLineChars->AddSpace(); pCurChar->m_wCharCode = (uint16_t)wch; pCurChar->m_nRotation = m_iCharRotation; @@ -749,7 +749,7 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) { pCurChar->m_iBidiOrder = 0; pCurChar->m_pUserData = NULL; AppendChar_PageLoad(pCurChar, dwProps); - FX_DWORD dwRet1 = FX_TXTBREAK_None; + uint32_t dwRet1 = FX_TXTBREAK_None; if (dwType != FX_CHARTYPE_Combination && GetUnifiedCharType(m_dwCharType) != GetUnifiedCharType(dwType)) { if (m_dwCharType > 0 && @@ -767,7 +767,7 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) { if (m_bVertical && (dwProps & 0x8000) != 0) { iRotation = (iRotation + 1) % 4; } - FX_DWORD dwRet2 = + uint32_t dwRet2 = (this->*g_FX_TxtBreak_lpfAppendChar[dwType >> FX_CHARTYPEBITS])( pCurChar, iRotation); return std::max(dwRet1, dwRet2); @@ -825,7 +825,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() { } FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine, FX_BOOL bAllChars, - FX_DWORD dwStatus) { + uint32_t dwStatus) { int32_t iCount = m_pCurLine->CountChars(); FX_BOOL bDone = FALSE; CFX_Char* pTC; @@ -873,7 +873,7 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine, } return FALSE; } -void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus) { +void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) { CFX_TxtPiece tp; FX_TPO tpo; CFX_TxtChar* pTC; @@ -983,14 +983,14 @@ 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) { + uint32_t dwStatus) { int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; CFX_TxtPieceArray* pCurPieces = m_pCurLine->m_pLinePieces; int32_t i, j, iCount = pCurPieces->GetSize(); FX_BOOL bFind = FALSE; FX_TPO tpo; CFX_TxtChar* pTC; - FX_DWORD dwCharType; + uint32_t dwCharType; for (i = iCount - 1; i > -1; i--) { tpo = tpos.GetAt(i); CFX_TxtPiece& ttp = pCurPieces->GetAt(tpo.index); @@ -1071,7 +1071,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray& tpos, } } } -FX_DWORD CFX_TxtBreak::EndBreak(FX_DWORD dwStatus) { +uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) { FXSYS_assert(dwStatus >= FX_TXTBREAK_PieceBreak && dwStatus <= FX_TXTBREAK_PageBreak); CFX_TxtPieceArray* pCurPieces = m_pCurLine->m_pLinePieces; @@ -1158,7 +1158,7 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca, FX_BOOL bSpaceBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0; FX_BOOL bNumberBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_NumberBreak) != 0; FX_LINEBREAKTYPE eType; - FX_DWORD nCodeProp, nCur, nNext; + uint32_t nCodeProp, nCur, nNext; CFX_Char* pCur = ca.GetDataPtr(iLength--); if (bAllChars) { pCur->m_nBreakType = FX_LBT_UNKNOWN; @@ -1343,7 +1343,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, int32_t* pWidths = pTxtRun->pWidths; int32_t iLength = pTxtRun->iLength - 1; IFX_Font* pFont = pTxtRun->pFont; - FX_DWORD dwStyles = pTxtRun->dwStyles; + uint32_t dwStyles = pTxtRun->dwStyles; CFX_RectF rtText(*pTxtRun->pRect); FX_BOOL bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0; @@ -1370,7 +1370,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, int32_t iVerScale = pTxtRun->iVerticalScale; FX_BOOL bSkipSpace = pTxtRun->bSkipSpace; FX_BOOL bEmptyChar, bShadda = FALSE, bLam = FALSE; - FX_DWORD dwProps, dwCharType; + uint32_t dwProps, dwCharType; FX_FORMCHAR formChars[3]; FX_FLOAT fYBase; fX = rtText.left; @@ -1599,7 +1599,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, fFontSize * (FX_FLOAT)rtBBox.height / (FX_FLOAT)iMaxHeight; } if (wForm == wch && wLast != 0xFEFF) { - FX_DWORD dwLastProps = FX_GetUnicodeProperties(wLast); + uint32_t dwLastProps = FX_GetUnicodeProperties(wLast); if ((dwLastProps & FX_CHARTYPEBITSMASK) == FX_CHARTYPE_Combination) { CFX_Rect rtBBox; diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index a0dcf8e3f4..a6443f4de7 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -44,7 +44,7 @@ static const int32_t g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO); struct FX_LOCALETIMEZONEINFO { - FX_DWORD uHash; + uint32_t uHash; int16_t iHour; int16_t iMinute; }; @@ -367,7 +367,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, scale++; cc++; } - lcnum.m_Fractional = (FX_DWORD)(fraction * 4294967296.0); + lcnum.m_Fractional = (uint32_t)(fraction * 4294967296.0); } if (cc < len && (str[cc] == 'E' || str[cc] == 'e')) { cc++; @@ -396,7 +396,7 @@ CFX_LCNumeric::CFX_LCNumeric() { m_Exponent = 0; } CFX_LCNumeric::CFX_LCNumeric(int64_t integral, - FX_DWORD fractional, + uint32_t fractional, int32_t exponent) { m_Integral = integral; m_Fractional = fractional; @@ -404,14 +404,14 @@ CFX_LCNumeric::CFX_LCNumeric(int64_t integral, } CFX_LCNumeric::CFX_LCNumeric(FX_FLOAT dbRetValue) { m_Integral = (int64_t)dbRetValue; - m_Fractional = (FX_DWORD)(((dbRetValue > 0) ? (dbRetValue - m_Integral) + m_Fractional = (uint32_t)(((dbRetValue > 0) ? (dbRetValue - m_Integral) : (m_Integral - dbRetValue)) * 4294967296); m_Exponent = 0; } CFX_LCNumeric::CFX_LCNumeric(double dbvalue) { m_Integral = (int64_t)dbvalue; - m_Fractional = (FX_DWORD)( + m_Fractional = (uint32_t)( ((dbvalue > 0) ? (dbvalue - m_Integral) : (m_Integral - dbvalue)) * 4294967296); m_Exponent = 0; @@ -599,7 +599,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory( wsCategory += pStr[ccf]; ccf++; } - FX_DWORD dwHash = + uint32_t dwHash = FX_HashCode_String_GetW(wsCategory, wsCategory.GetLength()); if (dwHash == FX_LOCALECATEGORY_DateHash) { if (eCategory == FX_LOCALECATEGORY_Time) { @@ -715,7 +715,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern, #define FX_NUMSTYLE_DotVorv 0x04 IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, - FX_DWORD& dwStyle, + uint32_t& dwStyle, CFX_WideString& wsPurgePattern) { dwStyle = 0; IFX_Locale* pLocale = NULL; @@ -759,7 +759,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') { wsSubCategory += pStr[ccf++]; } - FX_DWORD dwSubHash = + uint32_t dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength()); FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal; for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) { @@ -920,7 +920,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, return FALSE; } int32_t dot_index_f = -1; - FX_DWORD dwFormatStyle = 0; + uint32_t dwFormatStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat); @@ -1686,7 +1686,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, return FALSE; } int32_t dot_index_f = -1; - FX_DWORD dwFormatStyle = 0; + uint32_t dwFormatStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat); @@ -2236,7 +2236,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') { wsSubCategory += pStr[ccf++]; } - FX_DWORD dwSubHash = + uint32_t dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength()); FX_LOCALEDATETIMESUBCATEGORY eSubCategory = FX_LOCALEDATETIMESUBCATEGORY_Medium; @@ -2337,8 +2337,8 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, ccf++; continue; } - FX_DWORD dwSymbolNum = 1; - FX_DWORD dwSymbol = strf[ccf++]; + uint32_t dwSymbolNum = 1; + uint32_t dwSymbol = strf[ccf++]; while (ccf < lenf && strf[ccf] == dwSymbol) { ccf++; dwSymbolNum++; @@ -2556,8 +2556,8 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, ccf++; continue; } - FX_DWORD dwSymbolNum = 1; - FX_DWORD dwSymbol = strf[ccf++]; + uint32_t dwSymbolNum = 1; + uint32_t dwSymbol = strf[ccf++]; while (ccf < lenf && strf[ccf] == dwSymbol) { ccf++; dwSymbolNum++; @@ -2666,7 +2666,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, if (cc + 3 > len) { continue; } - FX_DWORD dwHash = str[cc++]; + uint32_t dwHash = str[cc++]; dwHash = (dwHash << 8) | str[cc++]; dwHash = (dwHash << 8) | str[cc++]; if (dwHash == FXBSTR_ID(0, 'G', 'M', 'T')) { @@ -2683,7 +2683,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const FX_LOCALETIMEZONEINFO* pTimeZoneInfo = std::lower_bound(g_FXLocaleTimeZoneData, pEnd, dwHash, [](const FX_LOCALETIMEZONEINFO& info, - FX_DWORD hash) { return info.uHash < hash; }); + uint32_t hash) { return info.uHash < hash; }); if (pTimeZoneInfo < pEnd && dwHash == pTimeZoneInfo->uHash) { hour += pTimeZoneInfo->iHour; minute += pTimeZoneInfo->iHour > 0 ? pTimeZoneInfo->iMinute @@ -2909,7 +2909,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum, return FALSE; } int32_t dot_index_f = -1; - FX_DWORD dwNumStyle = 0; + uint32_t dwNumStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat); @@ -3342,7 +3342,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput) { int32_t dot_index_f = -1; - FX_DWORD dwNumStyle = 0; + uint32_t dwNumStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat); @@ -3986,8 +3986,8 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsResult += strf[ccf++]; continue; } - FX_DWORD dwSymbolNum = 1; - FX_DWORD dwSymbol = strf[ccf++]; + uint32_t dwSymbolNum = 1; + uint32_t dwSymbol = strf[ccf++]; while (ccf < lenf && strf[ccf] == dwSymbol) { ccf++; dwSymbolNum++; @@ -4112,8 +4112,8 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, wsResult += strf[ccf++]; continue; } - FX_DWORD dwSymbolNum = 1; - FX_DWORD dwSymbol = strf[ccf++]; + uint32_t dwSymbolNum = 1; + uint32_t dwSymbol = strf[ccf++]; while (ccf < lenf && strf[ccf] == dwSymbol) { ccf++; dwSymbolNum++; diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp index ba617a0f3f..69b8638903 100644 --- a/xfa/fgas/localization/fgas_localemgr.cpp +++ b/xfa/fgas/localization/fgas_localemgr.cpp @@ -39,7 +39,7 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, if (bssp == "http://www.foxitsoftware.com/localization") { CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid"); wchar_t* pEnd = NULL; - FX_DWORD dwLCID = wcstol(wsLCID, &pEnd, 16); + uint32_t dwLCID = wcstol(wsLCID, &pEnd, 16); if (pLocaleMgr->m_lcid2xml.GetValueAt((void*)(uintptr_t)dwLCID)) { delete pXmlLocale; } else { diff --git a/xfa/fgas/xml/fgas_sax_imp.cpp b/xfa/fgas/xml/fgas_sax_imp.cpp index f45d7645ac..ea3dafff59 100644 --- a/xfa/fgas/xml/fgas_sax_imp.cpp +++ b/xfa/fgas/xml/fgas_sax_imp.cpp @@ -10,7 +10,7 @@ namespace { -const FX_DWORD kSaxFileBufSize = 32768; +const uint32_t kSaxFileBufSize = 32768; } // namespace @@ -26,10 +26,10 @@ CFX_SAXFile::CFX_SAXFile() m_dwBufSize(0), m_dwBufIndex(0) {} FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, - FX_DWORD dwStart, - FX_DWORD dwLen) { + uint32_t dwStart, + uint32_t dwLen) { FXSYS_assert(m_pFile == NULL && pFile != NULL); - FX_DWORD dwSize = pFile->GetSize(); + uint32_t dwSize = pFile->GetSize(); if (dwStart >= dwSize) { return FALSE; } @@ -53,7 +53,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, } FX_BOOL CFX_SAXFile::ReadNextBlock() { FXSYS_assert(m_pFile != NULL); - FX_DWORD dwSize = m_dwEnd - m_dwCur; + uint32_t dwSize = m_dwEnd - m_dwCur; if (dwSize == 0) { return FALSE; } @@ -169,9 +169,9 @@ inline FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch) { return (m_dwParseMode & FX_SAXPARSEMODE_NotSkipSpace) == 0 && ch < 0x21; } int32_t CFX_SAXReader::StartParse(IFX_FileRead* pFile, - FX_DWORD dwStart, - FX_DWORD dwLen, - FX_DWORD dwParseMode) { + uint32_t dwStart, + uint32_t dwLen, + uint32_t dwParseMode) { m_iState = -1; Reset(); if (!m_File.StartFile(pFile, dwStart, dwLen)) { @@ -209,8 +209,8 @@ int32_t CFX_SAXReader::ContinueParse(IFX_Pause* pPause) { return m_iState; } while (m_File.m_dwCur < m_File.m_dwEnd) { - FX_DWORD& index = m_File.m_dwBufIndex; - FX_DWORD size = m_File.m_dwBufSize; + uint32_t& index = m_File.m_dwBufIndex; + uint32_t size = m_File.m_dwBufSize; const uint8_t* pBuf = m_File.m_pBuf; while (index < size) { m_CurByte = pBuf[index]; -- cgit v1.2.3