| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fde/cfde_txtedtengine.h" | 7 #include "xfa/fde/cfde_txtedtengine.h" |
| 8 | 8 |
| 9 #include "xfa/fde/cfde_txtedtbuf.h" | 9 #include "xfa/fde/cfde_txtedtbuf.h" |
| 10 #include "xfa/fde/cfde_txtedtbufiter.h" | 10 #include "xfa/fde/cfde_txtedtbufiter.h" |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 if (ParagPosEnd.nParagIndex < m_ParagPtrArray.GetSize() - 1) { | 892 if (ParagPosEnd.nParagIndex < m_ParagPtrArray.GetSize() - 1) { |
| 893 ParagPosEnd.nParagIndex++; | 893 ParagPosEnd.nParagIndex++; |
| 894 } else { | 894 } else { |
| 895 bLastParag = TRUE; | 895 bLastParag = TRUE; |
| 896 } | 896 } |
| 897 } | 897 } |
| 898 int32_t nTotalLineCount = 0; | 898 int32_t nTotalLineCount = 0; |
| 899 int32_t nTotalCharCount = 0; | 899 int32_t nTotalCharCount = 0; |
| 900 int32_t i = 0; | 900 int32_t i = 0; |
| 901 for (i = ParagPosBgn.nParagIndex; i <= ParagPosEnd.nParagIndex; i++) { | 901 for (i = ParagPosBgn.nParagIndex; i <= ParagPosEnd.nParagIndex; i++) { |
| 902 CFDE_TxtEdtParag* pParag = m_ParagPtrArray[i]; | 902 CFDE_TxtEdtParag* pTextParag = m_ParagPtrArray[i]; |
| 903 pParag->CalcLines(); | 903 pTextParag->CalcLines(); |
| 904 nTotalLineCount += pParag->GetLineCount(); | 904 nTotalLineCount += pTextParag->GetLineCount(); |
| 905 nTotalCharCount += pParag->GetTextLength(); | 905 nTotalCharCount += pTextParag->GetTextLength(); |
| 906 } | 906 } |
| 907 m_pTxtBuf->Delete(nStart, nCount); | 907 m_pTxtBuf->Delete(nStart, nCount); |
| 908 int32_t nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) | 908 int32_t nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) |
| 909 ? ParagPosBgn.nParagIndex | 909 ? ParagPosBgn.nParagIndex |
| 910 : (ParagPosBgn.nParagIndex + 1); | 910 : (ParagPosBgn.nParagIndex + 1); |
| 911 for (i = nNextParagIndex; i <= ParagPosEnd.nParagIndex; i++) { | 911 for (i = nNextParagIndex; i <= ParagPosEnd.nParagIndex; i++) { |
| 912 delete m_ParagPtrArray[nNextParagIndex]; | 912 delete m_ParagPtrArray[nNextParagIndex]; |
| 913 m_ParagPtrArray.RemoveAt(nNextParagIndex); | 913 m_ParagPtrArray.RemoveAt(nNextParagIndex); |
| 914 } | 914 } |
| 915 if (!(bLastParag && ParagPosBgn.nCharIndex == 0)) { | 915 if (!(bLastParag && ParagPosBgn.nCharIndex == 0)) { |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 m_SelRangePtrArr.RemoveAt(nCountRange); | 1607 m_SelRangePtrArr.RemoveAt(nCountRange); |
| 1608 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); | 1608 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); |
| 1609 } | 1609 } |
| 1610 ClearSelection(); | 1610 ClearSelection(); |
| 1611 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); | 1611 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); |
| 1612 m_Param.pEventSink->On_SelChanged(this); | 1612 m_Param.pEventSink->On_SelChanged(this); |
| 1613 SetCaretPos(nSelStart, TRUE); | 1613 SetCaretPos(nSelStart, TRUE); |
| 1614 return; | 1614 return; |
| 1615 } | 1615 } |
| 1616 } | 1616 } |
| OLD | NEW |