summaryrefslogtreecommitdiff
path: root/xfa/fgas
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas')
-rw-r--r--xfa/fgas/crt/fgas_codepage.cpp26
-rw-r--r--xfa/fgas/crt/fgas_codepage.h12
-rw-r--r--xfa/fgas/crt/fgas_stream.cpp79
-rw-r--r--xfa/fgas/crt/fgas_stream.h6
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.cpp44
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.h40
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp23
-rw-r--r--xfa/fgas/font/cfgas_gefont.h22
-rw-r--r--xfa/fgas/font/fgas_fontutils.cpp4
-rw-r--r--xfa/fgas/font/fgas_fontutils.h4
-rw-r--r--xfa/fgas/layout/cfx_breakline.cpp4
-rw-r--r--xfa/fgas/layout/cfx_breakpiece.cpp2
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp14
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h8
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp46
-rw-r--r--xfa/fgas/layout/fgas_textbreak.h12
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp110
17 files changed, 225 insertions, 231 deletions
diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp
index 36f87a36f3..5f824667fb 100644
--- a/xfa/fgas/crt/fgas_codepage.cpp
+++ b/xfa/fgas/crt/fgas_codepage.cpp
@@ -261,7 +261,7 @@ const FX_STR2CPHASH g_FXCPHashTable[] = {
{0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5},
};
-uint16_t GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) {
+uint16_t GetCodePageFromStringA(const char* pStr, int32_t iLength) {
ASSERT(pStr);
if (iLength < 0) {
iLength = FXSYS_strlen(pStr);
@@ -325,7 +325,7 @@ uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage) {
return 0xFFFF;
}
-uint16_t FX_GetCodePageFromStringW(const FX_WCHAR* pStr, int32_t iLength) {
+uint16_t FX_GetCodePageFromStringW(const wchar_t* pStr, int32_t iLength) {
if (iLength < 0) {
iLength = FXSYS_wcslen(pStr);
}
@@ -333,21 +333,21 @@ uint16_t FX_GetCodePageFromStringW(const FX_WCHAR* pStr, int32_t iLength) {
return 0xFFFF;
}
CFX_ByteString csStr;
- FX_CHAR* pBuf = csStr.GetBuffer(iLength + 1);
+ char* pBuf = csStr.GetBuffer(iLength + 1);
for (int32_t i = 0; i < iLength; ++i) {
- *pBuf++ = (FX_CHAR)*pStr++;
+ *pBuf++ = (char)*pStr++;
}
csStr.ReleaseBuffer(iLength);
return GetCodePageFromStringA(csStr.c_str(), iLength);
}
-void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) {
+void FX_SwapByteOrder(wchar_t* pStr, int32_t iLength) {
ASSERT(pStr);
if (iLength < 0) {
iLength = FXSYS_wcslen(pStr);
}
uint16_t wch;
- if (sizeof(FX_WCHAR) > 2) {
+ if (sizeof(wchar_t) > 2) {
while (iLength-- > 0) {
wch = (uint16_t)*pStr;
wch = (wch >> 8) | (wch << 8);
@@ -365,20 +365,20 @@ void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) {
void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) {
ASSERT(pBuffer && iLength > 0);
- if (sizeof(FX_WCHAR) == 2) {
+ if (sizeof(wchar_t) == 2) {
return;
}
uint16_t* pSrc = (uint16_t*)pBuffer;
- FX_WCHAR* pDst = (FX_WCHAR*)pBuffer;
+ wchar_t* pDst = (wchar_t*)pBuffer;
while (--iLength >= 0) {
- pDst[iLength] = (FX_WCHAR)pSrc[iLength];
+ pDst[iLength] = (wchar_t)pSrc[iLength];
}
}
int32_t FX_DecodeString(uint16_t wCodePage,
- const FX_CHAR* pSrc,
+ const char* pSrc,
int32_t* pSrcLen,
- FX_WCHAR* pDst,
+ wchar_t* pDst,
int32_t* pDstLen,
bool bErrBreak) {
if (wCodePage == FX_CODEPAGE_UTF8) {
@@ -386,9 +386,9 @@ int32_t FX_DecodeString(uint16_t wCodePage,
}
return -1;
}
-int32_t FX_UTF8Decode(const FX_CHAR* pSrc,
+int32_t FX_UTF8Decode(const char* pSrc,
int32_t* pSrcLen,
- FX_WCHAR* pDst,
+ wchar_t* pDst,
int32_t* pDstLen) {
if (!pSrcLen || !pDstLen) {
return -1;
diff --git a/xfa/fgas/crt/fgas_codepage.h b/xfa/fgas/crt/fgas_codepage.h
index 780c20e233..e3a535edfc 100644
--- a/xfa/fgas/crt/fgas_codepage.h
+++ b/xfa/fgas/crt/fgas_codepage.h
@@ -134,20 +134,20 @@
#define FX_CHARSET_OEM 255
uint16_t FX_GetCodePageFromCharset(uint8_t charset);
-uint16_t FX_GetCodePageFromStringW(const FX_WCHAR* pStr, int32_t iLength);
+uint16_t FX_GetCodePageFromStringW(const wchar_t* pStr, int32_t iLength);
uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage);
-void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength);
+void FX_SwapByteOrder(wchar_t* pStr, int32_t iLength);
void FX_UTF16ToWChar(void* pBuffer, int32_t iLength);
int32_t FX_DecodeString(uint16_t wCodePage,
- const FX_CHAR* pSrc,
+ const char* pSrc,
int32_t* pSrcLen,
- FX_WCHAR* pDst,
+ wchar_t* pDst,
int32_t* pDstLen,
bool bErrBreak);
-int32_t FX_UTF8Decode(const FX_CHAR* pSrc,
+int32_t FX_UTF8Decode(const char* pSrc,
int32_t* pSrcLen,
- FX_WCHAR* pDst,
+ wchar_t* pDst,
int32_t* pDstLen);
#endif // XFA_FGAS_CRT_FGAS_CODEPAGE_H_
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 424b191cb8..02096d4966 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -28,11 +28,9 @@ class IFGAS_StreamImp {
virtual int32_t GetPosition() = 0;
virtual bool IsEOF() const = 0;
virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- bool& bEOS) = 0;
+ virtual int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) = 0;
virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
+ virtual int32_t WriteString(const wchar_t* pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
virtual bool SetLength(int32_t iLength) = 0;
@@ -51,7 +49,7 @@ class CFGAS_FileStreamImp : public IFGAS_StreamImp {
CFGAS_FileStreamImp();
~CFGAS_FileStreamImp() override;
- bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
+ bool LoadFile(const wchar_t* pszSrcFileName, uint32_t dwAccess);
// IFGAS_StreamImp:
int32_t GetLength() const override;
@@ -59,9 +57,9 @@ class CFGAS_FileStreamImp : public IFGAS_StreamImp {
int32_t GetPosition() override;
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override;
void Flush() override;
bool SetLength(int32_t iLength) override;
@@ -83,9 +81,9 @@ class CFGAS_BufferStreamImp : public IFGAS_StreamImp {
int32_t GetPosition() override;
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override;
void Flush() override {}
bool SetLength(int32_t iLength) override { return false; }
@@ -110,11 +108,11 @@ class CFGAS_FileReadStreamImp : public IFGAS_StreamImp {
int32_t GetPosition() override { return m_iPosition; }
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override {
return 0;
}
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override {
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override {
return 0;
}
void Flush() override {}
@@ -141,11 +139,11 @@ class CFGAS_BufferReadStreamImp : public IFGAS_StreamImp {
int32_t GetPosition() override { return m_iPosition; }
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override {
return 0;
}
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override {
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override {
return 0;
}
void Flush() override {}
@@ -171,11 +169,11 @@ class CFGAS_FileWriteStreamImp : public IFGAS_StreamImp {
int32_t GetPosition() override { return m_iPosition; }
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override { return 0; }
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override {
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override {
return 0;
}
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override;
void Flush() override;
bool SetLength(int32_t iLength) override { return false; }
@@ -197,7 +195,7 @@ class CFGAS_Stream : public IFGAS_Stream {
template <typename T, typename... Args>
friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
- bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
+ bool LoadFile(const wchar_t* pszSrcFileName, uint32_t dwAccess);
bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
bool LoadFileRead(const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead,
uint32_t dwAccess);
@@ -214,9 +212,9 @@ class CFGAS_Stream : public IFGAS_Stream {
int32_t GetPosition() override;
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override;
void Flush() override;
bool SetLength(int32_t iLength) override;
int32_t GetBOM(uint8_t bom[4]) const override;
@@ -252,9 +250,9 @@ class CFGAS_TextStream : public IFGAS_Stream {
int32_t GetPosition() override;
bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
+ int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
+ int32_t WriteString(const wchar_t* pStr, int32_t iLength) override;
void Flush() override;
bool SetLength(int32_t iLength) override;
int32_t GetBOM(uint8_t bom[4]) const override;
@@ -376,13 +374,13 @@ CFGAS_FileStreamImp::~CFGAS_FileStreamImp() {
FXSYS_fclose(m_hFile);
}
-bool CFGAS_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
+bool CFGAS_FileStreamImp::LoadFile(const wchar_t* pszSrcFileName,
uint32_t dwAccess) {
ASSERT(!m_hFile);
ASSERT(pszSrcFileName && FXSYS_wcslen(pszSrcFileName) > 0);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \
_FX_OS_ == _FX_WIN64_
- const FX_WCHAR* wsMode;
+ const wchar_t* wsMode;
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Append) {
wsMode = L"a+b";
@@ -414,7 +412,7 @@ bool CFGAS_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
}
}
#else
- const FX_CHAR* wsMode = "rb";
+ const char* wsMode = "rb";
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Append) {
wsMode = "a+b";
@@ -476,7 +474,7 @@ int32_t CFGAS_FileStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
ASSERT(pBuffer && iBufferSize > 0);
return FXSYS_fread(pBuffer, 1, iBufferSize, m_hFile);
}
-int32_t CFGAS_FileStreamImp::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_FileStreamImp::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(m_hFile);
@@ -514,8 +512,7 @@ int32_t CFGAS_FileStreamImp::WriteData(const uint8_t* pBuffer,
}
return iRet;
}
-int32_t CFGAS_FileStreamImp::WriteString(const FX_WCHAR* pStr,
- int32_t iLength) {
+int32_t CFGAS_FileStreamImp::WriteString(const wchar_t* pStr, int32_t iLength) {
ASSERT(m_hFile && (GetAccessModes() & FX_STREAMACCESS_Write) != 0);
ASSERT(pStr && iLength > 0);
int32_t iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile);
@@ -591,7 +588,7 @@ int32_t CFGAS_FileReadStreamImp::ReadData(uint8_t* pBuffer,
}
return 0;
}
-int32_t CFGAS_FileReadStreamImp::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_FileReadStreamImp::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(m_pFileRead);
@@ -716,7 +713,7 @@ int32_t CFGAS_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
m_iPosition += dwOffsetTmp;
return dwOffsetTmp;
}
-int32_t CFGAS_BufferReadStreamImp::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_BufferReadStreamImp::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(m_pBufferRead);
@@ -788,9 +785,9 @@ int32_t CFGAS_FileWriteStreamImp::WriteData(const uint8_t* pBuffer,
}
return iBufferSize;
}
-int32_t CFGAS_FileWriteStreamImp::WriteString(const FX_WCHAR* pStr,
+int32_t CFGAS_FileWriteStreamImp::WriteString(const wchar_t* pStr,
int32_t iLength) {
- return WriteData((const uint8_t*)pStr, iLength * sizeof(FX_WCHAR));
+ return WriteData((const uint8_t*)pStr, iLength * sizeof(wchar_t));
}
void CFGAS_FileWriteStreamImp::Flush() {
if (m_pFileWrite) {
@@ -851,7 +848,7 @@ int32_t CFGAS_BufferStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
m_iPosition += iLen;
return iLen;
}
-int32_t CFGAS_BufferStreamImp::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_BufferStreamImp::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(m_pData);
@@ -860,7 +857,7 @@ int32_t CFGAS_BufferStreamImp::ReadString(FX_WCHAR* pStr,
if (iLen <= 0) {
return 0;
}
- const FX_WCHAR* pSrc = (const FX_WCHAR*)(FX_CHAR*)(m_pData + m_iPosition);
+ const wchar_t* pSrc = (const wchar_t*)(char*)(m_pData + m_iPosition);
int32_t iCount = 0;
while (*pSrc && iCount < iLen) {
*pStr++ = *pSrc++;
@@ -885,7 +882,7 @@ int32_t CFGAS_BufferStreamImp::WriteData(const uint8_t* pBuffer,
}
return iLen;
}
-int32_t CFGAS_BufferStreamImp::WriteString(const FX_WCHAR* pStr,
+int32_t CFGAS_BufferStreamImp::WriteString(const wchar_t* pStr,
int32_t iLength) {
ASSERT(m_pData && (GetAccessModes() & FX_STREAMACCESS_Write) != 0);
ASSERT(pStr && iLength > 0);
@@ -1043,7 +1040,7 @@ uint16_t CFGAS_TextStream::SetCodePage(uint16_t wCodePage) {
return v;
}
-int32_t CFGAS_TextStream::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_TextStream::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(pStr && iMaxLength > 0);
@@ -1056,7 +1053,7 @@ int32_t CFGAS_TextStream::ReadString(FX_WCHAR* pStr,
int32_t iBytes = iMaxLength * 2;
iLen = m_pStreamImp->ReadData((uint8_t*)pStr, iBytes);
iMaxLength = iLen / 2;
- if (sizeof(FX_WCHAR) > 2) {
+ if (sizeof(wchar_t) > 2) {
FX_UTF16ToWChar(pStr, iMaxLength);
}
#if _FX_ENDIAN_ == _FX_BIG_ENDIAN_
@@ -1082,8 +1079,8 @@ int32_t CFGAS_TextStream::ReadString(FX_WCHAR* pStr,
}
iLen = m_pStreamImp->ReadData(m_pBuf, iBytes);
int32_t iSrc = iLen;
- int32_t iDecode = FX_DecodeString(m_wCodePage, (const FX_CHAR*)m_pBuf,
- &iSrc, pStr, &iMaxLength, true);
+ int32_t iDecode = FX_DecodeString(m_wCodePage, (const char*)m_pBuf, &iSrc,
+ pStr, &iMaxLength, true);
m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen);
if (iDecode < 1) {
return -1;
@@ -1096,7 +1093,7 @@ int32_t CFGAS_TextStream::ReadString(FX_WCHAR* pStr,
return iMaxLength;
}
-int32_t CFGAS_TextStream::WriteString(const FX_WCHAR* pStr, int32_t iLength) {
+int32_t CFGAS_TextStream::WriteString(const wchar_t* pStr, int32_t iLength) {
ASSERT(pStr && iLength > 0);
if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0)
return -1;
@@ -1129,7 +1126,7 @@ CFGAS_Stream::~CFGAS_Stream() {
delete m_pStreamImp;
}
-bool CFGAS_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess) {
+bool CFGAS_Stream::LoadFile(const wchar_t* pszSrcFileName, uint32_t dwAccess) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
return false;
@@ -1303,7 +1300,7 @@ int32_t CFGAS_Stream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
m_iPosition = m_pStreamImp->GetPosition();
return iLen;
}
-int32_t CFGAS_Stream::ReadString(FX_WCHAR* pStr,
+int32_t CFGAS_Stream::ReadString(wchar_t* pStr,
int32_t iMaxLength,
bool& bEOS) {
ASSERT(pStr && iMaxLength > 0);
@@ -1353,7 +1350,7 @@ int32_t CFGAS_Stream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
}
return iLen;
}
-int32_t CFGAS_Stream::WriteString(const FX_WCHAR* pStr, int32_t iLength) {
+int32_t CFGAS_Stream::WriteString(const wchar_t* pStr, int32_t iLength) {
ASSERT(pStr && iLength > 0);
if (!m_pStreamImp) {
return -1;
diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h
index 79fda58d2a..fdfc08205a 100644
--- a/xfa/fgas/crt/fgas_stream.h
+++ b/xfa/fgas/crt/fgas_stream.h
@@ -51,11 +51,9 @@ class IFGAS_Stream : public CFX_Retainable {
virtual int32_t GetPosition() = 0;
virtual bool IsEOF() const = 0;
virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- bool& bEOS) = 0;
+ virtual int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) = 0;
virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
+ virtual int32_t WriteString(const wchar_t* pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
virtual bool SetLength(int32_t iLength) = 0;
virtual int32_t GetBOM(uint8_t bom[4]) const = 0;
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp
index aa41318f5d..0173a6a24c 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -113,7 +113,7 @@ CFGAS_FontMgr::~CFGAS_FontMgr() {}
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage(
uint16_t wCodePage,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily) {
+ const wchar_t* pszFontFamily) {
uint32_t dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
auto it = m_CPFonts.find(dwHash);
if (it != m_CPFonts.end()) {
@@ -141,9 +141,9 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage(
}
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
- FX_WCHAR wUnicode,
+ wchar_t wUnicode,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily) {
+ const wchar_t* pszFontFamily) {
const FGAS_FONTUSB* pRet = FGAS_GetUnicodeBitField(wUnicode);
if (pRet->wBitField == 999)
return nullptr;
@@ -166,7 +166,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
return nullptr;
uint16_t wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet);
- const FX_WCHAR* pFontFace = pFD->wsFontFace;
+ const wchar_t* pFontFace = pFD->wsFontFace;
CFX_RetainPtr<CFGAS_GEFont> pFont =
CFGAS_GEFont::LoadFont(pFontFace, dwFontStyles, wCodePage, this);
if (!pFont)
@@ -181,7 +181,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
}
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(
- const FX_WCHAR* pszFontFamily,
+ const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
CFX_RetainPtr<CFGAS_GEFont> pFont;
@@ -262,12 +262,12 @@ void CFGAS_FontMgr::RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) {
m_Fonts.erase(it);
}
-const FX_FONTDESCRIPTOR* CFGAS_FontMgr::FindFont(const FX_WCHAR* pszFontFamily,
+const FX_FONTDESCRIPTOR* CFGAS_FontMgr::FindFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint32_t dwMatchFlags,
uint16_t wCodePage,
uint32_t dwUSB,
- FX_WCHAR wUnicode) {
+ wchar_t wUnicode) {
FX_FONTMATCHPARAMS params;
FXSYS_memset(&params, 0, sizeof(params));
params.dwUSB = dwUSB;
@@ -325,7 +325,7 @@ static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX* lpelfe,
FXSYS_memset(pFont, 0, sizeof(FX_FONTDESCRIPTOR));
pFont->uCharSet = lf.lfCharSet;
pFont->dwFontStyles = FX_GetGdiFontStyles(lf);
- FXSYS_wcsncpy(pFont->wsFontFace, (const FX_WCHAR*)lf.lfFaceName, 31);
+ FXSYS_wcsncpy(pFont->wsFontFace, (const wchar_t*)lf.lfFaceName, 31);
pFont->wsFontFace[31] = 0;
FXSYS_memcpy(&pFont->FontSignature, &lpntme->ntmFontSig,
sizeof(lpntme->ntmFontSig));
@@ -335,8 +335,8 @@ static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX* lpelfe,
}
static void FX_EnumGdiFonts(std::deque<FX_FONTDESCRIPTOR>* fonts,
- const FX_WCHAR* pwsFaceName,
- FX_WCHAR wUnicode) {
+ const wchar_t* pwsFaceName,
+ wchar_t wUnicode) {
HDC hDC = ::GetDC(nullptr);
LOGFONTW lfFind;
FXSYS_memset(&lfFind, 0, sizeof(lfFind));
@@ -358,7 +358,7 @@ FX_LPEnumAllFonts FX_GetDefFontEnumerator() {
namespace {
-const FX_CHAR* g_FontFolders[] = {
+const char* g_FontFolders[] = {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
"/usr/share/fonts", "/usr/share/X11/fonts/Type1",
"/usr/share/X11/fonts/TTF", "/usr/local/share/fonts",
@@ -396,7 +396,7 @@ uint16_t FX_GetCodePageBit(uint16_t wCodePage) {
return static_cast<uint16_t>(-1);
}
-uint16_t FX_GetUnicodeBit(FX_WCHAR wcUnicode) {
+uint16_t FX_GetUnicodeBit(wchar_t wcUnicode) {
const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wcUnicode);
return x ? x->wBitField : 999;
}
@@ -616,7 +616,7 @@ bool CFGAS_FontMgr::EnumFonts() {
}
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(
- const FX_WCHAR* pszFontFamily,
+ const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
@@ -625,7 +625,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFont(
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage(
uint16_t wCodePage,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily) {
+ const wchar_t* pszFontFamily) {
CFX_ByteString bsHash;
bsHash.Format("%d, %d", wCodePage, dwFontStyles);
bsHash += FX_UTF8Encode(CFX_WideStringC(pszFontFamily));
@@ -658,9 +658,9 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByCodePage(
}
CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
- FX_WCHAR wUnicode,
+ wchar_t wUnicode,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily) {
+ const wchar_t* pszFontFamily) {
if (pdfium::ContainsKey(m_FailedUnicodesSet, wUnicode))
return nullptr;
@@ -706,7 +706,7 @@ CFX_RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
}
bool CFGAS_FontMgr::VerifyUnicode(CFX_FontDescriptor* pDesc,
- FX_WCHAR wcUnicode) {
+ wchar_t wcUnicode) {
CFX_RetainPtr<IFX_SeekableReadStream> pFileRead =
CreateFontStream(pDesc->m_wsFaceName.UTF8Encode());
if (!pFileRead)
@@ -726,7 +726,7 @@ bool CFGAS_FontMgr::VerifyUnicode(CFX_FontDescriptor* pDesc,
}
bool CFGAS_FontMgr::VerifyUnicode(const CFX_RetainPtr<CFGAS_GEFont>& pFont,
- FX_WCHAR wcUnicode) {
+ wchar_t wcUnicode) {
if (!pFont)
return false;
@@ -878,7 +878,7 @@ void CFGAS_FontMgr::MatchFonts(
uint16_t wCodePage,
uint32_t dwFontStyles,
const CFX_WideString& FontName,
- FX_WCHAR wcUnicode) {
+ wchar_t wcUnicode) {
pMatchedFonts->clear();
for (const auto& pFont : m_InstalledFonts) {
int32_t nPenalty =
@@ -896,7 +896,7 @@ int32_t CFGAS_FontMgr::CalcPenalty(CFX_FontDescriptor* pInstalled,
uint16_t wCodePage,
uint32_t dwFontStyles,
const CFX_WideString& FontName,
- FX_WCHAR wcUnicode) {
+ wchar_t wcUnicode) {
int32_t nPenalty = 30000;
if (FontName.GetLength() != 0) {
if (FontName != pInstalled->m_wsFaceName) {
@@ -1077,14 +1077,14 @@ void CFGAS_FontMgr::GetNames(const uint8_t* name_table,
wsFamily.clear();
if (nPlatformID != 1) {
for (uint16_t k = 0; k < nNameLength / 2; k++) {
- FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2);
+ wchar_t wcTemp = GetUInt16(lpStr + nNameOffset + k * 2);
wsFamily += wcTemp;
}
Names.push_back(wsFamily);
continue;
}
for (uint16_t k = 0; k < nNameLength; k++) {
- FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k);
+ wchar_t wcTemp = GetUInt8(lpStr + nNameOffset + k);
wsFamily += wcTemp;
}
Names.push_back(wsFamily);
diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h
index 23ab523e78..63a8d3b146 100644
--- a/xfa/fgas/font/cfgas_fontmgr.h
+++ b/xfa/fgas/font/cfgas_fontmgr.h
@@ -40,11 +40,11 @@ class CFGAS_GEFont;
#define FX_FONTMATCHPARA_MatchStyle 0x01
struct FX_FONTMATCHPARAMS {
- const FX_WCHAR* pwsFamily;
+ const wchar_t* pwsFamily;
uint32_t dwFontStyles;
uint32_t dwUSB;
uint32_t dwMatchFlags;
- FX_WCHAR wUnicode;
+ wchar_t wUnicode;
uint16_t wCodePage;
};
@@ -61,7 +61,7 @@ inline bool operator==(const FX_FONTSIGNATURE& left,
}
struct FX_FONTDESCRIPTOR {
- FX_WCHAR wsFontFace[32];
+ wchar_t wsFontFace[32];
uint32_t dwFontStyles;
uint8_t uCharSet;
FX_FONTSIGNATURE FontSignature;
@@ -76,8 +76,8 @@ inline bool operator==(const FX_FONTDESCRIPTOR& left,
}
typedef void (*FX_LPEnumAllFonts)(std::deque<FX_FONTDESCRIPTOR>* fonts,
- const FX_WCHAR* pwsFaceName,
- FX_WCHAR wUnicode);
+ const wchar_t* pwsFaceName,
+ wchar_t wUnicode);
FX_LPEnumAllFonts FX_GetDefFontEnumerator();
@@ -90,11 +90,11 @@ class CFGAS_FontMgr {
CFX_RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily);
- CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(FX_WCHAR wUnicode,
+ const wchar_t* pszFontFamily);
+ CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily);
- CFX_RetainPtr<CFGAS_GEFont> LoadFont(const FX_WCHAR* pszFontFamily,
+ const wchar_t* pszFontFamily);
+ CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
void RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
@@ -106,12 +106,12 @@ class CFGAS_FontMgr {
uint16_t wCodePage);
void RemoveFont(std::map<uint32_t, CFX_RetainPtr<CFGAS_GEFont>>* pFontMap,
const CFX_RetainPtr<CFGAS_GEFont>& pFont);
- const FX_FONTDESCRIPTOR* FindFont(const FX_WCHAR* pszFontFamily,
+ const FX_FONTDESCRIPTOR* FindFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint32_t dwMatchFlags,
uint16_t wCodePage,
uint32_t dwUSB = 999,
- FX_WCHAR wUnicode = 0);
+ wchar_t wUnicode = 0);
FX_LPEnumAllFonts m_pEnumerator;
std::deque<FX_FONTDESCRIPTOR> m_FontFaces;
@@ -190,11 +190,11 @@ class CFGAS_FontMgr {
CFX_RetainPtr<CFGAS_GEFont> GetFontByCodePage(uint16_t wCodePage,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily);
- CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(FX_WCHAR wUnicode,
+ const wchar_t* pszFontFamily);
+ CFX_RetainPtr<CFGAS_GEFont> GetFontByUnicode(wchar_t wUnicode,
uint32_t dwFontStyles,
- const FX_WCHAR* pszFontFamily);
- CFX_RetainPtr<CFGAS_GEFont> LoadFont(const FX_WCHAR* pszFontFamily,
+ const wchar_t* pszFontFamily);
+ CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
void RemoveFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
@@ -210,20 +210,20 @@ class CFGAS_FontMgr {
std::vector<uint16_t> GetCharsets(FXFT_Face pFace) const;
void GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB);
uint32_t GetFlags(FXFT_Face pFace);
- bool VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode);
+ bool VerifyUnicode(CFX_FontDescriptor* pDesc, wchar_t wcUnicode);
bool VerifyUnicode(const CFX_RetainPtr<CFGAS_GEFont>& pFont,
- FX_WCHAR wcUnicode);
+ wchar_t wcUnicode);
int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
void MatchFonts(std::vector<CFX_FontDescriptorInfo>* MatchedFonts,
uint16_t wCodePage,
uint32_t dwFontStyles,
const CFX_WideString& FontName,
- FX_WCHAR wcUnicode = 0xFFFE);
+ wchar_t wcUnicode = 0xFFFE);
int32_t CalcPenalty(CFX_FontDescriptor* pInstalled,
uint16_t wCodePage,
uint32_t dwFontStyles,
const CFX_WideString& FontName,
- FX_WCHAR wcUnicode = 0xFFFE);
+ wchar_t wcUnicode = 0xFFFE);
CFX_RetainPtr<CFGAS_GEFont> LoadFont(const CFX_WideString& wsFaceName,
int32_t iFaceIndex,
int32_t* pFaceCount);
@@ -243,7 +243,7 @@ class CFGAS_FontMgr {
std::map<uint32_t, std::vector<CFX_RetainPtr<CFGAS_GEFont>>> m_Hash2Fonts;
std::map<CFX_RetainPtr<CFGAS_GEFont>, CFX_RetainPtr<IFX_SeekableReadStream>>
m_IFXFont2FileRead;
- std::set<FX_WCHAR> m_FailedUnicodesSet;
+ std::set<wchar_t> m_FailedUnicodesSet;
};
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 2d5a927cde..769ce36417 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -18,11 +18,10 @@
#include "xfa/fxfa/xfa_fontmgr.h"
// static
-CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(
- const FX_WCHAR* pszFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage,
- CFGAS_FontMgr* pFontMgr) {
+CFX_RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const wchar_t* pszFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage,
+ CFGAS_FontMgr* pFontMgr) {
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
if (!pFontMgr)
return nullptr;
@@ -123,7 +122,7 @@ CFGAS_GEFont::~CFGAS_GEFont() {
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-bool CFGAS_GEFont::LoadFontInternal(const FX_WCHAR* pszFontFamily,
+bool CFGAS_GEFont::LoadFontInternal(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
if (m_pFont)
@@ -259,13 +258,13 @@ uint32_t CFGAS_GEFont::GetFontStyles() const {
return dwStyles;
}
-bool CFGAS_GEFont::GetCharWidth(FX_WCHAR wUnicode,
+bool CFGAS_GEFont::GetCharWidth(wchar_t wUnicode,
int32_t& iWidth,
bool bCharCode) {
return GetCharWidthInternal(wUnicode, iWidth, true, bCharCode);
}
-bool CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
+bool CFGAS_GEFont::GetCharWidthInternal(wchar_t wUnicode,
int32_t& iWidth,
bool bRecursive,
bool bCharCode) {
@@ -299,13 +298,13 @@ bool CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
return iWidth > 0;
}
-bool CFGAS_GEFont::GetCharBBox(FX_WCHAR wUnicode,
+bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode,
CFX_Rect* bbox,
bool bCharCode) {
return GetCharBBoxInternal(wUnicode, bbox, true, bCharCode);
}
-bool CFGAS_GEFont::GetCharBBoxInternal(FX_WCHAR wUnicode,
+bool CFGAS_GEFont::GetCharBBoxInternal(wchar_t wUnicode,
CFX_Rect* bbox,
bool bRecursive,
bool bCharCode) {
@@ -345,11 +344,11 @@ bool CFGAS_GEFont::GetBBox(CFX_Rect* bbox) {
return true;
}
-int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, bool bCharCode) {
+int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode, bool bCharCode) {
return GetGlyphIndex(wUnicode, true, nullptr, bCharCode);
}
-int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode,
+int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode,
bool bRecursive,
CFX_RetainPtr<CFGAS_GEFont>* ppFont,
bool bCharCode) {
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index 0a8e7bad76..b460cee496 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -28,7 +28,7 @@ class CFGAS_GEFont : public CFX_Retainable {
template <typename T, typename... Args>
friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
- static CFX_RetainPtr<CFGAS_GEFont> LoadFont(const FX_WCHAR* pszFontFamily,
+ static CFX_RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage,
CFGAS_FontMgr* pFontMgr);
@@ -50,11 +50,11 @@ class CFGAS_GEFont : public CFX_Retainable {
CFX_RetainPtr<CFGAS_GEFont> Derive(uint32_t dwFontStyles,
uint16_t wCodePage = 0);
uint32_t GetFontStyles() const;
- bool GetCharWidth(FX_WCHAR wUnicode, int32_t& iWidth, bool bCharCode);
- int32_t GetGlyphIndex(FX_WCHAR wUnicode, bool bCharCode = false);
+ bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth, bool bCharCode);
+ int32_t GetGlyphIndex(wchar_t wUnicode, bool bCharCode = false);
int32_t GetAscent() const;
int32_t GetDescent() const;
- bool GetCharBBox(FX_WCHAR wUnicode, CFX_Rect* bbox, bool bCharCode = false);
+ bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox, bool bCharCode = false);
bool GetBBox(CFX_Rect* bbox);
CFX_RetainPtr<CFGAS_GEFont> GetSubstFont(int32_t iGlyphIndex);
CFX_Font* GetDevFont() const { return m_pFont; }
@@ -72,7 +72,7 @@ class CFGAS_GEFont : public CFX_Retainable {
~CFGAS_GEFont() override;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- bool LoadFontInternal(const FX_WCHAR* pszFontFamily,
+ bool LoadFontInternal(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
bool LoadFontInternal(const uint8_t* pBuffer, int32_t length);
@@ -82,15 +82,15 @@ class CFGAS_GEFont : public CFX_Retainable {
bool LoadFontInternal(CFX_Font* pExternalFont);
bool LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont);
bool InitFont();
- bool GetCharBBoxInternal(FX_WCHAR wUnicode,
+ bool GetCharBBoxInternal(wchar_t wUnicode,
CFX_Rect* bbox,
bool bRecursive,
bool bCharCode = false);
- bool GetCharWidthInternal(FX_WCHAR wUnicode,
+ bool GetCharWidthInternal(wchar_t wUnicode,
int32_t& iWidth,
bool bRecursive,
bool bCharCode);
- int32_t GetGlyphIndex(FX_WCHAR wUnicode,
+ int32_t GetGlyphIndex(wchar_t wUnicode,
bool bRecursive,
CFX_RetainPtr<CFGAS_GEFont>* ppFont,
bool bCharCode = false);
@@ -107,11 +107,11 @@ class CFGAS_GEFont : public CFX_Retainable {
CFX_RetainPtr<IFGAS_Stream> m_pStream;
CFX_RetainPtr<IFX_SeekableReadStream> m_pFileRead;
std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding;
- std::map<FX_WCHAR, int32_t> m_CharWidthMap;
- std::map<FX_WCHAR, CFX_Rect> m_BBoxMap;
+ std::map<wchar_t, int32_t> m_CharWidthMap;
+ std::map<wchar_t, CFX_Rect> m_BBoxMap;
CXFA_PDFFontMgr* m_pProvider; // not owned.
std::vector<CFX_RetainPtr<CFGAS_GEFont>> m_SubstFonts;
- std::map<FX_WCHAR, CFX_RetainPtr<CFGAS_GEFont>> m_FontMapper;
+ std::map<wchar_t, CFX_RetainPtr<CFGAS_GEFont>> m_FontMapper;
};
#endif // XFA_FGAS_FONT_CFGAS_GEFONT_H_
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index e74056b53e..e775ebdf0c 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -31,7 +31,7 @@ uint32_t FGAS_GetFontHashCode(uint16_t wCodePage, uint32_t dwFontStyles) {
}
return dwHash;
}
-uint32_t FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily,
+uint32_t FGAS_GetFontFamilyHash(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
CFX_WideString wsFont(pszFontFamily);
@@ -134,7 +134,7 @@ static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0xFFA0, 0xFFEF, 68, 0xFFFF},
};
-const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode) {
+const FGAS_FONTUSB* FGAS_GetUnicodeBitField(wchar_t wUnicode) {
int32_t iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1;
ASSERT(iEnd >= 0);
int32_t iStart = 0, iMid;
diff --git a/xfa/fgas/font/fgas_fontutils.h b/xfa/fgas/font/fgas_fontutils.h
index d7055ced9b..d92b469e7b 100644
--- a/xfa/fgas/font/fgas_fontutils.h
+++ b/xfa/fgas/font/fgas_fontutils.h
@@ -17,9 +17,9 @@ struct FGAS_FONTUSB {
};
uint32_t FGAS_GetFontHashCode(uint16_t wCodePage, uint32_t dwFontStyles);
-uint32_t FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily,
+uint32_t FGAS_GetFontFamilyHash(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
-const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode);
+const FGAS_FONTUSB* FGAS_GetUnicodeBitField(wchar_t wUnicode);
#endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_
diff --git a/xfa/fgas/layout/cfx_breakline.cpp b/xfa/fgas/layout/cfx_breakline.cpp
index 4e9d8ad5ae..65860e4013 100644
--- a/xfa/fgas/layout/cfx_breakline.cpp
+++ b/xfa/fgas/layout/cfx_breakline.cpp
@@ -37,9 +37,9 @@ const CFX_BreakPiece* CFX_BreakLine::GetPiece(int32_t index) const {
void CFX_BreakLine::GetString(CFX_WideString& wsStr) const {
int32_t iCount = pdfium::CollectionSize<int32_t>(m_LineChars);
- FX_WCHAR* pBuf = wsStr.GetBuffer(iCount);
+ wchar_t* pBuf = wsStr.GetBuffer(iCount);
for (int32_t i = 0; i < iCount; i++)
- *pBuf++ = static_cast<FX_WCHAR>(m_LineChars[i].m_wCharCode);
+ *pBuf++ = static_cast<wchar_t>(m_LineChars[i].m_wCharCode);
wsStr.ReleaseBuffer(iCount);
}
diff --git a/xfa/fgas/layout/cfx_breakpiece.cpp b/xfa/fgas/layout/cfx_breakpiece.cpp
index d31c53f964..dd8b451790 100644
--- a/xfa/fgas/layout/cfx_breakpiece.cpp
+++ b/xfa/fgas/layout/cfx_breakpiece.cpp
@@ -40,7 +40,7 @@ CFX_WideString CFX_BreakPiece::GetString() const {
CFX_WideString ret;
ret.Reserve(m_iChars);
for (int32_t i = m_iStartChar; i < m_iStartChar + m_iChars; i++)
- ret += static_cast<FX_WCHAR>((*m_pChars)[i].m_wCharCode);
+ ret += static_cast<wchar_t>((*m_pChars)[i].m_wCharCode);
return ret;
}
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index 85edaf7f99..1e0cc9c25e 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -190,7 +190,7 @@ bool CFX_RTFBreak::GetPositionedTab(int32_t* iTabPos) const {
return true;
}
-CFX_BreakType CFX_RTFBreak::AppendChar(FX_WCHAR wch) {
+CFX_BreakType CFX_RTFBreak::AppendChar(wchar_t wch) {
ASSERT(m_pFont && m_pCurLine);
uint32_t dwProps = kTextLayoutCodeProperties[static_cast<uint16_t>(wch)];
@@ -313,7 +313,7 @@ CFX_BreakType CFX_RTFBreak::AppendChar_Control(CFX_Char* pCurChar) {
CFX_BreakType CFX_RTFBreak::AppendChar_Arabic(CFX_Char* pCurChar) {
CFX_Char* pLastChar = nullptr;
int32_t iCharWidth = 0;
- FX_WCHAR wForm;
+ wchar_t wForm;
bool bAlef = false;
if (m_eCharType >= FX_CHARTYPE_ArabicAlef &&
m_eCharType <= FX_CHARTYPE_ArabicDistortion) {
@@ -357,7 +357,7 @@ CFX_BreakType CFX_RTFBreak::AppendChar_Arabic(CFX_Char* pCurChar) {
CFX_BreakType CFX_RTFBreak::AppendChar_Others(CFX_Char* pCurChar) {
FX_CHARTYPE chartype = pCurChar->GetCharType();
- FX_WCHAR wForm = pCurChar->m_wCharCode;
+ wchar_t wForm = pCurChar->m_wCharCode;
int32_t iCharWidth = 0;
if (!m_pFont->GetCharWidth(wForm, iCharWidth, false))
iCharWidth = m_iDefChar;
@@ -842,8 +842,8 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * static_cast<FX_FLOAT>(iAscent) /
static_cast<FX_FLOAT>(iMaxHeight);
- FX_WCHAR wPrev = 0xFEFF;
- FX_WCHAR wNext;
+ wchar_t wPrev = 0xFEFF;
+ wchar_t wNext;
FX_FLOAT fX = rtText.left;
int32_t iHorScale = pText->iHorizontalScale;
int32_t iVerScale = pText->iVerticalScale;
@@ -853,7 +853,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FX_FLOAT fY = rtText.top + fAscent;
int32_t iCount = 0;
for (int32_t i = 0; i < pText->iLength; ++i) {
- FX_WCHAR wch = pText->pStr[i];
+ wchar_t wch = pText->pStr[i];
int32_t iWidth = pText->pWidths[i];
uint32_t dwProps = FX_GetUnicodeProperties(wch);
uint32_t dwCharType = (dwProps & FX_CHARTYPEBITSMASK);
@@ -871,7 +871,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
if (pCharPos) {
iCharWidth /= iFontSize;
- FX_WCHAR wForm = wch;
+ wchar_t wForm = wch;
if (dwCharType >= FX_CHARTYPE_ArabicAlef) {
if (i + 1 < pText->iLength) {
wNext = pText->pStr[i + 1];
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index b3def63251..339d2f4bcd 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -36,7 +36,7 @@ struct FX_RTFTEXTOBJ {
std::vector<int32_t> pWidths;
CFX_RetainPtr<CFGAS_GEFont> pFont;
const CFX_RectF* pRect;
- FX_WCHAR wLineBreakChar;
+ wchar_t wLineBreakChar;
FX_FLOAT fFontSize;
int32_t iLength;
int32_t iBidiLevel;
@@ -74,7 +74,7 @@ class CFX_RTFBreak {
FXTEXT_CHARPOS* pCharPos,
bool bCharCode) const;
- CFX_BreakType AppendChar(FX_WCHAR wch);
+ CFX_BreakType AppendChar(wchar_t wch);
CFX_BreakLine* GetCurrentLineForTesting() const { return m_pCurLine; }
@@ -116,9 +116,9 @@ class CFX_RTFBreak {
int32_t m_iFontSize;
int32_t m_iTabWidth;
std::vector<int32_t> m_PositionedTabs;
- FX_WCHAR m_wDefChar;
+ wchar_t m_wDefChar;
int32_t m_iDefChar;
- FX_WCHAR m_wLineBreakChar;
+ wchar_t m_wLineBreakChar;
int32_t m_iHorizontalScale;
int32_t m_iVerticalScale;
int32_t m_iCharSpace;
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 9343f94cc6..eabe381621 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -29,7 +29,7 @@ const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = {
&CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others,
};
-bool IsCtrlCode(FX_WCHAR ch) {
+bool IsCtrlCode(wchar_t ch) {
uint32_t dwRet = (FX_GetUnicodeProperties(ch) & FX_CHARTYPEBITSMASK);
return dwRet == FX_CHARTYPE_Tab || dwRet == FX_CHARTYPE_Control;
}
@@ -112,7 +112,7 @@ void CFX_TxtBreak::SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant) {
m_bEquidistant = bEquidistant;
}
-void CFX_TxtBreak::SetDefaultChar(FX_WCHAR wch) {
+void CFX_TxtBreak::SetDefaultChar(wchar_t wch) {
m_wDefChar = wch;
m_iDefChar = 0;
if (m_wDefChar == 0xFEFF || !m_pFont)
@@ -125,7 +125,7 @@ void CFX_TxtBreak::SetDefaultChar(FX_WCHAR wch) {
m_iDefChar *= m_iFontSize;
}
-void CFX_TxtBreak::SetParagraphBreakChar(FX_WCHAR wch) {
+void CFX_TxtBreak::SetParagraphBreakChar(wchar_t wch) {
if (wch != L'\r' && wch != L'\n')
return;
m_wParagBreakChar = wch;
@@ -208,8 +208,8 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps) {
}
CFX_BreakType CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar) {
- FX_WCHAR wch = pCurChar->m_wCharCode;
- FX_WCHAR wForm;
+ wchar_t wch = pCurChar->m_wCharCode;
+ wchar_t wForm;
int32_t iCharWidth = 0;
pCurChar->m_iCharWidth = -1;
if (m_bCombText) {
@@ -221,7 +221,7 @@ CFX_BreakType CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar) {
(pLastChar->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicShadda) == 0) {
bool bShadda = false;
if (wch == 0x0651) {
- FX_WCHAR wLast = pLastChar->m_wCharCode;
+ wchar_t wLast = pLastChar->m_wCharCode;
if (wLast >= 0x064C && wLast <= 0x0650) {
wForm = FX_GetArabicFromShaddaTable(wLast);
bShadda = true;
@@ -257,7 +257,7 @@ CFX_BreakType CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar) {
m_eCharType = FX_CHARTYPE_Control;
CFX_BreakType dwRet = CFX_BreakType::None;
if (!m_bSingleLine) {
- FX_WCHAR wch = pCurChar->m_wCharCode;
+ wchar_t wch = pCurChar->m_wCharCode;
switch (wch) {
case L'\v':
case 0x2028:
@@ -283,7 +283,7 @@ CFX_BreakType CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar) {
CFX_BreakType CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar) {
FX_CHARTYPE chartype = pCurChar->GetCharType();
int32_t& iLineWidth = m_pCurLine->m_iWidth;
- FX_WCHAR wForm;
+ wchar_t wForm;
int32_t iCharWidth = 0;
CFX_Char* pLastChar = nullptr;
bool bAlef = false;
@@ -339,8 +339,8 @@ CFX_BreakType CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar) {
int32_t& iLineWidth = m_pCurLine->m_iWidth;
int32_t iCharWidth = 0;
m_eCharType = chartype;
- FX_WCHAR wch = pCurChar->m_wCharCode;
- FX_WCHAR wForm = wch;
+ wchar_t wch = pCurChar->m_wCharCode;
+ wchar_t wForm = wch;
if (m_bCombText) {
iCharWidth = m_iCombWidth;
@@ -363,7 +363,7 @@ CFX_BreakType CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar) {
return CFX_BreakType::None;
}
-CFX_BreakType CFX_TxtBreak::AppendChar(FX_WCHAR wch) {
+CFX_BreakType CFX_TxtBreak::AppendChar(wchar_t wch) {
uint32_t dwProps = kTextLayoutCodeProperties[static_cast<uint16_t>(wch)];
FX_CHARTYPE chartype = GetCharTypeFromProp(dwProps);
m_pCurLine->m_LineChars.emplace_back();
@@ -834,7 +834,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
CFDE_TxtEdtPage* pAccess = pTxtRun->pAccess;
const FDE_TEXTEDITPIECE* pIdentity = pTxtRun->pIdentity;
- const FX_WCHAR* pStr = pTxtRun->wsStr.c_str();
+ const wchar_t* pStr = pTxtRun->wsStr.c_str();
int32_t* pWidths = pTxtRun->pWidths;
int32_t iLength = pTxtRun->iLength - 1;
CFX_RetainPtr<CFGAS_GEFont> pFont = pTxtRun->pFont;
@@ -866,15 +866,15 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
int32_t iCount = 0;
int32_t iNext = 0;
- FX_WCHAR wPrev = 0xFEFF;
- FX_WCHAR wNext = 0xFEFF;
- FX_WCHAR wForm = 0xFEFF;
- FX_WCHAR wLast = 0xFEFF;
+ wchar_t wPrev = 0xFEFF;
+ wchar_t wNext = 0xFEFF;
+ wchar_t wForm = 0xFEFF;
+ wchar_t wLast = 0xFEFF;
bool bShadda = false;
bool bLam = false;
for (int32_t i = 0; i <= iLength; i++) {
int32_t iWidth;
- FX_WCHAR wch;
+ wchar_t wch;
if (pAccess) {
wch = pAccess->GetChar(pIdentity, i);
iWidth = pAccess->GetWidth(pIdentity, i);
@@ -1006,12 +1006,12 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
}
for (int32_t j = 0; j < iForms; j++) {
- wForm = (FX_WCHAR)formChars[j].wForm;
+ wForm = (wchar_t)formChars[j].wForm;
iCharWidth = formChars[j].iWidth;
if (j > 0) {
chartype = FX_CHARTYPE_Combination;
wch = wForm;
- wLast = (FX_WCHAR)formChars[j - 1].wForm;
+ wLast = (wchar_t)formChars[j - 1].wForm;
}
if (!bEmptyChar || (bEmptyChar && !bSkipSpace)) {
pCharPos->m_GlyphIndex =
@@ -1085,7 +1085,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
}
}
if (iWidth > 0)
- wPrev = static_cast<FX_WCHAR>(formChars[0].wch);
+ wPrev = static_cast<wchar_t>(formChars[0].wch);
wLast = wch;
}
return iCount;
@@ -1098,7 +1098,7 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
CFDE_TxtEdtPage* pAccess = pTxtRun->pAccess;
const FDE_TEXTEDITPIECE* pIdentity = pTxtRun->pIdentity;
- const FX_WCHAR* pStr = pTxtRun->wsStr.c_str();
+ const wchar_t* pStr = pTxtRun->wsStr.c_str();
int32_t* pWidths = pTxtRun->pWidths;
int32_t iLength = pTxtRun->iLength;
CFX_RectF rect(*pTxtRun->pRect);
@@ -1118,8 +1118,8 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
bool bRTLPiece = !!(pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel);
bool bSingleLine = !!(pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine);
bool bCombText = !!(pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText);
- FX_WCHAR wch;
- FX_WCHAR wLineBreakChar = pTxtRun->wLineBreakChar;
+ wchar_t wch;
+ wchar_t wLineBreakChar = pTxtRun->wLineBreakChar;
int32_t iCharSize;
FX_FLOAT fCharSize;
FX_FLOAT fStart = bRTLPiece ? rect.right() : rect.left;
diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h
index 9aa576f380..fd864f1296 100644
--- a/xfa/fgas/layout/fgas_textbreak.h
+++ b/xfa/fgas/layout/fgas_textbreak.h
@@ -61,7 +61,7 @@ struct FX_TXTRUN {
int32_t iVerticalScale;
uint32_t dwCharStyles;
const CFX_RectF* pRect;
- FX_WCHAR wLineBreakChar;
+ wchar_t wLineBreakChar;
bool bSkipSpace;
};
@@ -76,8 +76,8 @@ class CFX_TxtBreak {
void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
void SetFontSize(FX_FLOAT fFontSize);
void SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant);
- void SetDefaultChar(FX_WCHAR wch);
- void SetParagraphBreakChar(FX_WCHAR wch);
+ void SetDefaultChar(wchar_t wch);
+ void SetParagraphBreakChar(wchar_t wch);
void SetLineBreakTolerance(FX_FLOAT fTolerance);
void SetHorizontalScale(int32_t iScale);
void SetCharSpace(FX_FLOAT fCharSpace);
@@ -95,7 +95,7 @@ class CFX_TxtBreak {
std::vector<CFX_RectF> GetCharRects(const FX_TXTRUN* pTxtRun,
bool bCharBBox = false) const;
void AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps);
- CFX_BreakType AppendChar(FX_WCHAR wch);
+ CFX_BreakType AppendChar(wchar_t wch);
CFX_BreakType AppendChar_Combination(CFX_Char* pCurChar);
CFX_BreakType AppendChar_Tab(CFX_Char* pCurChar);
CFX_BreakType AppendChar_Control(CFX_Char* pCurChar);
@@ -133,8 +133,8 @@ class CFX_TxtBreak {
CFX_RetainPtr<CFGAS_GEFont> m_pFont;
int32_t m_iFontSize;
int32_t m_iTabWidth;
- FX_WCHAR m_wDefChar;
- FX_WCHAR m_wParagBreakChar;
+ wchar_t m_wDefChar;
+ wchar_t m_wParagBreakChar;
int32_t m_iDefChar;
int32_t m_iAlignment;
uint32_t m_dwContextCharStyles;
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index 7d538411f5..430215662e 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -23,7 +23,7 @@
struct FX_LOCALESUBCATEGORYINFO {
uint32_t uHash;
- const FX_WCHAR* pName;
+ const wchar_t* pName;
int32_t eSubCategory;
};
@@ -59,11 +59,11 @@ static const FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = {
{FXBSTR_ID(0, 'P', 'D', 'T'), -7, 0}, {FXBSTR_ID(0, 'P', 'S', 'T'), -8, 0},
};
-static const FX_WCHAR gs_wsTimeSymbols[] = L"hHkKMSFAzZ";
-static const FX_WCHAR gs_wsDateSymbols[] = L"DJMEeGgYwW";
-static const FX_WCHAR gs_wsConstChars[] = L",-:/. ";
+static const wchar_t gs_wsTimeSymbols[] = L"hHkKMSFAzZ";
+static const wchar_t gs_wsDateSymbols[] = L"DJMEeGgYwW";
+static const wchar_t gs_wsConstChars[] = L",-:/. ";
-static int32_t FX_ParseTimeZone(const FX_WCHAR* pStr,
+static int32_t FX_ParseTimeZone(const wchar_t* pStr,
int32_t iLen,
FX_TIMEZONE& tz) {
tz.tzHour = 0;
@@ -122,7 +122,7 @@ static bool FX_WStringToNumeric(const CFX_WideString& wsValue,
int32_t cc = 0;
bool bNegative = false;
bool bExpSign = false;
- const FX_WCHAR* str = wsValue.c_str();
+ const wchar_t* str = wsValue.c_str();
int32_t len = wsValue.GetLength();
while (cc < len && FXSYS_iswspace(str[cc]))
cc++;
@@ -270,9 +270,9 @@ void CFX_FormatString::SplitFormatString(
const CFX_WideString& wsFormatString,
std::vector<CFX_WideString>& wsPatterns) {
int32_t iStrLen = wsFormatString.GetLength();
- const FX_WCHAR* pStr = wsFormatString.c_str();
- const FX_WCHAR* pToken = pStr;
- const FX_WCHAR* pEnd = pStr + iStrLen;
+ const wchar_t* pStr = wsFormatString.c_str();
+ const wchar_t* pToken = pStr;
+ const wchar_t* pEnd = pStr + iStrLen;
bool iQuote = false;
while (true) {
if (pStr >= pEnd) {
@@ -289,7 +289,7 @@ void CFX_FormatString::SplitFormatString(
}
}
-static CFX_WideString FX_GetLiteralText(const FX_WCHAR* pStrPattern,
+static CFX_WideString FX_GetLiteralText(const wchar_t* pStrPattern,
int32_t& iPattern,
int32_t iLenPattern) {
CFX_WideString wsOutput;
@@ -314,7 +314,7 @@ static CFX_WideString FX_GetLiteralText(const FX_WCHAR* pStrPattern,
iPattern += 2;
int32_t i = 0;
while (iPattern < iLenPattern && i++ < 4) {
- FX_WCHAR ch = pStrPattern[iPattern++];
+ wchar_t ch = pStrPattern[iPattern++];
if ((ch >= '0' && ch <= '9')) {
iKeyValue = iKeyValue * 16 + ch - '0';
} else if ((ch >= 'a' && ch <= 'f')) {
@@ -324,7 +324,7 @@ static CFX_WideString FX_GetLiteralText(const FX_WCHAR* pStrPattern,
}
}
if (iKeyValue != 0) {
- wsOutput += (FX_WCHAR)(iKeyValue & 0x0000FFFF);
+ wsOutput += (wchar_t)(iKeyValue & 0x0000FFFF);
}
continue;
}
@@ -332,7 +332,7 @@ static CFX_WideString FX_GetLiteralText(const FX_WCHAR* pStrPattern,
}
return wsOutput;
}
-static CFX_WideString FX_GetLiteralTextReverse(const FX_WCHAR* pStrPattern,
+static CFX_WideString FX_GetLiteralTextReverse(const wchar_t* pStrPattern,
int32_t& iPattern) {
CFX_WideString wsOutput;
if (pStrPattern[iPattern] != '\'') {
@@ -356,7 +356,7 @@ static CFX_WideString FX_GetLiteralTextReverse(const FX_WCHAR* pStrPattern,
int32_t iLen = wsOutput.GetLength();
int32_t i = 1;
for (; i < iLen && i < 5; i++) {
- FX_WCHAR ch = wsOutput[i];
+ wchar_t ch = wsOutput[i];
if ((ch >= '0' && ch <= '9')) {
iKeyValue = iKeyValue * 16 + ch - '0';
} else if ((ch >= 'a' && ch <= 'f')) {
@@ -367,7 +367,7 @@ static CFX_WideString FX_GetLiteralTextReverse(const FX_WCHAR* pStrPattern,
}
if (iKeyValue != 0) {
wsOutput.Delete(0, i);
- wsOutput = (FX_WCHAR)(iKeyValue & 0x0000FFFF) + wsOutput;
+ wsOutput = (wchar_t)(iKeyValue & 0x0000FFFF) + wsOutput;
}
continue;
}
@@ -380,7 +380,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
- const FX_WCHAR* pStr = wsPattern.c_str();
+ const wchar_t* pStr = wsPattern.c_str();
bool bBraceOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
@@ -432,7 +432,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
}
return eCategory;
}
-static uint16_t FX_WStringToLCID(const FX_WCHAR* pstrLCID) {
+static uint16_t FX_WStringToLCID(const wchar_t* pstrLCID) {
if (!pstrLCID) {
return 0;
}
@@ -446,7 +446,7 @@ CFX_WideString CFX_FormatString::GetLocaleName(
const CFX_WideString& wsPattern) {
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
- const FX_WCHAR* pStr = wsPattern.c_str();
+ const wchar_t* pStr = wsPattern.c_str();
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
FX_GetLiteralText(pStr, ccf, iLenf);
@@ -468,7 +468,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern,
IFX_Locale* pLocale = nullptr;
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
- const FX_WCHAR* pStr = wsPattern.c_str();
+ const wchar_t* pStr = wsPattern.c_str();
bool bBrackOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
@@ -525,7 +525,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
IFX_Locale* pLocale = nullptr;
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
- const FX_WCHAR* pStr = wsPattern.c_str();
+ const wchar_t* pStr = wsPattern.c_str();
bool bFindDot = false;
bool bBrackOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
@@ -625,7 +625,7 @@ static bool FX_GetNumericDotIndex(const CFX_WideString& wsNum,
int32_t& iDotIndex) {
int32_t ccf = 0;
int32_t iLenf = wsNum.GetLength();
- const FX_WCHAR* pStr = wsNum.c_str();
+ const wchar_t* pStr = wsNum.c_str();
int32_t iLenDot = wsDotSymbol.GetLength();
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -657,9 +657,9 @@ bool CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
return false;
}
int32_t iText = 0, iPattern = 0;
- const FX_WCHAR* pStrText = wsSrcText.c_str();
+ const wchar_t* pStrText = wsSrcText.c_str();
int32_t iLenText = wsSrcText.GetLength();
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
switch (pStrPattern[iPattern]) {
@@ -741,9 +741,9 @@ bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
- const FX_WCHAR* str = wsSrcNum.c_str();
+ const wchar_t* str = wsSrcNum.c_str();
int len = wsSrcNum.GetLength();
- const FX_WCHAR* strf = wsNumFormat.c_str();
+ const wchar_t* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
double dbRetValue = 0;
double coeff = 1;
@@ -1449,9 +1449,9 @@ bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
- const FX_WCHAR* str = wsSrcNum.c_str();
+ const wchar_t* str = wsSrcNum.c_str();
int len = wsSrcNum.GetLength();
- const FX_WCHAR* strf = wsNumFormat.c_str();
+ const wchar_t* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
bool bHavePercentSymbol = false;
bool bNeg = false;
@@ -1915,7 +1915,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
- const FX_WCHAR* pStr = wsPattern.c_str();
+ const wchar_t* pStr = wsPattern.c_str();
int32_t iFindCategory = 0;
bool bBraceOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
@@ -2052,9 +2052,9 @@ static bool FX_ParseLocaleDate(const CFX_WideString& wsDate,
int32_t month = 1;
int32_t day = 1;
int32_t ccf = 0;
- const FX_WCHAR* str = wsDate.c_str();
+ const wchar_t* str = wsDate.c_str();
int32_t len = wsDate.GetLength();
- const FX_WCHAR* strf = wsDatePattern.c_str();
+ const wchar_t* strf = wsDatePattern.c_str();
int32_t lenf = wsDatePattern.GetLength();
CFX_WideStringC wsDateSymbols(gs_wsDateSymbols);
while (cc < len && ccf < lenf) {
@@ -2076,7 +2076,7 @@ static bool FX_ParseLocaleDate(const CFX_WideString& wsDate,
continue;
}
uint32_t dwSymbolNum = 1;
- FX_WCHAR dwCharSymbol = strf[ccf++];
+ wchar_t dwCharSymbol = strf[ccf++];
while (ccf < lenf && strf[ccf] == dwCharSymbol) {
ccf++;
dwSymbolNum++;
@@ -2270,9 +2270,9 @@ static bool FX_ParseLocaleTime(const CFX_WideString& wsTime,
uint8_t second = 0;
uint16_t millisecond = 0;
int32_t ccf = 0;
- const FX_WCHAR* str = wsTime.c_str();
+ const wchar_t* str = wsTime.c_str();
int len = wsTime.GetLength();
- const FX_WCHAR* strf = wsTimePattern.c_str();
+ const wchar_t* strf = wsTimePattern.c_str();
int lenf = wsTimePattern.GetLength();
bool bHasA = false;
bool bPM = false;
@@ -2296,7 +2296,7 @@ static bool FX_ParseLocaleTime(const CFX_WideString& wsTime,
continue;
}
uint32_t dwSymbolNum = 1;
- FX_WCHAR dwCharSymbol = strf[ccf++];
+ wchar_t dwCharSymbol = strf[ccf++];
while (ccf < lenf && strf[ccf] == dwCharSymbol) {
ccf++;
dwSymbolNum++;
@@ -2508,9 +2508,9 @@ bool CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText,
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, L"zero", wsTextFormat);
int32_t iText = 0, iPattern = 0;
- const FX_WCHAR* pStrText = wsSrcText.c_str();
+ const wchar_t* pStrText = wsSrcText.c_str();
int32_t iLenText = wsSrcText.GetLength();
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
@@ -2538,9 +2538,9 @@ bool CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText,
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, L"null", wsTextFormat);
int32_t iText = 0, iPattern = 0;
- const FX_WCHAR* pStrText = wsSrcText.c_str();
+ const wchar_t* pStrText = wsSrcText.c_str();
int32_t iLenText = wsSrcText.GetLength();
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
@@ -2576,8 +2576,8 @@ bool CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, L"text", wsTextFormat);
int32_t iText = 0, iPattern = 0;
- const FX_WCHAR* pStrText = wsSrcText.c_str();
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrText = wsSrcText.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
switch (pStrPattern[iPattern]) {
@@ -2632,7 +2632,7 @@ static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat,
int32_t iCount = wsFormat.GetLength();
int32_t iTreading = 0;
for (iDotPos++; iDotPos < iCount; iDotPos++) {
- FX_WCHAR wc = wsFormat[iDotPos];
+ wchar_t wc = wsFormat[iDotPos];
if (wc == L'z' || wc == L'9' || wc == 'Z') {
iTreading++;
bTrimTailZeros = (wc == L'9' ? false : true);
@@ -2655,7 +2655,7 @@ bool CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
return false;
}
int32_t cc = 0, ccf = 0;
- const FX_WCHAR* strf = wsNumFormat.c_str();
+ const wchar_t* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
CFX_WideString wsSrcNum(wsInputNum);
wsSrcNum.TrimLeft('0');
@@ -2725,7 +2725,7 @@ bool CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsSrcNum.Delete(0, 1);
}
bool bAddNeg = false;
- const FX_WCHAR* str = wsSrcNum.c_str();
+ const wchar_t* str = wsSrcNum.c_str();
int len = wsSrcNum.GetLength();
int dot_index = wsSrcNum.Find('.');
if (dot_index == -1) {
@@ -3088,7 +3088,7 @@ bool CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
return false;
}
int32_t cc = 0, ccf = 0;
- const FX_WCHAR* strf = wsNumFormat.c_str();
+ const wchar_t* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
double dbOrgRaw = lcNum.GetDouble();
double dbRetValue = dbOrgRaw;
@@ -3151,7 +3151,7 @@ bool CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsNumeric.Delete(0, 1);
}
bool bAddNeg = false;
- const FX_WCHAR* str = wsNumeric.c_str();
+ const wchar_t* str = wsNumeric.c_str();
int len = wsNumeric.GetLength();
int dot_index = wsNumeric.Find('.');
if (dot_index == -1) {
@@ -3507,7 +3507,7 @@ bool FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime) {
int32_t day = 1;
uint16_t wYear = 0;
int cc_start = 0, cc = 0;
- const FX_WCHAR* str = wsDate.c_str();
+ const wchar_t* str = wsDate.c_str();
int len = wsDate.GetLength();
if (len > 10) {
return false;
@@ -3590,7 +3590,7 @@ bool FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
uint8_t second = 0;
uint16_t millisecond = 0;
int cc_start = 0, cc = cc_start;
- const FX_WCHAR* str = wsTime.c_str();
+ const wchar_t* str = wsTime.c_str();
int len = wsTime.GetLength();
while (cc < len && cc < 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
@@ -3711,7 +3711,7 @@ static bool FX_DateFormat(const CFX_WideString& wsDatePattern,
uint8_t month = datetime.GetMonth();
uint8_t day = datetime.GetDay();
int32_t ccf = 0;
- const FX_WCHAR* strf = wsDatePattern.c_str();
+ const wchar_t* strf = wsDatePattern.c_str();
int32_t lenf = wsDatePattern.GetLength();
CFX_WideStringC wsDateSymbols(gs_wsDateSymbols);
while (ccf < lenf) {
@@ -3724,7 +3724,7 @@ static bool FX_DateFormat(const CFX_WideString& wsDatePattern,
continue;
}
uint32_t dwSymbolNum = 1;
- FX_WCHAR dwCharSymbol = strf[ccf++];
+ wchar_t dwCharSymbol = strf[ccf++];
while (ccf < lenf && strf[ccf] == dwCharSymbol) {
ccf++;
dwSymbolNum++;
@@ -3831,7 +3831,7 @@ static bool FX_TimeFormat(const CFX_WideString& wsTimePattern,
uint8_t second = datetime.GetSecond();
uint16_t millisecond = datetime.GetMillisecond();
int32_t ccf = 0;
- const FX_WCHAR* strf = wsTimePattern.c_str();
+ const wchar_t* strf = wsTimePattern.c_str();
int32_t lenf = wsTimePattern.GetLength();
uint16_t wHour = hour;
bool bPM = false;
@@ -3851,7 +3851,7 @@ static bool FX_TimeFormat(const CFX_WideString& wsTimePattern,
continue;
}
uint32_t dwSymbolNum = 1;
- FX_WCHAR dwCharSymbol = strf[ccf++];
+ wchar_t dwCharSymbol = strf[ccf++];
while (ccf < lenf && strf[ccf] == dwCharSymbol) {
ccf++;
dwSymbolNum++;
@@ -4081,7 +4081,7 @@ bool CFX_FormatString::FormatZero(const CFX_WideString& wsPattern,
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, L"zero", wsTextFormat);
int32_t iPattern = 0;
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
@@ -4103,7 +4103,7 @@ bool CFX_FormatString::FormatNull(const CFX_WideString& wsPattern,
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, L"null", wsTextFormat);
int32_t iPattern = 0;
- const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
+ const wchar_t* pStrPattern = wsTextFormat.c_str();
int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
@@ -4433,8 +4433,8 @@ CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale) {
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(val < 0 && IsNotZero(), scale);
}
CFX_Decimal::CFX_Decimal(const CFX_WideStringC& strObj) {
- const FX_WCHAR* str = strObj.c_str();
- const FX_WCHAR* strBound = str + strObj.GetLength();
+ const wchar_t* str = strObj.c_str();
+ const wchar_t* strBound = str + strObj.GetLength();
bool pointmet = 0;
bool negmet = 0;
uint8_t scale = 0;