summaryrefslogtreecommitdiff
path: root/xfa/fde/tto/fde_textout.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-03-13 12:08:31 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-13 16:28:00 +0000
commit8da79203b32d1a0df05a23da83044bdaf71c320d (patch)
tree8cbb0484f9e44a406c74e9b937c10b2afd248b76 /xfa/fde/tto/fde_textout.cpp
parent575898e6251c1dbb8de0d40a5b6ce90762aa2af2 (diff)
downloadpdfium-8da79203b32d1a0df05a23da83044bdaf71c320d.tar.xz
Simplify the CFX_TxtPiece class
This Cl removes unused methods and makes GetString return a CFX_WideString instead of taking an out parameter. Change-Id: I3d2fcbdf51e7619f4fa42e46a0c83fbfa1132a84 Reviewed-on: https://pdfium-review.googlesource.com/2950 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde/tto/fde_textout.cpp')
-rw-r--r--xfa/fde/tto/fde_textout.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index 55b1272e11..5c59b2c8d6 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -391,8 +391,7 @@ void CFDE_TextOut::RetrieveEllPieces(std::vector<int32_t>* pCharWidths) {
const CFX_TxtPiece* pPiece = m_pTxtBreak->GetBreakPiece(i);
int32_t iPieceChars = pPiece->GetLength();
for (int32_t j = 0; j < iPieceChars; j++) {
- CFX_Char* pTC = pPiece->GetCharPtr(j);
- (*pCharWidths)[iCharIndex] = std::max(pTC->m_iCharWidth, 0);
+ (*pCharWidths)[iCharIndex] = std::max(pPiece->GetChar(j).m_iCharWidth, 0);
m_iEllipsisWidth += (*pCharWidths)[iCharIndex];
iCharIndex++;
}
@@ -465,7 +464,6 @@ bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
bool bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
FX_FLOAT fLineStep =
(m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
- CFX_Char* pTC = nullptr;
bool bNeedReload = false;
FX_FLOAT fLineWidth = rect.Width();
int32_t iLineWidth = FXSYS_round(fLineWidth * 20000.0f);
@@ -477,8 +475,8 @@ bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
int32_t iWidth = 0;
int32_t j = 0;
for (; j < iPieceChars; j++) {
- pTC = pPiece->GetCharPtr(j);
- int32_t iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0;
+ const CFX_Char& pTC = pPiece->GetChar(j);
+ int32_t iCurCharWidth = pTC.m_iCharWidth > 0 ? pTC.m_iCharWidth : 0;
if (bSingleLine || !bLineWrap) {
if (iLineWidth - iPieceWidths - iWidth < iCurCharWidth) {
bNeedReload = true;