From 38eaf4b11383e24a00192132b683cc07e38622a6 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 15 Nov 2016 12:33:06 -0800 Subject: Cleanup cfwl_* files. This Cl cleans up the visibility, method usage and return values in the remaining CFWL files. Review-Url: https://codereview.chromium.org/2498163002 --- xfa/fde/cfde_txtedtengine.cpp | 12 ++++++------ xfa/fde/cfde_txtedtengine.h | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'xfa/fde') diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index a4cfab2983..e0e788144a 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -160,11 +160,11 @@ int32_t CFDE_TxtEdtEngine::GetTextLength() const { void CFDE_TxtEdtEngine::GetText(CFX_WideString& wsText, int32_t nStart, - int32_t nCount) { + int32_t nCount) const { int32_t nTextBufLength = GetTextBufLength(); - if (nCount == -1) { + if (nCount == -1) nCount = nTextBufLength - nStart; - } + m_pTxtBuf->GetRange(wsText, nStart, nCount); RecoverParagEnd(wsText); } @@ -646,11 +646,11 @@ void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount) { m_Param.pEventSink->On_SelChanged(this); } -int32_t CFDE_TxtEdtEngine::CountSelRanges() { +int32_t CFDE_TxtEdtEngine::CountSelRanges() const { return m_SelRangePtrArr.GetSize(); } -int32_t CFDE_TxtEdtEngine::GetSelRange(int32_t nIndex, int32_t& nStart) { +int32_t CFDE_TxtEdtEngine::GetSelRange(int32_t nIndex, int32_t& nStart) const { nStart = m_SelRangePtrArr[nIndex]->nStart; return m_SelRangePtrArr[nIndex]->nCount; } @@ -1190,7 +1190,7 @@ bool CFDE_TxtEdtEngine::ReplaceParagEnd(FX_WCHAR*& lpText, return bPreIsCR; } -void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) { +void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) const { FX_WCHAR wc = (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CR) ? L'\n' : L'\r'; if (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CRLF) { CFX_ArrayTemplate PosArr; diff --git a/xfa/fde/cfde_txtedtengine.h b/xfa/fde/cfde_txtedtengine.h index 8f0e855f52..587402d414 100644 --- a/xfa/fde/cfde_txtedtengine.h +++ b/xfa/fde/cfde_txtedtengine.h @@ -31,7 +31,9 @@ class CFDE_TxtEdtEngine { void SetTextByStream(IFX_Stream* pStream); void SetText(const CFX_WideString& wsText); int32_t GetTextLength() const; - void GetText(CFX_WideString& wsText, int32_t nStart, int32_t nCount = -1); + void GetText(CFX_WideString& wsText, + int32_t nStart, + int32_t nCount = -1) const; void ClearText(); int32_t GetCaretRect(CFX_RectF& rtCaret) const; @@ -57,8 +59,8 @@ class CFDE_TxtEdtEngine { void RemoveSelRange(int32_t nStart, int32_t nCount = -1); void AddSelRange(int32_t nStart, int32_t nCount = -1); - int32_t CountSelRanges(); - int32_t GetSelRange(int32_t nIndex, int32_t& nStart); + int32_t CountSelRanges() const; + int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const; void ClearSelection(); bool Redo(const IFDE_TxtEdtDoRecord* pRecord); @@ -126,7 +128,7 @@ class CFDE_TxtEdtEngine { bool ReplaceParagEnd(FX_WCHAR*& lpText, int32_t& nLength, bool bPreIsCR = false); - void RecoverParagEnd(CFX_WideString& wsText); + void RecoverParagEnd(CFX_WideString& wsText) const; int32_t MovePage2Char(int32_t nIndex); void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const; int32_t MoveForward(bool& bBefore); -- cgit v1.2.3