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/fgas/layout/fgas_textbreak.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xfa/fgas/layout/fgas_textbreak.cpp') diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 35984f5017..50e3b063fd 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -1588,7 +1588,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, } int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun, - CFX_RectFArray& rtArray, + std::vector* rtArray, bool bCharBBox) const { if (!pTxtRun || pTxtRun->iLength < 1) return 0; @@ -1614,8 +1614,8 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun, FX_FLOAT fLeft = std::max(0.0f, bbox.left * fScale); FX_FLOAT fHeight = FXSYS_fabs(bbox.height * fScale); - rtArray.RemoveAll(); - rtArray.SetSize(iLength); + rtArray->clear(); + rtArray->resize(iLength); bool bVertical = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0; bool bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0; bool bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0; @@ -1689,10 +1689,10 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun, rtBBoxF.height = fHeight; rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); } - rtArray.SetAt(i, rtBBoxF); + (*rtArray)[i] = rtBBoxF; continue; } - rtArray.SetAt(i, rect); + (*rtArray)[i] = rect; } return iLength; } -- cgit v1.2.3