From 812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 13 Mar 2017 16:43:37 -0400 Subject: Replace FX_CHAR and FX_WCHAR with underlying types. Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fde/tto/fde_textout.cpp | 44 ++++++++++++++++++++++---------------------- xfa/fde/tto/fde_textout.h | 29 +++++++++++++---------------- 2 files changed, 35 insertions(+), 38 deletions(-) (limited to 'xfa/fde/tto') diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 02b1522823..36f341b39c 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -82,7 +82,7 @@ void CFDE_TextOut::SetEllipsisString(const CFX_WideString& wsEllipsis) { m_wsEllipsis = wsEllipsis; } -void CFDE_TextOut::SetParagraphBreakChar(FX_WCHAR wch) { +void CFDE_TextOut::SetParagraphBreakChar(wchar_t wch) { m_wParagraphBkChar = wch; m_pTxtBreak->SetParagraphBreakChar(wch); } @@ -151,7 +151,7 @@ int32_t CFDE_TextOut::GetTotalLines() { return m_iTotalLines; } -void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, +void CFDE_TextOut::CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_SizeF& size) { CFX_RectF rtText(0.0f, 0.0f, size.width, size.height); @@ -159,7 +159,7 @@ void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, size = rtText.Size(); } -void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, +void CFDE_TextOut::CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect) { if (!pwsStr || iLength < 1) { @@ -170,21 +170,21 @@ void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, } } -void CFDE_TextOut::CalcTextSize(const FX_WCHAR* pwsStr, +void CFDE_TextOut::CalcTextSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect) { ASSERT(m_pFont && m_fFontSize >= 1.0f); SetLineWidth(rect); m_iTotalLines = 0; - const FX_WCHAR* pStr = pwsStr; + const wchar_t* pStr = pwsStr; bool bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey); FX_FLOAT fWidth = 0.0f; FX_FLOAT fHeight = 0.0f; FX_FLOAT fStartPos = rect.right(); CFX_BreakType dwBreakStatus = CFX_BreakType::None; - FX_WCHAR wPreChar = 0; - FX_WCHAR wch; - FX_WCHAR wBreak = 0; + wchar_t wPreChar = 0; + wchar_t wch; + wchar_t wBreak = 0; while (iLength-- > 0) { wch = *pStr++; if (wBreak == 0 && (wch == L'\n' || wch == L'\r')) { @@ -264,7 +264,7 @@ bool CFDE_TextOut::RetrieveLineWidth(CFX_BreakType dwBreakStatus, return true; } -void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawText(const wchar_t* pwsStr, int32_t iLength, int32_t x, int32_t y) { @@ -273,7 +273,7 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, DrawText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawText(const wchar_t* pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) { @@ -281,13 +281,13 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, CFX_RectF(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f)); } -void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_Rect& rect) { DrawText(pwsStr, iLength, rect.As()); } -void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect) { CFX_RectF rtText(rect.left, rect.top, rect.width, rect.height); @@ -297,7 +297,7 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, DrawText(pwsStr, iLength, rtText, m_rtClip); } -void CFDE_TextOut::DrawLogicText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawLogicText(const wchar_t* pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) { @@ -305,7 +305,7 @@ void CFDE_TextOut::DrawLogicText(const FX_WCHAR* pwsStr, DrawLogicText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawLogicText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawLogicText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect) { CFX_RectF rtClip(m_rtLogicClip.left, m_rtLogicClip.top, m_rtLogicClip.width, @@ -314,7 +314,7 @@ void CFDE_TextOut::DrawLogicText(const FX_WCHAR* pwsStr, DrawText(pwsStr, iLength, rect, rtClip); } -void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect, const CFX_RectF& rtClip) { @@ -367,9 +367,9 @@ void CFDE_TextOut::LoadEllipsis() { return; } ExpandBuffer(iLength, 1); - const FX_WCHAR* pStr = m_wsEllipsis.c_str(); + const wchar_t* pStr = m_wsEllipsis.c_str(); CFX_BreakType dwBreakStatus; - FX_WCHAR wch; + wchar_t wch; while (iLength-- > 0) { wch = *pStr++; dwBreakStatus = m_pTxtBreak->AppendChar(wch); @@ -399,10 +399,10 @@ void CFDE_TextOut::RetrieveEllPieces(std::vector* pCharWidths) { m_pTxtBreak->ClearBreakPieces(); } -void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr, +void CFDE_TextOut::LoadText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect) { - FX_WCHAR* pStr = m_wsText.GetBuffer(iLength); + wchar_t* pStr = m_wsText.GetBuffer(iLength); int32_t iTxtLength = iLength; ExpandBuffer(iTxtLength, 0); bool bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey); @@ -416,7 +416,7 @@ void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr, int32_t iChars = 0; int32_t iPieceWidths = 0; CFX_BreakType dwBreakStatus; - FX_WCHAR wch; + wchar_t wch; bool bRet = false; while (iTxtLength-- > 0) { wch = *pwsStr++; @@ -591,7 +591,7 @@ void CFDE_TextOut::Reload(const CFX_RectF& rect) { } void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) { - const FX_WCHAR* pwsStr = m_wsText.c_str(); + const wchar_t* pwsStr = m_wsText.c_str(); int32_t iPieceWidths = 0; FDE_TTOPIECE* pPiece = pLine->GetPtrAt(0); int32_t iStartChar = pPiece->iStartChar; @@ -599,7 +599,7 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) { int32_t iPieceCount = pLine->GetSize(); int32_t iPieceIndex = 0; CFX_BreakType dwBreakStatus = CFX_BreakType::None; - FX_WCHAR wch; + wchar_t wch; while (iPieceIndex < iPieceCount) { int32_t iStar = iStartChar; int32_t iEnd = pPiece->iChars + iStar; diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h index 1519a81e8f..224a584a4e 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h @@ -84,7 +84,7 @@ class CFDE_TextOut { void SetStyles(uint32_t dwStyles); void SetTabWidth(FX_FLOAT fTabWidth); void SetEllipsisString(const CFX_WideString& wsEllipsis); - void SetParagraphBreakChar(FX_WCHAR wch); + void SetParagraphBreakChar(wchar_t wch); void SetAlignment(int32_t iAlignment); void SetLineSpace(FX_FLOAT fLineSpace); void SetDIBitmap(CFX_DIBitmap* pDIB); @@ -94,38 +94,35 @@ class CFDE_TextOut { void SetMatrix(const CFX_Matrix& matrix); void SetLineBreakTolerance(FX_FLOAT fTolerance); - void DrawText(const FX_WCHAR* pwsStr, int32_t iLength, int32_t x, int32_t y); - void DrawText(const FX_WCHAR* pwsStr, - int32_t iLength, - FX_FLOAT x, - FX_FLOAT y); - void DrawText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_Rect& rect); - void DrawText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); + void DrawText(const wchar_t* pwsStr, int32_t iLength, int32_t x, int32_t y); + void DrawText(const wchar_t* pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y); + void DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_Rect& rect); + void DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect); void SetLogicClipRect(const CFX_RectF& rtClip); - void CalcLogicSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_SizeF& size); - void CalcLogicSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect); - void DrawLogicText(const FX_WCHAR* pwsStr, + void CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_SizeF& size); + void CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect); + void DrawLogicText(const wchar_t* pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y); - void DrawLogicText(const FX_WCHAR* pwsStr, + void DrawLogicText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect); int32_t GetTotalLines(); protected: - void CalcTextSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect); + void CalcTextSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect); bool RetrieveLineWidth(CFX_BreakType dwBreakStatus, FX_FLOAT& fStartPos, FX_FLOAT& fWidth, FX_FLOAT& fHeight); void SetLineWidth(CFX_RectF& rect); - void DrawText(const FX_WCHAR* pwsStr, + void DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect, const CFX_RectF& rtClip); - void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); + void LoadText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect); void LoadEllipsis(); void ExpandBuffer(int32_t iSize, int32_t iType); void RetrieveEllPieces(std::vector* pCharWidths); @@ -157,7 +154,7 @@ class CFDE_TextOut { int32_t m_iTxtBkAlignment; std::vector m_CharWidths; std::vector m_EllCharWidths; - FX_WCHAR m_wParagraphBkChar; + wchar_t m_wParagraphBkChar; FX_ARGB m_TxtColor; uint32_t m_dwStyles; uint32_t m_dwTxtBkStyles; -- cgit v1.2.3