summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-13 16:43:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 14:14:51 +0000
commit812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 (patch)
treef0b0607f6b757eb22237527215094bd87b5d03ba /xfa/fgas/layout
parent893822aa5b6254591f8e80fbffcbb4fa6ad849aa (diff)
downloadpdfium-812e96c2b4c5908a1979da5e27cdcecda0d1dfc9.tar.xz
Replace FX_CHAR and FX_WCHAR with underlying types.
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/layout')
-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
6 files changed, 43 insertions, 43 deletions
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;