diff options
Diffstat (limited to 'xfa/fgas')
23 files changed, 195 insertions, 194 deletions
diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp index e717873abe..dcf3dfa690 100644 --- a/xfa/fgas/crt/fgas_codepage.cpp +++ b/xfa/fgas/crt/fgas_codepage.cpp @@ -17,7 +17,7 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { {186, 1257}, {204, 1251}, {222, 874}, {238, 1250}, {254, 437}, {255, 850}, }; -FX_WORD FX_GetCodePageFromCharset(uint8_t charset) { +uint16_t FX_GetCodePageFromCharset(uint8_t charset) { int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -43,7 +43,7 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { {84, 10004}, {85, 10006}, {86, 10081}, {87, 10021}, {88, 10029}, {89, 10007}, }; -FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage) { +uint16_t FX_GetCharsetFromCodePage(uint16_t codepage) { int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -197,7 +197,7 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { {FX_LANG_Spanish_Nicaragua, FX_CODEPAGE_MSWin_WesternEuropean}, {FX_LANG_Spanish_PuertoRico, FX_CODEPAGE_MSWin_WesternEuropean}, }; -FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage) { +uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage) { int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -301,7 +301,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { {0xf3d463c2, 0x3a4}, {0xf52a70a3, 0xc42e}, {0xf5693147, 0x6fb3}, {0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5}, }; -FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { +uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { FXSYS_assert(pStr != NULL); if (iLength < 0) { iLength = FXSYS_strlen(pStr); @@ -317,7 +317,7 @@ FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { iMid = (iStart + iEnd) / 2; const FX_STR2CPHASH& cp = g_FXCPHashTable[iMid]; if (uHash == cp.uHash) { - return (FX_WORD)cp.uCodePage; + return (uint16_t)cp.uCodePage; } else if (uHash < cp.uHash) { iEnd = iMid - 1; } else { @@ -326,7 +326,7 @@ FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { } while (iStart <= iEnd); return 0xFFFF; } -FX_WORD FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) { +uint16_t FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } diff --git a/xfa/fgas/crt/fgas_codepage.h b/xfa/fgas/crt/fgas_codepage.h index ec01816386..fe69f7ce93 100644 --- a/xfa/fgas/crt/fgas_codepage.h +++ b/xfa/fgas/crt/fgas_codepage.h @@ -133,24 +133,24 @@ #define FX_CHARSET_US 254 #define FX_CHARSET_OEM 255 -FX_WORD FX_GetCodePageFromCharset(uint8_t charset); -FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage); -FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength); -FX_WORD FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength); -FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage); +uint16_t FX_GetCodePageFromCharset(uint8_t charset); +uint16_t FX_GetCharsetFromCodePage(uint16_t codepage); +uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength); +uint16_t FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength); +uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage); void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength); void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, FX_WCHAR* pDst, int32_t iLength); void FX_UTF16ToWChar(void* pBuffer, int32_t iLength); -void FX_UTF16ToWCharCopy(const FX_WORD* pUTF16, +void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, FX_WCHAR* pWChar, int32_t iLength); void FX_WCharToUTF16(void* pBuffer, int32_t iLength); void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, - FX_WORD* pUTF16, + uint16_t* pUTF16, int32_t iLength); -int32_t FX_DecodeString(FX_WORD wCodePage, +int32_t FX_DecodeString(uint16_t wCodePage, const FX_CHAR* pSrc, int32_t* pSrcLen, FX_WCHAR* pDst, diff --git a/xfa/fgas/crt/fgas_encode.cpp b/xfa/fgas/crt/fgas_encode.cpp index 138b4b1f5e..7d04e58131 100644 --- a/xfa/fgas/crt/fgas_encode.cpp +++ b/xfa/fgas/crt/fgas_encode.cpp @@ -11,17 +11,17 @@ void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } - FX_WORD wch; + uint16_t wch; if (sizeof(FX_WCHAR) > 2) { while (iLength-- > 0) { - wch = (FX_WORD)*pStr; + wch = (uint16_t)*pStr; wch = (wch >> 8) | (wch << 8); wch &= 0x00FF; *pStr++ = wch; } } else { while (iLength-- > 0) { - wch = (FX_WORD)*pStr; + wch = (uint16_t)*pStr; wch = (wch >> 8) | (wch << 8); *pStr++ = wch; } @@ -34,17 +34,17 @@ void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, if (iLength < 0) { iLength = FXSYS_wcslen(pSrc); } - FX_WORD wch; + uint16_t wch; if (sizeof(FX_WCHAR) > 2) { while (iLength-- > 0) { - wch = (FX_WORD)*pSrc++; + wch = (uint16_t)*pSrc++; wch = (wch >> 8) | (wch << 8); wch &= 0x00FF; *pDst++ = wch; } } else { while (iLength-- > 0) { - wch = (FX_WORD)*pSrc++; + wch = (uint16_t)*pSrc++; wch = (wch >> 8) | (wch << 8); *pDst++ = wch; } @@ -55,13 +55,13 @@ void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) { if (sizeof(FX_WCHAR) == 2) { return; } - FX_WORD* pSrc = (FX_WORD*)pBuffer; + uint16_t* pSrc = (uint16_t*)pBuffer; FX_WCHAR* pDst = (FX_WCHAR*)pBuffer; while (--iLength >= 0) { pDst[iLength] = (FX_WCHAR)pSrc[iLength]; } } -void FX_UTF16ToWCharCopy(const FX_WORD* pUTF16, +void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, FX_WCHAR* pWChar, int32_t iLength) { FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0); @@ -79,30 +79,30 @@ void FX_WCharToUTF16(void* pBuffer, int32_t iLength) { return; } const FX_WCHAR* pSrc = (const FX_WCHAR*)pBuffer; - FX_WORD* pDst = (FX_WORD*)pBuffer; + uint16_t* pDst = (uint16_t*)pBuffer; while (--iLength >= 0) { - *pDst++ = (FX_WORD)*pSrc++; + *pDst++ = (uint16_t)*pSrc++; } } void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, - FX_WORD* pUTF16, + uint16_t* pUTF16, int32_t iLength) { FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { FXSYS_memcpy(pUTF16, pWChar, iLength * sizeof(FX_WCHAR)); } else { while (--iLength >= 0) { - *pUTF16++ = (FX_WORD)*pWChar++; + *pUTF16++ = (uint16_t)*pWChar++; } } } inline FX_DWORD FX_DWordFromBytes(const uint8_t* pStr) { return FXBSTR_ID(pStr[3], pStr[2], pStr[1], pStr[0]); } -inline FX_WORD FX_WordFromBytes(const uint8_t* pStr) { +inline uint16_t FX_WordFromBytes(const uint8_t* pStr) { return (pStr[1] << 8 | pStr[0]); } -int32_t FX_DecodeString(FX_WORD wCodePage, +int32_t FX_DecodeString(uint16_t wCodePage, const FX_CHAR* pSrc, int32_t* pSrcLen, FX_WCHAR* pDst, diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp index 6f082dd5f1..4dc3737d75 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/fgas_stream.cpp @@ -201,8 +201,8 @@ class CFX_Stream : public IFX_Stream { virtual void Flush(); 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 uint16_t GetCodePage() const; + virtual uint16_t SetCodePage(uint16_t wCodePage); virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); @@ -242,15 +242,15 @@ class CFX_TextStream : public IFX_Stream { 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 uint16_t GetCodePage() const; + virtual uint16_t SetCodePage(uint16_t wCodePage); virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); protected: - FX_WORD m_wCodePage; + uint16_t m_wCodePage; int32_t m_wBOMLength; FX_DWORD m_dwBOM; uint8_t* m_pBuf; @@ -1015,7 +1015,7 @@ void CFX_TextStream::Flush() { FX_BOOL CFX_TextStream::SetLength(int32_t iLength) { return m_pStreamImp->SetLength(iLength); } -FX_WORD CFX_TextStream::GetCodePage() const { +uint16_t CFX_TextStream::GetCodePage() const { return m_wCodePage; } IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, @@ -1038,11 +1038,11 @@ int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const { *(FX_DWORD*)bom = m_dwBOM; return m_wBOMLength; } -FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) { +uint16_t CFX_TextStream::SetCodePage(uint16_t wCodePage) { if (m_wBOMLength > 0) { return m_wCodePage; } - FX_WORD v = m_wCodePage; + uint16_t v = m_wCodePage; m_wCodePage = wCodePage; return v; } @@ -1421,14 +1421,14 @@ int32_t CFX_Stream::GetBOM(uint8_t bom[4]) const { } return 0; } -FX_WORD CFX_Stream::GetCodePage() const { +uint16_t CFX_Stream::GetCodePage() const { #if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_ return FX_CODEPAGE_UTF16LE; #else return FX_CODEPAGE_UTF16BE; #endif } -FX_WORD CFX_Stream::SetCodePage(FX_WORD wCodePage) { +uint16_t CFX_Stream::SetCodePage(uint16_t wCodePage) { #if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_ return FX_CODEPAGE_UTF16LE; #else diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h index e083886ec7..94b7f01ed6 100644 --- a/xfa/fgas/crt/fgas_stream.h +++ b/xfa/fgas/crt/fgas_stream.h @@ -68,8 +68,8 @@ class IFX_Stream { virtual void Flush() = 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 uint16_t GetCodePage() const = 0; + virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) = 0; diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index f03e3983fa..1138cfd7c9 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -85,7 +85,7 @@ class CFX_BaseArrayTemplate : public CFX_BaseArray { }; typedef CFX_BaseArrayTemplate<void*> CFDE_PtrArray; typedef CFX_BaseArrayTemplate<FX_DWORD> CFDE_DWordArray; -typedef CFX_BaseArrayTemplate<FX_WORD> CFDE_WordArray; +typedef CFX_BaseArrayTemplate<uint16_t> CFDE_WordArray; template <class baseType> class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { @@ -282,7 +282,7 @@ class CFX_MassArrayTemplate : public CFX_BaseMassArray { typedef CFX_MassArrayTemplate<void*> CFX_PtrMassArray; typedef CFX_MassArrayTemplate<int32_t> CFX_Int32MassArray; typedef CFX_MassArrayTemplate<FX_DWORD> CFX_DWordMassArray; -typedef CFX_MassArrayTemplate<FX_WORD> CFX_WordMassArray; +typedef CFX_MassArrayTemplate<uint16_t> CFX_WordMassArray; typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray; typedef CFX_MassArrayTemplate<CFX_RectF> CFX_RectFMassArray; @@ -397,7 +397,7 @@ class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray { }; typedef CFX_DiscreteArrayTemplate<void*> CFX_PtrDiscreteArray; typedef CFX_DiscreteArrayTemplate<FX_DWORD> CFX_DWordDiscreteArray; -typedef CFX_DiscreteArrayTemplate<FX_WORD> CFX_WordDiscreteArray; +typedef CFX_DiscreteArrayTemplate<uint16_t> CFX_WordDiscreteArray; class CFX_BaseStack : public CFX_Target { protected: @@ -436,7 +436,7 @@ class CFX_StackTemplate : public CFX_BaseStack { }; typedef CFX_StackTemplate<void*> CFX_PtrStack; typedef CFX_StackTemplate<FX_DWORD> CFX_DWordStack; -typedef CFX_StackTemplate<FX_WORD> CFX_WordStack; +typedef CFX_StackTemplate<uint16_t> CFX_WordStack; typedef CFX_StackTemplate<int32_t> CFX_Int32Stack; template <class baseType> diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h index 5c362122ba..b13602cee6 100644 --- a/xfa/fgas/font/fgas_font.h +++ b/xfa/fgas/font/fgas_font.h @@ -61,7 +61,7 @@ class IFX_Font { public: static IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage, + uint16_t wCodePage, IFX_FontMgr* pFontMgr); static IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength, @@ -76,7 +76,7 @@ class IFX_Font { virtual ~IFX_Font() {} virtual void Release() = 0; virtual IFX_Font* Retain() = 0; - virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0) = 0; + virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0) = 0; virtual void GetFamilyName(CFX_WideString& wsFamily) const = 0; virtual void GetPsName(CFX_WideString& wsName) const = 0; virtual FX_DWORD GetFontStyles() const = 0; @@ -108,7 +108,7 @@ struct FX_FONTMATCHPARAMS { FX_DWORD dwUSB; FX_DWORD dwMatchFlags; FX_WCHAR wUnicode; - FX_WORD wCodePage; + uint16_t wCodePage; }; typedef FX_FONTMATCHPARAMS* FX_LPFONTMATCHPARAMS; typedef FX_FONTMATCHPARAMS const* FX_LPCFONTMATCHPARAMS; @@ -161,7 +161,7 @@ class IFX_FontMgr { virtual ~IFX_FontMgr() {} virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -173,22 +173,22 @@ class IFX_FontMgr { FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength) = 0; virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName) = 0; virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, - FX_WORD wCodePage = 0, + uint16_t wCodePage = 0, FX_BOOL bSaveStream = FALSE) = 0; virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; virtual void ClearFontCache() = 0; virtual void RemoveFont(IFX_Font* pFont) = 0; }; @@ -198,7 +198,7 @@ class IFX_FontMgrDelegate { virtual ~IFX_FontMgrDelegate() {} virtual IFX_Font* GetDefFontByCodePage( IFX_FontMgr* pFontMgr, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -213,7 +213,7 @@ class IFX_FontMgrDelegate { const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( IFX_FontMgr* pFontMgr, - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; }; @@ -233,7 +233,7 @@ class IFX_FontMgr { virtual ~IFX_FontMgr() {} virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -245,15 +245,15 @@ class IFX_FontMgr { FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; - virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; inline IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); } virtual IFX_Font* GetFontByCharset(uint8_t nCharset, @@ -262,7 +262,7 @@ class IFX_FontMgr { virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; - virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* LoadFont(const uint8_t* pBuffer, diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index 51bba0123e..e115e0f42d 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -9,7 +9,7 @@ #include "core/include/fxcrt/fx_ext.h" #include "xfa/fgas/font/fgas_font.h" -FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) { +FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles) { FX_DWORD dwHash = wCodePage; if (dwFontStyles & FX_FONTSTYLE_FixedPitch) { dwHash |= 0x00010000; @@ -33,7 +33,7 @@ FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) { } FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { CFX_WideString wsFont(pszFontFamily); if (dwFontStyles & FX_FONTSTYLE_Bold) { wsFont += L"Bold"; diff --git a/xfa/fgas/font/fgas_fontutils.h b/xfa/fgas/font/fgas_fontutils.h index ab567aee6b..d5608063ca 100644 --- a/xfa/fgas/font/fgas_fontutils.h +++ b/xfa/fgas/font/fgas_fontutils.h @@ -16,10 +16,10 @@ struct FGAS_FONTUSB { uint16_t wCodePage; }; -FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles); +FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles); FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode); #endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_ diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index 831da7e7d6..75ed0b2a1f 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -11,7 +11,7 @@ IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage, + uint16_t wCodePage, IFX_FontMgr* pFontMgr) { #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (NULL != pFontMgr) { @@ -189,7 +189,7 @@ IFX_Font* CFX_GEFont::Retain() { } FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { if (m_pFont) { return FALSE; } @@ -221,7 +221,7 @@ FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, } int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; - FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage); + uint16_t wCharSet = FX_GetCharsetFromCodePage(wCodePage); if (wCharSet == 0xFFFF) { wCharSet = FXSYS_GetACP(); } @@ -329,7 +329,7 @@ FX_BOOL CFX_GEFont::InitFont() { } return TRUE; } -IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage) { +IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, uint16_t wCodePage) { if (GetFontStyles() == dwFontStyles) { return Retain(); } @@ -489,7 +489,7 @@ int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, if (pFontUSB == NULL) { return 0xFFFF; } - FX_WORD wBitField = pFontUSB->wBitField; + uint16_t wBitField = pFontUSB->wBitField; if (wBitField >= 128) { return 0xFFFF; } diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h index 034220ef64..03bc32ce63 100644 --- a/xfa/fgas/font/fgas_gefont.h +++ b/xfa/fgas/font/fgas_gefont.h @@ -21,12 +21,12 @@ class CFX_GEFont : public IFX_Font { virtual IFX_Font* Retain(); FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t length); FX_BOOL LoadFont(const FX_WCHAR* pszFileName); FX_BOOL LoadFont(IFX_Stream* pFontStream, FX_BOOL bSaveStream); FX_BOOL LoadFont(CFX_Font* pExtFont, FX_BOOL bTakeOver = FALSE); - virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0); + virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0); virtual void GetFamilyName(CFX_WideString& wsFamily) const; virtual void GetPsName(CFX_WideString& wsName) const; virtual FX_DWORD GetFontStyles() const; @@ -71,7 +71,7 @@ class CFX_GEFont : public IFX_Font { CFX_RectMassArray* m_pRectArray; CFX_MapPtrToPtr* m_pBBoxMap; IFX_FontProvider* m_pProvider; - FX_WORD m_wCharSet; + uint16_t m_wCharSet; CFX_PtrArray m_SubstFonts; CFX_MapPtrToPtr m_FontMapper; FX_BOOL InitFont(); diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index ffe520dc87..331ea86582 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -57,7 +57,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() { m_Fonts.RemoveAll(); } IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); @@ -115,7 +115,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( if (!pFD) return nullptr; - FX_WORD wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet); + uint16_t wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet); const FX_WCHAR* pFontFace = pFD->wsFontFace; pFont = IFX_Font::LoadFont(pFontFace, dwFontStyles, wCodePage, this); if (pFont) { @@ -131,7 +131,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( } IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetDefFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), @@ -139,7 +139,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage( } IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage); IFX_Font* pFont = NULL; @@ -203,7 +203,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, - FX_WORD wCodePage, + uint16_t wCodePage, FX_BOOL bSaveStream) { FXSYS_assert(pFontStream != NULL && pFontStream->GetLength() > 0); IFX_Font* pFont = NULL; @@ -232,7 +232,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, } IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { FXSYS_assert(pSrcFont != NULL); if (pSrcFont->GetFontStyles() == dwFontStyles) { return pSrcFont->Retain(); @@ -299,7 +299,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font* pFont) { FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, FX_DWORD dwMatchFlags, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwUSB, FX_WCHAR wUnicode) { if (m_pMatcher == NULL) { @@ -688,7 +688,7 @@ void CFX_FontMgrImp::Release() { } delete this; } -IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, +IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage( @@ -709,14 +709,14 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, : m_pDelegate->GetDefFontByUnicode( this, wUnicode, dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(FX_WORD wLanguage, +IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByLanguage( this, wLanguage, dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::GetFontByCodePage(FX_WORD wCodePage, +IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { CFX_ByteString bsHash; @@ -770,8 +770,8 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode, if (m_FailedUnicodes2NULL.Lookup(wUnicode, pFont)) return nullptr; const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wUnicode); - FX_WORD wCodePage = x ? x->wCodePage : 0xFFFF; - FX_WORD wBitField = x ? x->wBitField : 0x03E7; + uint16_t wCodePage = x ? x->wCodePage : 0xFFFF; + uint16_t wBitField = x ? x->wBitField : 0x03E7; CFX_ByteString bsHash; if (wCodePage == 0xFFFF) bsHash.Format("%d, %d, %d", wCodePage, wBitField, dwFontStyles); @@ -851,7 +851,7 @@ FX_BOOL CFX_FontMgrImp::VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode) { } return TRUE; } -IFX_Font* CFX_FontMgrImp::GetFontByLanguage(FX_WORD wLanguage, +IFX_Font* CFX_FontMgrImp::GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, @@ -1072,7 +1072,7 @@ IFX_FileRead* CFX_FontMgrImp::CreateFontStream( return nullptr; } int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { @@ -1104,8 +1104,8 @@ int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, return MatchedFonts.GetSize(); } struct FX_BitCodePage { - FX_WORD wBit; - FX_WORD wCodePage; + uint16_t wBit; + uint16_t wCodePage; }; static const FX_BitCodePage g_Bit2CodePage[] = { {0, 1252}, {1, 1250}, {2, 1251}, {3, 1253}, {4, 1254}, {5, 1255}, @@ -1121,21 +1121,21 @@ static const FX_BitCodePage g_Bit2CodePage[] = { {60, 737}, {61, 708}, {62, 850}, {63, 437}, }; -FX_WORD FX_GetCodePageBit(FX_WORD wCodePage) { +uint16_t FX_GetCodePageBit(uint16_t wCodePage) { for (size_t i = 0; i < FX_ArraySize(g_Bit2CodePage); ++i) { if (g_Bit2CodePage[i].wCodePage == wCodePage) return g_Bit2CodePage[i].wBit; } - return (FX_WORD)-1; + return (uint16_t)-1; } -FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) { +uint16_t FX_GetUnicodeBit(FX_WCHAR wcUnicode) { const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wcUnicode); return x ? x->wBitField : 999; } int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { @@ -1192,10 +1192,10 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, if (nPenalty >= 0xFFFF) { return 0xFFFF; } - FX_WORD wBit = - ((0 == wCodePage || 0xFFFF == wCodePage) ? (FX_WORD)-1 + uint16_t wBit = + ((0 == wCodePage || 0xFFFF == wCodePage) ? (uint16_t)-1 : FX_GetCodePageBit(wCodePage)); - if (wBit != (FX_WORD)-1) { + if (wBit != (uint16_t)-1) { FXSYS_assert(wBit < 64); if (0 == (pInstalled->m_dwCsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; @@ -1204,9 +1204,9 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, } } wBit = - ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (FX_WORD)999 + ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (uint16_t)999 : FX_GetUnicodeBit(wcUnicode)); - if (wBit != (FX_WORD)999) { + if (wBit != (uint16_t)999) { FXSYS_assert(wBit < 128); if (0 == (pInstalled->m_dwUsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; @@ -1290,7 +1290,7 @@ void CFX_FontMgrImp::RegisterFace(FXFT_Face pFace, pFont->m_dwFontStyles |= FXFT_Is_Face_Bold(pFace) ? FX_FONTSTYLE_Bold : 0; pFont->m_dwFontStyles |= FXFT_Is_Face_Italic(pFace) ? FX_FONTSTYLE_Italic : 0; pFont->m_dwFontStyles |= GetFlags(pFace); - CFX_WordArray Charsets; + CFX_ArrayTemplate<uint16_t> Charsets; GetCharsets(pFace, Charsets); GetUSBCSB(pFace, pFont->m_dwUsb, pFont->m_dwCsb); unsigned long nLength = 0; @@ -1404,8 +1404,8 @@ void CFX_FontMgrImp::GetNames(const uint8_t* name_table, #undef GetUInt16 #undef GetUInt32 struct FX_BIT2CHARSET { - FX_WORD wBit; - FX_WORD wCharset; + uint16_t wBit; + uint16_t wCharset; }; FX_BIT2CHARSET g_FX_Bit2Charset1[16] = { {1 << 0, FX_CHARSET_ANSI}, @@ -1469,11 +1469,12 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = { Charsets.Add(g_FX_Bit2Charset##n[i].wCharset); \ } \ } -void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets) { +void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, + CFX_ArrayTemplate<uint16_t>& Charsets) { Charsets.RemoveAll(); TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2); if (NULL != pOS2) { - FX_WORD a1, a2, a3, a4; + uint16_t a1, a2, a3, a4; a1 = pOS2->ulCodePageRange1 & 0x0000ffff; CODEPAGERANGE_IMPLEMENT(1); a2 = (pOS2->ulCodePageRange1 >> 16) & 0x0000ffff; diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h index e646c28917..e548cf5d2b 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.h +++ b/xfa/fgas/font/fgas_stdfontmgr.h @@ -26,7 +26,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { void* pUserData); ~CFX_StdFontMgrImp(); virtual void Release() { delete this; } - virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, @@ -35,22 +35,22 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + uint16_t wCodePage = 0xFFFF); virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength); virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName); virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, - FX_WORD wCodePage = 0, + uint16_t wCodePage = 0, FX_BOOL bSaveStream = FALSE); virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + uint16_t wCodePage = 0xFFFF); virtual void ClearFontCache(); virtual void RemoveFont(IFX_Font* pFont); @@ -71,7 +71,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { FX_LPCFONTDESCRIPTOR FindFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, FX_DWORD dwMatchFlags, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwUSB = 999, FX_WCHAR wUnicode = 0); IFX_Font* GetFont(FX_LPCFONTDESCRIPTOR pFD, FX_DWORD dwFontStyles); @@ -159,7 +159,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { IFX_FontMgrDelegate* pDelegate = NULL, void* pUserData = NULL); virtual void Release(); - virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, @@ -168,10 +168,10 @@ class CFX_FontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetFontByCharset(uint8_t nCharset, @@ -180,7 +180,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* LoadFont(const uint8_t* pBuffer, @@ -211,7 +211,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { void RegisterFaces(IFX_FileRead* pFontStream, const CFX_WideString* pFaceName); void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names); - void GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets); + void GetCharsets(FXFT_Face pFace, CFX_ArrayTemplate<uint16_t>& Charsets); void GetUSBCSB(FXFT_Face pFace, FX_DWORD* USB, FX_DWORD* CSB); FX_DWORD GetFlags(FXFT_Face pFace); CFX_FontDescriptors m_InstalledFonts; @@ -219,12 +219,12 @@ class CFX_FontMgrImp : public IFX_FontMgr { FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode); int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); diff --git a/xfa/fgas/layout/fgas_linebreak.cpp b/xfa/fgas/layout/fgas_linebreak.cpp index 8155af870a..4e5b405f5a 100644 --- a/xfa/fgas/layout/fgas_linebreak.cpp +++ b/xfa/fgas/layout/fgas_linebreak.cpp @@ -276,11 +276,11 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, FX_DWORD dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; iLength--; for (int32_t i = 0; i < iLength; i++) { wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; if (dwNext == FX_CBP_SP) { pBrkType[i] = FX_LBT_PROHIBITED_BRK; } else { @@ -301,11 +301,11 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, FX_DWORD dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; iLength--; for (int32_t i = 0; i < iLength; i++) { wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; if (dwNext == FX_CBP_SP) { eType = FX_LBT_PROHIBITED_BRK; } else { diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp index f57a1335fb..dd150a3002 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.cpp +++ b/xfa/fgas/layout/fgas_rtfbreak.cpp @@ -515,7 +515,7 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { if (m_bCharCode) { return AppendChar_CharCode(wch); } - FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch]; + FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; CFX_RTFChar* pCurChar = tca.AddSpace(); diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 0cc41980cb..f182a6d413 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -732,10 +732,10 @@ static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = { &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others, }; FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) { - FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch]; + FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_TxtChar* pCurChar = m_pCurLine->m_pLineChars->AddSpace(); - pCurChar->m_wCharCode = (FX_WORD)wch; + pCurChar->m_wCharCode = (uint16_t)wch; pCurChar->m_nRotation = m_iCharRotation; pCurChar->m_dwCharProps = dwProps; pCurChar->m_dwCharStyles = 0; @@ -1324,8 +1324,8 @@ void CFX_TxtBreak::Reset() { } struct FX_FORMCHAR { - FX_WORD wch; - FX_WORD wForm; + uint16_t wch; + uint16_t wForm; int32_t iWidth; }; diff --git a/xfa/fgas/localization/fgas_datetime.cpp b/xfa/fgas/localization/fgas_datetime.cpp index 34b8210fc3..ac5ee4a01d 100644 --- a/xfa/fgas/localization/fgas_datetime.cpp +++ b/xfa/fgas/localization/fgas_datetime.cpp @@ -124,14 +124,14 @@ static void FX_DaysToDate(int64_t iDays, } struct FXUT_SYSTEMTIME { - FX_WORD wYear; - FX_WORD wMonth; - FX_WORD wDayOfWeek; - FX_WORD wDay; - FX_WORD wHour; - FX_WORD wMinute; - FX_WORD wSecond; - FX_WORD wMilliseconds; + uint16_t wYear; + uint16_t wMonth; + uint16_t wDayOfWeek; + uint16_t wDay; + uint16_t wHour; + uint16_t wMinute; + uint16_t wSecond; + uint16_t wMilliseconds; }; void CFX_Unitime::Now() { @@ -160,7 +160,7 @@ void CFX_Unitime::Now() { #endif 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); + (uint8_t)utLocal.wSecond, (uint16_t)utLocal.wMilliseconds); } void CFX_Unitime::SetGMTime() { FXUT_SYSTEMTIME utLocal; @@ -188,7 +188,7 @@ void CFX_Unitime::SetGMTime() { #endif 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); + (uint8_t)utLocal.wSecond, (uint16_t)utLocal.wMilliseconds); } void CFX_Unitime::Set(int32_t year, uint8_t month, @@ -196,7 +196,7 @@ void CFX_Unitime::Set(int32_t year, uint8_t hour, uint8_t minute, uint8_t second, - FX_WORD millisecond) { + uint16_t millisecond) { FXSYS_assert(hour <= 23); FXSYS_assert(minute <= 59); FXSYS_assert(second <= 59); @@ -238,7 +238,7 @@ FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const { } return (FX_WEEKDAY)v; } -FX_WORD CFX_Unitime::GetDayOfYear() const { +uint16_t CFX_Unitime::GetDayOfYear() const { int32_t iYear; uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); @@ -274,12 +274,12 @@ uint8_t CFX_Unitime::GetSecond() const { } return (uint8_t)(v / g_FXMillisecondsPerSecond); } -FX_WORD CFX_Unitime::GetMillisecond() const { +uint16_t CFX_Unitime::GetMillisecond() const { int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerSecond); if (v < 0) { v += g_FXMillisecondsPerSecond; } - return (FX_WORD)v; + return (uint16_t)v; } FX_BOOL CFX_Unitime::AddYears(int32_t iYears) { FX_UNITIME ut = m_iUnitime; @@ -350,7 +350,7 @@ FX_BOOL CFX_DateTime::Set(int32_t year, uint8_t hour, uint8_t minute, uint8_t second, - FX_WORD millisecond) { + uint16_t millisecond) { ASSERT(year != 0); ASSERT(month >= 1 && month <= 12); ASSERT(day >= 1 && day <= FX_DaysInMonth(year, month)); @@ -407,7 +407,7 @@ FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const { } return (FX_WEEKDAY)v; } -FX_WORD CFX_DateTime::GetDayOfYear() const { +uint16_t CFX_DateTime::GetDayOfYear() const { return FX_DaysBeforeMonthInYear(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month) + m_DateTime.Date.sDate.day; @@ -425,7 +425,7 @@ uint8_t CFX_DateTime::GetMinute() const { uint8_t CFX_DateTime::GetSecond() const { return m_DateTime.Time.sTime.second; } -FX_WORD CFX_DateTime::GetMillisecond() const { +uint16_t CFX_DateTime::GetMillisecond() const { return m_DateTime.Time.sTime.millisecond; } FX_BOOL CFX_DateTime::AddYears(int32_t iYears) { @@ -542,7 +542,7 @@ FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) { if (iMilliseconds < 0) { iSeconds--, iMilliseconds += g_FXMillisecondsPerSecond; } - m_DateTime.Time.sTime.millisecond = (FX_WORD)iMilliseconds; + m_DateTime.Time.sTime.millisecond = (uint16_t)iMilliseconds; if (iSeconds != 0) { AddSeconds(iSeconds); } diff --git a/xfa/fgas/localization/fgas_datetime.h b/xfa/fgas/localization/fgas_datetime.h index 4aa5093006..0a3d14d240 100644 --- a/xfa/fgas/localization/fgas_datetime.h +++ b/xfa/fgas/localization/fgas_datetime.h @@ -68,18 +68,18 @@ class CFX_Unitime { uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, - FX_WORD millisecond = 0); + uint16_t millisecond = 0); void Set(FX_UNITIME t); int32_t GetYear() const; uint8_t GetMonth() const; uint8_t GetDay() const; FX_WEEKDAY GetDayOfWeek() const; - FX_WORD GetDayOfYear() const; + uint16_t GetDayOfYear() const; int64_t GetDayOfAD() const; uint8_t GetHour() const; uint8_t GetMinute() const; uint8_t GetSecond() const; - FX_WORD GetMillisecond() const; + uint16_t GetMillisecond() const; FX_BOOL AddYears(int32_t iYears); FX_BOOL AddMonths(int32_t iMonths); FX_BOOL AddDays(int32_t iDays); @@ -177,7 +177,7 @@ struct FX_TIME { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; }; struct FX_TIMEZONE { @@ -199,7 +199,7 @@ struct FX_DATETIME { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; } sTime; FX_TIME aTime; } Time; @@ -221,7 +221,7 @@ struct FX_DATETIMEZONE { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; }; FX_TIME time; }; @@ -280,19 +280,19 @@ class CFX_DateTime { uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, - FX_WORD millisecond = 0); + uint16_t millisecond = 0); virtual FX_BOOL FromUnitime(FX_UNITIME t); virtual FX_UNITIME ToUnitime() 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 uint16_t GetDayOfYear() 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 uint16_t GetMillisecond() const; virtual FX_BOOL AddYears(int32_t iYears); virtual FX_BOOL AddMonths(int32_t iMonths); virtual FX_BOOL AddDays(int32_t iDays); diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 6af9205d30..db94f766b5 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -629,14 +629,14 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory( } return eCategory; } -static FX_WORD FX_WStringToLCID(const FX_WCHAR* pstrLCID) { +static uint16_t FX_WStringToLCID(const FX_WCHAR* pstrLCID) { if (!pstrLCID) { return 0; } wchar_t* pEnd; - return (FX_WORD)wcstol((wchar_t*)pstrLCID, &pEnd, 16); + return (uint16_t)wcstol((wchar_t*)pstrLCID, &pEnd, 16); } -FX_WORD CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) { +uint16_t CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) { return FX_WStringToLCID(GetLocaleName(wsPattern)); } CFX_WideString CFX_FormatString::GetLocaleName( @@ -2386,7 +2386,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, } } else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '3')) { CFX_WideString wsMonthNameAbbr; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 12; i++) { pLocale->GetMonthName(i, wsMonthNameAbbr, TRUE); if (wsMonthNameAbbr.IsEmpty()) { @@ -2403,7 +2403,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, } } else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '4')) { CFX_WideString wsMonthName; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 12; i++) { pLocale->GetMonthName(i, wsMonthName, FALSE); if (wsMonthName.IsEmpty()) { @@ -2422,7 +2422,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, cc += 1; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '3')) { CFX_WideString wsDayNameAbbr; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 7; i++) { pLocale->GetDayName(i, wsDayNameAbbr, TRUE); if (wsDayNameAbbr.IsEmpty()) { @@ -2529,7 +2529,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, uint8_t hour = 0; uint8_t minute = 0; uint8_t second = 0; - FX_WORD millisecond = 0; + uint16_t millisecond = 0; int32_t ccf = 0; const FX_WCHAR* str = (const FX_WCHAR*)wsTime; int len = wsTime.GetLength(); @@ -3768,7 +3768,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, int32_t year = 1900; int32_t month = 1; int32_t day = 1; - FX_WORD wYear = 0; + uint16_t wYear = 0; int cc_start = 0, cc = 0; const FX_WCHAR* str = (const FX_WCHAR*)wsDate; int len = wsDate.GetLength(); @@ -3851,7 +3851,7 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime, uint8_t hour = 0; uint8_t minute = 0; uint8_t second = 0; - FX_WORD millisecond = 0; + uint16_t millisecond = 0; int cc_start = 0, cc = cc_start; const FX_WCHAR* str = (const FX_WCHAR*)wsTime.GetPtr(); int len = wsTime.GetLength(); @@ -3923,7 +3923,7 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime, datetime = datetime + ut; return TRUE; } -static FX_WORD FX_GetSolarMonthDays(FX_WORD year, FX_WORD month) { +static uint16_t FX_GetSolarMonthDays(uint16_t year, uint16_t month) { if (month % 2) { return 31; } else if (month == 2) { @@ -3931,9 +3931,9 @@ static FX_WORD FX_GetSolarMonthDays(FX_WORD year, FX_WORD month) { } return 30; } -static FX_WORD FX_GetWeekDay(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD g_month_day[] = {0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}; - FX_WORD nDays = +static uint16_t FX_GetWeekDay(uint16_t year, uint16_t month, uint16_t day) { + uint16_t g_month_day[] = {0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}; + uint16_t nDays = (year - 1) % 7 + (year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400; nDays += g_month_day[month - 1] + day; if (FX_IsLeapYear(year) && month > 2) { @@ -3941,9 +3941,9 @@ static FX_WORD FX_GetWeekDay(FX_WORD year, FX_WORD month, FX_WORD day) { } return nDays % 7; } -static FX_WORD FX_GetWeekOfMonth(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD week_day = FX_GetWeekDay(year, month, 1); - FX_WORD week_index = 0; +static uint16_t FX_GetWeekOfMonth(uint16_t year, uint16_t month, uint16_t day) { + uint16_t week_day = FX_GetWeekDay(year, month, 1); + uint16_t week_index = 0; week_index += day / 7; day = day % 7; if (week_day + day > 7) { @@ -3951,14 +3951,14 @@ static FX_WORD FX_GetWeekOfMonth(FX_WORD year, FX_WORD month, FX_WORD day) { } return week_index; } -static FX_WORD FX_GetWeekOfYear(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD nDays = 0; - for (FX_WORD i = 1; i < month; i++) { +static uint16_t FX_GetWeekOfYear(uint16_t year, uint16_t month, uint16_t day) { + uint16_t nDays = 0; + for (uint16_t i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } nDays += day; - FX_WORD week_day = FX_GetWeekDay(year, 1, 1); - FX_WORD week_index = 1; + uint16_t week_day = FX_GetWeekDay(year, 1, 1); + uint16_t week_index = 1; week_index += nDays / 7; nDays = nDays % 7; if (week_day + nDays > 7) { @@ -4002,7 +4002,7 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsDay.Format(L"%02d", day); wsResult += wsDay; } else if (dwSymbol == FXBSTR_ID(0, 0, 'J', '1')) { - FX_WORD nDays = 0; + uint16_t nDays = 0; for (int i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } @@ -4011,7 +4011,7 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsDays.Format(L"%d", nDays); wsResult += wsDays; } else if (dwSymbol == FXBSTR_ID(0, 0, 'J', '3')) { - FX_WORD nDays = 0; + uint16_t nDays = 0; for (int i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } @@ -4036,24 +4036,24 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, pLocale->GetMonthName(month - 1, wsTemp, FALSE); wsResult += wsTemp; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '1')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsWeekDay; wsWeekDay.Format(L"%d", wWeekDay + 1); wsResult += wsWeekDay; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '3')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsTemp; pLocale->GetDayName(wWeekDay, wsTemp, TRUE); wsResult += wsTemp; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); if (pLocale) { CFX_WideString wsTemp; pLocale->GetDayName(wWeekDay, wsTemp, FALSE); wsResult += wsTemp; } } else if (dwSymbol == FXBSTR_ID(0, 0, 'e', '1')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsWeekDay; wsWeekDay.Format(L"%d", wWeekDay ? wWeekDay : 7); wsResult += wsWeekDay; @@ -4070,12 +4070,12 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsYear.Format(L"%d", year); wsResult += wsYear; } else if (dwSymbol == FXBSTR_ID(0, 0, 'w', '1')) { - FX_WORD week_index = FX_GetWeekOfMonth(year, month, day); + uint16_t week_index = FX_GetWeekOfMonth(year, month, day); CFX_WideString wsWeekInMonth; wsWeekInMonth.Format(L"%d", week_index); wsResult += wsWeekInMonth; } else if (dwSymbol == FXBSTR_ID(0, 0, 'W', '2')) { - FX_WORD week_index = FX_GetWeekOfYear(year, month, day); + uint16_t week_index = FX_GetWeekOfYear(year, month, day); CFX_WideString wsWeekInYear; wsWeekInYear.Format(L"%02d", week_index); wsResult += wsWeekInYear; @@ -4092,11 +4092,11 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, uint8_t hour = datetime.GetHour(); uint8_t minute = datetime.GetMinute(); uint8_t second = datetime.GetSecond(); - FX_WORD millisecond = datetime.GetMillisecond(); + uint16_t millisecond = datetime.GetMillisecond(); int32_t ccf = 0; const FX_WCHAR* strf = (const FX_WCHAR*)wsTimePattern; int32_t lenf = wsTimePattern.GetLength(); - FX_WORD wHour = hour; + uint16_t wHour = hour; FX_BOOL bPM = FALSE; if (wsTimePattern.Find('A') != -1) { if (wHour >= 12) { diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h index a7e14b3c26..3dd6c79fb7 100644 --- a/xfa/fgas/localization/fgas_locale.h +++ b/xfa/fgas/localization/fgas_locale.h @@ -87,13 +87,13 @@ class IFX_LocaleMgr { public: virtual ~IFX_LocaleMgr() {} virtual void Release() = 0; - virtual FX_WORD GetDefLocaleID() = 0; + virtual uint16_t GetDefLocaleID() = 0; virtual IFX_Locale* GetDefLocale() = 0; - virtual IFX_Locale* GetLocale(FX_WORD lcid) = 0; + virtual IFX_Locale* GetLocale(uint16_t lcid) = 0; virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName) = 0; }; IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, - FX_WORD wDefaultLCID); + uint16_t wDefaultLCID); void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult); FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime); @@ -109,7 +109,7 @@ class IFX_FormatString { virtual void SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns) = 0; virtual FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern) = 0; - virtual FX_WORD GetLCID(const CFX_WideString& wsPattern) = 0; + virtual uint16_t GetLCID(const CFX_WideString& wsPattern) = 0; virtual CFX_WideString GetLocaleName(const CFX_WideString& wsPattern) = 0; virtual FX_BOOL ParseText(const CFX_WideString& wsSrcText, const CFX_WideString& wsPattern, diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h index f4b2b0ec8a..1eeaa418ca 100644 --- a/xfa/fgas/localization/fgas_localeimp.h +++ b/xfa/fgas/localization/fgas_localeimp.h @@ -52,7 +52,7 @@ class CFX_FormatString : public IFX_FormatString { virtual void SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns); virtual FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern); - virtual FX_WORD GetLCID(const CFX_WideString& wsPattern); + virtual uint16_t GetLCID(const CFX_WideString& wsPattern); virtual CFX_WideString GetLocaleName(const CFX_WideString& wsPattern); virtual FX_BOOL ParseText(const CFX_WideString& wsSrcText, const CFX_WideString& wsPattern, diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp index 4ed8ddb79a..02061f75f3 100644 --- a/xfa/fgas/localization/fgas_localemgr.cpp +++ b/xfa/fgas/localization/fgas_localemgr.cpp @@ -9,7 +9,7 @@ #include "core/include/fxcrt/fx_xml.h" IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, - FX_WORD wDefaultLCID) { + uint16_t wDefaultLCID) { void* pPathHandle = FX_OpenFolder(pszLocalPath); if (!pPathHandle) { return NULL; @@ -53,7 +53,7 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, FX_CloseFolder(pPathHandle); return pLocaleMgr; } -CFX_LocaleMgr::CFX_LocaleMgr(FX_WORD wDefLCID) : m_wDefLCID(wDefLCID) {} +CFX_LocaleMgr::CFX_LocaleMgr(uint16_t wDefLCID) : m_wDefLCID(wDefLCID) {} CFX_LocaleMgr::~CFX_LocaleMgr() { FX_POSITION ps = m_lcid2locale.GetStartPosition(); while (ps) { @@ -72,13 +72,13 @@ CFX_LocaleMgr::~CFX_LocaleMgr() { } m_lcid2xml.RemoveAll(); } -FX_WORD CFX_LocaleMgr::GetDefLocaleID() { +uint16_t CFX_LocaleMgr::GetDefLocaleID() { return m_wDefLCID; } IFX_Locale* CFX_LocaleMgr::GetDefLocale() { return GetLocale(m_wDefLCID); } -IFX_Locale* CFX_LocaleMgr::GetLocale(FX_WORD lcid) { +IFX_Locale* CFX_LocaleMgr::GetLocale(uint16_t lcid) { IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((void*)(uintptr_t)lcid); if (!pLocale) { diff --git a/xfa/fgas/localization/fgas_localemgr.h b/xfa/fgas/localization/fgas_localemgr.h index 5ae0d738cb..5f2647071b 100644 --- a/xfa/fgas/localization/fgas_localemgr.h +++ b/xfa/fgas/localization/fgas_localemgr.h @@ -11,18 +11,18 @@ class CFX_LocaleMgr : public IFX_LocaleMgr { public: - CFX_LocaleMgr(FX_WORD wDefLCID); + CFX_LocaleMgr(uint16_t wDefLCID); virtual void Release() { delete this; } - virtual FX_WORD GetDefLocaleID(); + virtual uint16_t GetDefLocaleID(); virtual IFX_Locale* GetDefLocale(); - virtual IFX_Locale* GetLocale(FX_WORD lcid); + virtual IFX_Locale* GetLocale(uint16_t lcid); virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName); CFX_MapPtrToPtr m_lcid2xml; protected: ~CFX_LocaleMgr(); CFX_MapPtrToPtr m_lcid2locale; - FX_WORD m_wDefLCID; + uint16_t m_wDefLCID; }; #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALEMGR_H_ |