From 3d328767f9c0c04b62173aac03c35aab3fb87ffe Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 24 Jan 2017 06:12:34 -0800 Subject: Use std::vector for CFX_RectF arrays Review-Url: https://codereview.chromium.org/2653743002 --- xfa/fde/tto/fde_textout.cpp | 6 +++--- xfa/fde/tto/fde_textout.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xfa/fde/tto') diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 4d207fb734..ca5aa566e1 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -814,8 +814,8 @@ int32_t CFDE_TextOut::GetDisplayPos(FDE_TTOPIECE* pPiece) { int32_t CFDE_TextOut::GetCharRects(const FDE_TTOPIECE* pPiece) { FX_TXTRUN tr = ToTextRun(pPiece); - m_rectArray.RemoveAll(); - return m_pTxtBreak->GetCharRects(&tr, m_rectArray); + m_rectArray.clear(); + return m_pTxtBreak->GetCharRects(&tr, &m_rectArray); } FX_TXTRUN CFDE_TextOut::ToTextRun(const FDE_TTOPIECE* pPiece) { @@ -886,7 +886,7 @@ void CFDE_TextOut::DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen) { int32_t iCharIndex = m_hotKeys.GetAt(i); if (iCharIndex >= pPiece->iStartChar && iCharIndex < pPiece->iStartChar + pPiece->iChars) { - CFX_RectF rect = m_rectArray.GetAt(iCharIndex - pPiece->iStartChar); + CFX_RectF rect = m_rectArray[iCharIndex - pPiece->iStartChar]; if (bVertical) { pt1.x = rect.left; pt1.y = rect.top; diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h index 084af42acf..e1eb71cf3b 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h @@ -180,7 +180,7 @@ class CFDE_TextOut { std::vector m_CharPos; std::unique_ptr m_pRenderDevice; CFX_ArrayTemplate m_hotKeys; - CFX_RectFArray m_rectArray; + std::vector m_rectArray; }; #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ -- cgit v1.2.3