summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/cxfa_textlayout.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-01 11:23:14 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-01 20:44:33 +0000
commitbef73893d919514110cf3b724fad88965d9399e7 (patch)
tree9075f0562dd31886bc8409b3e7de25887d690a00 /xfa/fxfa/app/cxfa_textlayout.cpp
parentb4a261855b34b4c8d938118762ae609a34a3ae99 (diff)
downloadpdfium-bef73893d919514110cf3b724fad88965d9399e7.tar.xz
Return values instead of out params
This Cl converts CFX_RTFPiece::GetString and CFX_RTFPiece::GetWidths to return CFX_WideString and std::vector<int32_t> respectively instead of taking pointers out parameters. Change-Id: Ie153caa0336861b3efa9b8ce26f75f0e019526e9 Reviewed-on: https://pdfium-review.googlesource.com/2882 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/cxfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/app/cxfa_textlayout.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fxfa/app/cxfa_textlayout.cpp b/xfa/fxfa/app/cxfa_textlayout.cpp
index 9735dc7b13..715dbb32dd 100644
--- a/xfa/fxfa/app/cxfa_textlayout.cpp
+++ b/xfa/fxfa/app/cxfa_textlayout.cpp
@@ -999,10 +999,10 @@ void CXFA_TextLayout::DoTabstops(CFDE_CSSComputedStyle* pStyle,
} else if (dwAlign == FX_HashCode_GetW(L"decimal", false)) {
int32_t iChars = pPiece->iChars;
for (int32_t i = 0; i < iChars; i++) {
- if (pPiece->pszText[i] == L'.')
+ if (pPiece->szText[i] == L'.')
break;
- fLeft += pPiece->pWidths[i] / 20000.0f;
+ fLeft += pPiece->Widths[i] / 20000.0f;
}
}
m_pTabstopContext->m_fLeft =
@@ -1041,11 +1041,9 @@ void CXFA_TextLayout::AppendTextLine(CFX_RTFBreakType dwStatus,
FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f;
auto pTP = pdfium::MakeUnique<XFA_TextPiece>();
- pTP->pszText = FX_Alloc(FX_WCHAR, pPiece->m_iChars);
- pTP->pWidths = FX_Alloc(int32_t, pPiece->m_iChars);
pTP->iChars = pPiece->m_iChars;
- pPiece->GetString(pTP->pszText);
- pPiece->GetWidths(pTP->pWidths);
+ pTP->szText = pPiece->GetString();
+ pTP->Widths = pPiece->GetWidths();
pTP->iBidiLevel = pPiece->m_iBidiLevel;
pTP->iHorScale = pPiece->m_iHorizontalScale;
pTP->iVerScale = pPiece->m_iVerticalScale;
@@ -1301,10 +1299,10 @@ bool CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ* tr) {
if (iLength < 1)
return false;
- tr->pStr = pPiece->pszText;
+ tr->pStr = pPiece->szText;
tr->pFont = pPiece->pFont;
tr->pRect = &pPiece->rtPiece;
- tr->pWidths = pPiece->pWidths;
+ tr->pWidths = pPiece->Widths;
tr->iLength = iLength;
tr->fFontSize = pPiece->fFontSize;
tr->iBidiLevel = pPiece->iBidiLevel;