diff options
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/cfde_txtedtpage.cpp | 4 | ||||
-rw-r--r-- | xfa/fde/tto/fde_textout.cpp | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp index 7a2cb1b18d..fd44b28ef2 100644 --- a/xfa/fde/cfde_txtedtpage.cpp +++ b/xfa/fde/cfde_txtedtpage.cpp @@ -344,8 +344,8 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, nPieceStart += TxtEdtPiece.nCount; m_Pieces.push_back(TxtEdtPiece); for (int32_t k = 0; k < TxtEdtPiece.nCount; k++) { - CFX_Char* ptc = pPiece->GetCharPtr(k); - m_CharWidths[TxtEdtPiece.nStart + k] = ptc->m_iCharWidth; + m_CharWidths[TxtEdtPiece.nStart + k] = + pPiece->GetChar(k).m_iCharWidth; } } fLinePos += fLineStep; 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; |