Chromium Code Reviews| Index: xfa/fee/fde_txtedtengine.cpp |
| diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp |
| index 98d7841b40d1ae0802ce669cb9b4aba867f73497..221957b19cb5c35abdb9ec4b6f044bb8ded7ce93 100644 |
| --- a/xfa/fee/fde_txtedtengine.cpp |
| +++ b/xfa/fee/fde_txtedtengine.cpp |
| @@ -9,11 +9,10 @@ |
| #include <algorithm> |
| #include "xfa/fde/tto/fde_textout.h" |
| -#include "xfa/fee/fde_txtedtbuf.h" |
| #include "xfa/fee/fde_txtedtparag.h" |
| -#include "xfa/fee/ifde_txtedtbuf.h" |
| #include "xfa/fee/ifde_txtedtengine.h" |
| #include "xfa/fee/ifde_txtedtpage.h" |
| +#include "xfa/fwl/basewidget/fwl_editimp.h" |
| #define FDE_PAGEWIDTH_MAX 0xFFFF |
| #define FDE_TXTPLATESIZE (1024 * 12) |
| @@ -21,9 +20,6 @@ |
| #define FDE_TXTEDT_DORECORD_INS 0 |
| #define FDE_TXTEDT_DORECORD_DEL 1 |
| -IFDE_TxtEdtEngine* IFDE_TxtEdtEngine::Create() { |
| - return new CFDE_TxtEdtEngine(); |
| -} |
| CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() |
| : m_pTextBreak(nullptr), |
| m_nPageLineCount(20), |
| @@ -71,7 +67,7 @@ void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { |
| m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); |
| UpdateTxtBreak(); |
| } |
| -const FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() const { |
| +FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() { |
| return &m_Param; |
| } |
| int32_t CFDE_TxtEdtEngine::CountPages() const { |
| @@ -329,7 +325,7 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart, |
| int32_t nTotalLength = GetTextBufLength(); |
| int32_t nCount = m_SelRangePtrArr.GetSize(); |
| for (int32_t i = 0; i < nCount; i++) { |
| - FDE_LPTXTEDTSELRANGE lpSelRange = m_SelRangePtrArr.GetAt(i); |
| + FDE_TXTEDTSELRANGE* lpSelRange = m_SelRangePtrArr.GetAt(i); |
| nTotalLength -= lpSelRange->nCount; |
| } |
| int32_t nExpectLength = nTotalLength + nLength; |
| @@ -538,7 +534,7 @@ void CFDE_TxtEdtEngine::SetAliasChar(FX_WCHAR wcAlias) { |
| } |
| void CFDE_TxtEdtEngine::RemoveSelRange(int32_t nStart, int32_t nCount) { |
| - FDE_LPTXTEDTSELRANGE lpTemp = NULL; |
| + FDE_TXTEDTSELRANGE* lpTemp = nullptr; |
| int32_t nRangeCount = m_SelRangePtrArr.GetSize(); |
| int32_t i = 0; |
| for (i = 0; i < nRangeCount; i++) { |
| @@ -557,17 +553,17 @@ void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount) { |
| } |
| int32_t nSize = m_SelRangePtrArr.GetSize(); |
| if (nSize <= 0) { |
| - FDE_LPTXTEDTSELRANGE lpSelRange = new FDE_TXTEDTSELRANGE; |
| + FDE_TXTEDTSELRANGE* lpSelRange = new FDE_TXTEDTSELRANGE; |
| lpSelRange->nStart = nStart; |
| lpSelRange->nCount = nCount; |
| m_SelRangePtrArr.Add(lpSelRange); |
| m_Param.pEventSink->On_SelChanged(this); |
| return; |
| } |
| - FDE_LPTXTEDTSELRANGE lpTemp = NULL; |
| + FDE_TXTEDTSELRANGE* lpTemp = nullptr; |
| lpTemp = m_SelRangePtrArr[nSize - 1]; |
| if (nStart >= lpTemp->nStart + lpTemp->nCount) { |
| - FDE_LPTXTEDTSELRANGE lpSelRange = new FDE_TXTEDTSELRANGE; |
| + FDE_TXTEDTSELRANGE* lpSelRange = new FDE_TXTEDTSELRANGE; |
| lpSelRange->nStart = nStart; |
| lpSelRange->nCount = nCount; |
| m_SelRangePtrArr.Add(lpSelRange); |
| @@ -602,7 +598,7 @@ void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount) { |
| } |
| } |
| if (nRangeCnt == 0) { |
| - FDE_LPTXTEDTSELRANGE lpSelRange = new FDE_TXTEDTSELRANGE; |
| + FDE_TXTEDTSELRANGE* lpSelRange = new FDE_TXTEDTSELRANGE; |
| lpSelRange->nStart = nStart; |
| lpSelRange->nCount = nCount; |
| m_SelRangePtrArr.InsertAt(nRangeBgn, lpSelRange); |
| @@ -629,13 +625,13 @@ int32_t CFDE_TxtEdtEngine::GetSelRange(int32_t nIndex, int32_t& nStart) { |
| } |
| void CFDE_TxtEdtEngine::ClearSelection() { |
| int32_t nCount = m_SelRangePtrArr.GetSize(); |
| - FDE_LPTXTEDTSELRANGE lpRange = NULL; |
| + FDE_TXTEDTSELRANGE* lpRange = nullptr; |
| int32_t i = 0; |
| for (i = 0; i < nCount; i++) { |
| lpRange = m_SelRangePtrArr[i]; |
| - if (lpRange != NULL) { |
| + if (lpRange) { |
| delete lpRange; |
| - lpRange = NULL; |
| + lpRange = nullptr; |
| } |
| } |
| m_SelRangePtrArr.RemoveAll(); |
| @@ -689,7 +685,7 @@ int32_t CFDE_TxtEdtEngine::DoLayout(IFX_Pause* pPause) { |
| for (; m_nLayoutPos < nCount; m_nLayoutPos++) { |
| pParag = m_ParagPtrArray[m_nLayoutPos]; |
| pParag->CalcLines(); |
| - nLineCount += pParag->m_nLineCount; |
| + nLineCount += pParag->GetLineCount(); |
| if ((pPause != NULL) && (nLineCount > m_nPageLineCount) && |
| pPause->NeedToPauseNow()) { |
| m_nLineCount += nLineCount; |
| @@ -715,8 +711,8 @@ void CFDE_TxtEdtEngine::EndLayout() { |
| FX_BOOL CFDE_TxtEdtEngine::Optimize(IFX_Pause* pPause) { |
| return m_pTxtBuf->Optimize(pPause); |
| } |
| -IFDE_TxtEdtBuf* CFDE_TxtEdtEngine::GetTextBuf() const { |
| - return (IFDE_TxtEdtBuf*)m_pTxtBuf; |
| +CFDE_TxtEdtBuf* CFDE_TxtEdtEngine::GetTextBuf() const { |
| + return m_pTxtBuf; |
| } |
| int32_t CFDE_TxtEdtEngine::GetTextBufLength() const { |
| return m_pTxtBuf->GetTextLength() - 1; |
| @@ -733,7 +729,7 @@ int32_t CFDE_TxtEdtEngine::GetPageLineCount() const { |
| int32_t CFDE_TxtEdtEngine::CountParags() const { |
| return m_ParagPtrArray.GetSize(); |
| } |
| -IFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(int32_t nParagIndex) const { |
| +CFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(int32_t nParagIndex) const { |
| return m_ParagPtrArray[nParagIndex]; |
| } |
| IFX_CharIter* CFDE_TxtEdtEngine::CreateCharIter() { |
| @@ -752,12 +748,12 @@ int32_t CFDE_TxtEdtEngine::Line2Parag(int32_t nStartParag, |
| int32_t i = nStartParag; |
| for (; i < nCount; i++) { |
| pParag = m_ParagPtrArray[i]; |
| - nLineTotal += pParag->m_nLineCount; |
| + nLineTotal += pParag->GetLineCount(); |
| if (nLineTotal > nLineIndex) { |
| break; |
| } |
| } |
| - nStartLine = nLineTotal - pParag->m_nLineCount; |
| + nStartLine = nLineTotal - pParag->GetLineCount(); |
| return i; |
| } |
| void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString& wsText, |
| @@ -818,14 +814,15 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, |
| m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); |
| int32_t nParagCount = m_ParagPtrArray.GetSize(); |
| int32_t i = 0; |
| - for (i = ParagPos.nParagIndex + 1; i < nParagCount; i++) { |
| - m_ParagPtrArray[i]->m_nCharStart += nLength; |
| - } |
| + for (i = ParagPos.nParagIndex + 1; i < nParagCount; i++) |
| + m_ParagPtrArray[i]->SetStartIndex(m_ParagPtrArray[i]->GetStartIndex() + |
| + nLength); |
| + |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex]; |
| - int32_t nReserveLineCount = pParag->m_nLineCount; |
| - int32_t nReserveCharStart = pParag->m_nCharStart; |
| + int32_t nReserveLineCount = pParag->GetLineCount(); |
| + int32_t nReserveCharStart = pParag->GetStartIndex(); |
| int32_t nLeavePart = ParagPos.nCharIndex; |
| - int32_t nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex; |
| + int32_t nCutPart = pParag->GetTextLength() - ParagPos.nCharIndex; |
| int32_t nTextStart = 0; |
| FX_WCHAR wCurChar = L' '; |
| const FX_WCHAR* lpPos = lpText; |
| @@ -835,30 +832,30 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, |
| wCurChar = *lpPos; |
| if (wCurChar == m_wLineEnd) { |
| if (bFirst) { |
| - pParag->m_nCharCount = nLeavePart + (i - nTextStart + 1); |
| - pParag->m_nLineCount = -1; |
| - nReserveCharStart += pParag->m_nCharCount; |
| + pParag->SetTextLength(nLeavePart + (i - nTextStart + 1)); |
| + pParag->SetLineCount(-1); |
| + nReserveCharStart += pParag->GetTextLength(); |
| bFirst = FALSE; |
| } else { |
| pParag = new CFDE_TxtEdtParag(this); |
| - pParag->m_nLineCount = -1; |
| - pParag->m_nCharCount = i - nTextStart + 1; |
| - pParag->m_nCharStart = nReserveCharStart; |
| + pParag->SetLineCount(-1); |
| + pParag->SetTextLength(i - nTextStart + 1); |
| + pParag->SetStartIndex(nReserveCharStart); |
| m_ParagPtrArray.InsertAt(++nParagIndex, pParag); |
| - nReserveCharStart += pParag->m_nCharCount; |
| + nReserveCharStart += pParag->GetTextLength(); |
| } |
| nTextStart = i + 1; |
| } |
| } |
| if (bFirst) { |
| - pParag->m_nCharCount += nLength; |
| - pParag->m_nLineCount = -1; |
| + pParag->SetTextLength(pParag->GetTextLength() + nLength); |
| + pParag->SetLineCount(-1); |
| bFirst = FALSE; |
| } else { |
| pParag = new CFDE_TxtEdtParag(this); |
| - pParag->m_nLineCount = -1; |
| - pParag->m_nCharCount = nLength - nTextStart + nCutPart; |
| - pParag->m_nCharStart = nReserveCharStart; |
| + pParag->SetLineCount(-1); |
| + pParag->SetTextLength(nLength - nTextStart + nCutPart); |
| + pParag->SetStartIndex(nReserveCharStart); |
| m_ParagPtrArray.InsertAt(++nParagIndex, pParag); |
| } |
| m_pTxtBuf->Insert(nStart, lpText, nLength); |
| @@ -866,7 +863,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, |
| for (i = ParagPos.nParagIndex; i <= nParagIndex; i++) { |
| pParag = m_ParagPtrArray[i]; |
| pParag->CalcLines(); |
| - nTotalLineCount += pParag->m_nLineCount; |
| + nTotalLineCount += pParag->GetLineCount(); |
| } |
| m_nLineCount += nTotalLineCount - nReserveLineCount; |
| m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0); |
| @@ -885,7 +882,7 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) { |
| TextPos2ParagPos(nEnd, ParagPosEnd); |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPosEnd.nParagIndex]; |
| FX_BOOL bLastParag = FALSE; |
| - if (ParagPosEnd.nCharIndex == pParag->m_nCharCount - 1) { |
| + if (ParagPosEnd.nCharIndex == pParag->GetTextLength() - 1) { |
| if (ParagPosEnd.nParagIndex < m_ParagPtrArray.GetSize() - 1) { |
| ParagPosEnd.nParagIndex++; |
| } else { |
| @@ -898,8 +895,8 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) { |
| for (i = ParagPosBgn.nParagIndex; i <= ParagPosEnd.nParagIndex; i++) { |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[i]; |
| pParag->CalcLines(); |
| - nTotalLineCount += pParag->m_nLineCount; |
| - nTotalCharCount += pParag->m_nCharCount; |
| + nTotalLineCount += pParag->GetLineCount(); |
| + nTotalCharCount += pParag->GetTextLength(); |
| } |
| m_pTxtBuf->Delete(nStart, nCount); |
| int32_t nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) |
| @@ -912,13 +909,14 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) { |
| } |
| if (!(bLastParag && ParagPosBgn.nCharIndex == 0)) { |
| pParag = m_ParagPtrArray[ParagPosBgn.nParagIndex]; |
| - pParag->m_nCharCount = nTotalCharCount - nCount; |
| + pParag->SetTextLength(nTotalCharCount - nCount); |
| pParag->CalcLines(); |
| - nTotalLineCount -= pParag->m_nLineCount; |
| + nTotalLineCount -= pParag->GetTextLength(); |
| } |
| int32_t nParagCount = m_ParagPtrArray.GetSize(); |
| for (i = nNextParagIndex; i < nParagCount; i++) { |
| - m_ParagPtrArray[i]->m_nCharStart -= nCount; |
| + m_ParagPtrArray[i]->SetStartIndex(m_ParagPtrArray[i]->GetStartIndex() - |
|
Tom Sepez
2016/04/29 15:36:23
Feels like we should have incrementStatIndex and d
dsinclair
2016/05/02 13:36:50
Done.
|
| + nCount); |
| } |
| m_nLineCount -= nTotalLineCount; |
| UpdatePages(); |
| @@ -971,9 +969,9 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() { |
| nIndex = pIter->GetAt(); |
| if (wChar == m_wLineEnd) { |
| CFDE_TxtEdtParag* pParag = new CFDE_TxtEdtParag(this); |
| - pParag->m_nCharStart = nParagStart; |
| - pParag->m_nCharCount = nIndex - nParagStart + 1; |
| - pParag->m_nLineCount = -1; |
| + pParag->SetStartIndex(nParagStart); |
| + pParag->SetTextLength(nIndex - nParagStart + 1); |
| + pParag->SetLineCount(-1); |
| m_ParagPtrArray.Add(pParag); |
| nParagStart = nIndex + 1; |
| } |
| @@ -1012,22 +1010,22 @@ void CFDE_TxtEdtEngine::UpdateParags() { |
| int32_t i = 0; |
| for (i = 0; i < nCount; i++) { |
| pParag = m_ParagPtrArray[i]; |
| - if (pParag->m_nLineCount == -1) { |
| + if (pParag->GetLineCount() == -1) |
| pParag->CalcLines(); |
| - } |
| - nLineCount += pParag->m_nLineCount; |
| + |
| + nLineCount += pParag->GetLineCount(); |
| } |
| m_nLineCount = nLineCount; |
| } |
| void CFDE_TxtEdtEngine::UpdatePages() { |
| - if (m_nLineCount == 0) { |
| + if (m_nLineCount == 0) |
| return; |
| - } |
| + |
| int32_t nPageCount = (m_nLineCount - 1) / (m_nPageLineCount) + 1; |
| int32_t nSize = m_PagePtrArray.GetSize(); |
| - if (nSize == nPageCount) { |
| + if (nSize == nPageCount) |
| return; |
| - } |
| + |
| if (nSize > nPageCount) { |
| IFDE_TxtEdtPage* pPage = NULL; |
| int32_t i = 0; |
| @@ -1038,7 +1036,6 @@ void CFDE_TxtEdtEngine::UpdatePages() { |
| } |
| m_PagePtrArray.RemoveAt(i); |
| } |
| - m_Param.pEventSink->On_PageCountChanged(this); |
| return; |
| } |
| if (nSize < nPageCount) { |
| @@ -1048,7 +1045,6 @@ void CFDE_TxtEdtEngine::UpdatePages() { |
| pPage = IFDE_TxtEdtPage::Create(this, i); |
| m_PagePtrArray.Add(pPage); |
| } |
| - m_Param.pEventSink->On_PageCountChanged(this); |
| return; |
| } |
| } |
| @@ -1254,25 +1250,24 @@ int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex) { |
| int32_t i = 0; |
| for (i = 0; i < nParagCount; i++) { |
| pParag = m_ParagPtrArray[i]; |
| - if (pParag->m_nCharStart <= nIndex && |
| - nIndex < (pParag->m_nCharStart + pParag->m_nCharCount)) { |
| + if (pParag->GetStartIndex() <= nIndex && |
| + nIndex < (pParag->GetStartIndex() + pParag->GetTextLength())) { |
| break; |
| } |
| - nLineCount += pParag->m_nLineCount; |
| + nLineCount += pParag->GetLineCount(); |
| } |
| pParag->LoadParag(); |
| int32_t nLineStart = -1; |
| int32_t nLineCharCount = -1; |
| - for (i = 0; i < pParag->m_nLineCount; i++) { |
| + for (i = 0; i < pParag->GetLineCount(); i++) { |
| pParag->GetLineRange(i, nLineStart, nLineCharCount); |
| if (nLineStart <= nIndex && nIndex < (nLineStart + nLineCharCount)) { |
| break; |
| } |
| } |
| - ASSERT(i < pParag->m_nLineCount); |
| + ASSERT(i < pParag->GetLineCount()); |
| nLineCount += (i + 1); |
| m_nCaretPage = (nLineCount - 1) / m_nPageLineCount + 1 - 1; |
| - m_Param.pEventSink->On_PageChange(this, m_nCaretPage); |
| pParag->UnloadParag(); |
| return m_nCaretPage; |
| } |
| @@ -1286,9 +1281,9 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, |
| while (nEnd > nBgn) { |
| nMid = (nBgn + nEnd) / 2; |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[nMid]; |
| - if (nIndex < pParag->m_nCharStart) { |
| + if (nIndex < pParag->GetStartIndex()) { |
| nEnd = nMid - 1; |
| - } else if (nIndex >= (pParag->m_nCharStart + pParag->m_nCharCount)) { |
| + } else if (nIndex >= (pParag->GetStartIndex() + pParag->GetTextLength())) { |
| nBgn = nMid + 1; |
| } else { |
| break; |
| @@ -1297,11 +1292,11 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, |
| if (nBgn == nEnd) { |
| nMid = nBgn; |
| } |
| - ASSERT(nIndex >= m_ParagPtrArray[nMid]->m_nCharStart && |
| - (nIndex < m_ParagPtrArray[nMid]->m_nCharStart + |
| - m_ParagPtrArray[nMid]->m_nCharCount)); |
| + ASSERT(nIndex >= m_ParagPtrArray[nMid]->GetStartIndex() && |
| + (nIndex < m_ParagPtrArray[nMid]->GetStartIndex() + |
| + m_ParagPtrArray[nMid]->GetTextLength())); |
| ParagPos.nParagIndex = nMid; |
| - ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->m_nCharStart; |
| + ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->GetStartIndex(); |
| } |
| int32_t CFDE_TxtEdtEngine::MoveForward(FX_BOOL& bBefore) { |
| if (m_nCaret == m_pTxtBuf->GetTextLength() - 1) { |
| @@ -1353,7 +1348,6 @@ FX_BOOL CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) { |
| } else { |
| m_nCaretPage--; |
| } |
| - m_Param.pEventSink->On_PageChange(this, m_nCaretPage); |
| ptCaret.x -= rtContent.left; |
| IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage); |
| ptCaret.x += pCurPage->GetContentsBox().right(); |
| @@ -1367,7 +1361,6 @@ FX_BOOL CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) { |
| } |
| ptCaret.y -= rtContent.top; |
| m_nCaretPage--; |
| - m_Param.pEventSink->On_PageChange(this, m_nCaretPage); |
| IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage); |
| ptCaret.y += pCurPage->GetContentsBox().bottom(); |
| } |
| @@ -1397,7 +1390,6 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) { |
| } else { |
| m_nCaretPage++; |
| } |
| - m_Param.pEventSink->On_PageChange(this, m_nCaretPage); |
| ptCaret.x -= rtContent.right(); |
| IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage); |
| ptCaret.x += pCurPage->GetContentsBox().left; |
| @@ -1411,7 +1403,6 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) { |
| } |
| ptCaret.y -= rtContent.bottom(); |
| m_nCaretPage++; |
| - m_Param.pEventSink->On_PageChange(this, m_nCaretPage); |
| IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage); |
| ptCaret.y += pCurPage->GetContentsBox().top; |
| } |
| @@ -1424,7 +1415,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() { |
| TextPos2ParagPos(nIndex, ParagPos); |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex]; |
| pParag->LoadParag(); |
| - int32_t nLineCount = pParag->m_nLineCount; |
| + int32_t nLineCount = pParag->GetLineCount(); |
| int32_t i = 0; |
| int32_t nStart = 0; |
| int32_t nCount = 0; |
| @@ -1444,7 +1435,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() { |
| TextPos2ParagPos(nIndex, ParagPos); |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex]; |
| pParag->LoadParag(); |
| - int32_t nLineCount = pParag->m_nLineCount; |
| + int32_t nLineCount = pParag->GetLineCount(); |
| int32_t i = 0; |
| int32_t nStart = 0; |
| int32_t nCount = 0; |
| @@ -1479,7 +1470,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveParagStart() { |
| FDE_TXTEDTPARAGPOS ParagPos; |
| TextPos2ParagPos(nIndex, ParagPos); |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex]; |
| - UpdateCaretRect(pParag->m_nCharStart, TRUE); |
| + UpdateCaretRect(pParag->GetStartIndex(), TRUE); |
| return TRUE; |
| } |
| FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd() { |
| @@ -1487,7 +1478,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd() { |
| FDE_TXTEDTPARAGPOS ParagPos; |
| TextPos2ParagPos(nIndex, ParagPos); |
| CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex]; |
| - nIndex = pParag->m_nCharStart + pParag->m_nCharCount - 1; |
| + nIndex = pParag->GetStartIndex() + pParag->GetTextLength() - 1; |
| FX_WCHAR wChar = m_pTxtBuf->GetCharByIndex(nIndex); |
| if (wChar == L'\n' && nIndex > 0) { |
| nIndex--; |
| @@ -1610,7 +1601,7 @@ void CFDE_TxtEdtEngine::DeleteSelect() { |
| int32_t nSelCount; |
| while (nCountRange > 0) { |
| nSelCount = GetSelRange(--nCountRange, nSelStart); |
| - FDE_LPTXTEDTSELRANGE lpTemp = m_SelRangePtrArr[nCountRange]; |
| + FDE_TXTEDTSELRANGE* lpTemp = m_SelRangePtrArr[nCountRange]; |
| delete lpTemp; |
| m_SelRangePtrArr.RemoveAt(nCountRange); |
| DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); |