diff options
author | dan sinclair <dsinclair@chromium.org> | 2016-11-24 10:45:29 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2016-11-24 16:34:32 +0000 |
commit | 0354ccf37f05f25b1bf64fd60bb3b48efab4d7d0 (patch) | |
tree | 378745e450e4f02128ab6766d6ca71bd0b27f4ab /xfa/fwl/core/cfwl_edit.cpp | |
parent | 41ba08e5552c2eccad0c34024dc680feb3f2b251 (diff) | |
download | pdfium-0354ccf37f05f25b1bf64fd60bb3b48efab4d7d0.tar.xz |
Change TxtEdtEngine to return CFX_WideStringchromium/2935chromium/2934chromium/2933chromium/2932
This Cl updates the TxtEdtEngine and TxtEdtBuf to return CFX_WideStrings on
a Get instead of taking an out param. The change is propagated out through
the various Get methods that call into the edit engine.
Change-Id: Iccf10a8ee06678ae3b59f3afd6e65308dacd16bd
Reviewed-on: https://pdfium-review.googlesource.com/2070
Commit-Queue: ooo 11-24 -- 12-05 (dsinclair) <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fwl/core/cfwl_edit.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_edit.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/xfa/fwl/core/cfwl_edit.cpp b/xfa/fwl/core/cfwl_edit.cpp index 99cac68d57..4544ebcb82 100644 --- a/xfa/fwl/core/cfwl_edit.cpp +++ b/xfa/fwl/core/cfwl_edit.cpp @@ -113,8 +113,7 @@ void CFWL_Edit::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { int32_t iTextLen = m_EdtEngine.GetTextLength(); if (iTextLen > 0) { - CFX_WideString wsText; - m_EdtEngine.GetText(wsText, 0); + CFX_WideString wsText = m_EdtEngine.GetText(0); CFX_SizeF sz = CalcTextSize( wsText, m_pProperties->m_pThemeProvider, !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine)); @@ -212,8 +211,7 @@ void CFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics, FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX; FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; - CFX_WideString wsSpell; - GetText(wsSpell); + CFX_WideString wsSpell = GetText(); int32_t nContentLen = wsSpell.GetLength(); for (int i = 0; i < nContentLen; i++) { if (FX_EDIT_ISLATINWORD(wsSpell[i])) { @@ -300,10 +298,8 @@ int32_t CFWL_Edit::GetTextLength() const { return m_EdtEngine.GetTextLength(); } -void CFWL_Edit::GetText(CFX_WideString& wsText, - int32_t nStart, - int32_t nCount) const { - m_EdtEngine.GetText(wsText, nStart, nCount); +CFX_WideString CFWL_Edit::GetText(int32_t nStart, int32_t nCount) const { + return m_EdtEngine.GetText(nStart, nCount); } void CFWL_Edit::ClearText() { @@ -349,7 +345,7 @@ bool CFWL_Edit::Copy(CFX_WideString& wsCopy) { int32_t nStart, nLength; for (int32_t i = 0; i < nCount; i++) { nLength = m_EdtEngine.GetSelRange(i, nStart); - m_EdtEngine.GetText(wsTemp, nStart, nLength); + wsTemp = m_EdtEngine.GetText(nStart, nLength); wsCopy += wsTemp; wsTemp.clear(); } @@ -366,7 +362,7 @@ bool CFWL_Edit::Cut(CFX_WideString& wsCut) { int32_t nStart, nLength; for (int32_t i = 0; i < nCount; i++) { nLength = m_EdtEngine.GetSelRange(i, nStart); - m_EdtEngine.GetText(wsTemp, nStart, nLength); + wsTemp = m_EdtEngine.GetText(nStart, nLength); wsCut += wsTemp; wsTemp.clear(); } @@ -1232,8 +1228,7 @@ bool CFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) { if (!m_bSetRange) return true; - CFX_WideString wsOld, wsText; - m_EdtEngine.GetText(wsText, 0); + CFX_WideString wsText = m_EdtEngine.GetText(0); if (wsText.IsEmpty()) { if (cNum == L'0') return false; |